facebook

Help

  1. MobiOne Archive
  2.  > 
  3. Getting Help – General
Viewing 15 posts - 16 through 30 (of 46 total)
  • Author
    Posts
  • #329394 Reply

    adikate
    Member

    hello sir, its been a week since my last post. i dont want 2 disturb u guys since u might b busy but i just need to know y my code is not xecuting. Last week i even attached my designs,any help…

    #329401 Reply

    Hi adikate,

    I’ve reviewed your files and added the code necessary to get it working. Let me know how it goes.

    Attachments:
    You must be logged in to view attached files.
    #329405 Reply

    adikate
    Member

    i downloaded the file that u sent me. when i open screen1 there is an error showing Unsupported form version and the remaining two design files screen2,screen3 is opening well. i am attaching the screenshot of the error. please let me know wat the problem is….

    Attachments:
    You must be logged in to view attached files.
    #329406 Reply

    @adikate,

    My bad! I shared with you the modified files with 2.1 preview release. Anyways, I didn’t changes on the designs, so, if you replace the screen1_custom.js file on your screen1_www folder, the project should works.

    #329415 Reply

    adikate
    Member

    hello Octavio thanks for the reply. Everything working fine now. i have a couple of questions…

    1.what is the use of next button in my app bcoz when running when i press YES or NO it is automatically redirecting to next screen(without pressing the next button). I even tried by replacing the next button but when i execute its not going to next screen.so is there any option that i can replace that NEXT button.

    2.can i use the same code if i have 5 screens(4 Screens Consisting of Two items with YES and NO button and the 5th(Final) Screen is the result)

    Once again i thank for the support. I just want to improve my app with more screens please let me know ASAP Octavio.

    Kind Regards

    #329429 Reply

    adikate
    Member

    hello Octavio thanks for the reply. Everything working fine now. i have a couple of questions…

    1.what is the use of next button in my app bcoz when running when i press YES or NO it is automatically redirecting to next screen(without pressing the next button). I even tried by replacing the next button but when i execute its not going to next screen.so is there any option that i can replace that NEXT button.

    2.can i use the same code if i have 5 screens(4 Screens Consisting of Two items with YES and NO button and the 5th(Final) Screen is the result)

    Once again i thank for the support. I just want to improve my app with more screens please let me know ASAP Octavio.

    Kind Regards

    #329433 Reply

    adikate
    Member

    To make it clearer octavio let me give the picture of my improved app.I got 4 screens(Screen1, Screen2, Screen3, Screen4) which consists of 2 items(Screen1: WHITE, BLUE – Screen2: PINK, VIOLET, etc ), two buttons(YES, NO). There will be a final screen(Screen5) for the Result to be displayed

    If I press all YES in Screen1, Screen2, Screen3, Screen4 then i should get message in Screen5 as WHITE
    If I press YES in Screen1, Screen2, Screen3 and NO in Screen4 then i should get message in Screen5 as BLUE
    If I press YES in Screen1, Screen2 and NO in Screen3, Screen4 then i should get message in Screen5 as PINK
    If I press YES in Screen1 and NO in Screen2, Screen3, Screen4 then i should get message in Screen5 as VIOLET
    If I press YES in Screen1 and NO in Screen2, Screen3, Screen4 then i should get message in Screen5 as INDIGO
    If I press YES in Screen2 and NO in Screen1, Screen3, Screen4 then i should get message in Screen5 as ORANGE
    If I press YES in Screen3 and NO in Screen1, Screen2, Screen4 then i should get message in Screen5 as RED
    If I press YES in Screen4 and NO in Screen1, Screen2, Screen3 then i should get message in Screen5 as GREEN
    If I press all NO in Screen1, Screen2, Screen3, Screen4 then i should get message in Screen5 as YELLOW

    #329434 Reply

    Hi adikate,

    Your goal is very doable, but you should make a few tweaks, here are some thoughts:

    As the first app had only two screen I used the var previousANS to save the value of the first answer, but now since you’ll have more screens you’ll need to use three aux vars:

    var ans1; 
    var ans2;
    var ans3;

    Then when you are checking if the current screen is the first one, you should change:

    previousANS = answer;

    for this:

    ans1= answer;

    The next will be copy and modify the first block of code for check each current screen except the last one. It should be something like this:

    if(screen==1){
        phoneui.gotoPage("m1-screen2",'NONE');
        
        if(answer=="NO"){
                $('#m1-screen2-').html("GREEN");  
                $('#m1-screen2-2').html("YELLOW"); 
        }//if
        else if(answer=="YES"){
                $('#m1-screen2-').html("WHITE");
                $('#m1-screen2-2').html("BLUE");
        }//else if
        
        ans1 = answer;
    
      }///if screen == 1
    
    if(screen==2){
        phoneui.gotoPage("m1-screen3",'NONE');
        if(answer=="NO"){
                $('#m1-screen3-').html("NEW VALUES"); 
                $('#m1-screen3-2').html("NEW VALUES"); 
        }//if
        else if(answer=="YES"){
                $('#m1-screen2-').html("NEW VALUES");
                $('#m1-screen2-2').html("NEW VALUES");
        }//else if
        
        ans2 = answer;
    
      }///if screen == 2  

    Note the lines with: “NEW VALUES”. You should change them according the values that you wish.

    For last, add this block for go to last screen:

    else if(screen==3){
        
        phoneui.gotoPage("m1-screen4",'NONE');
    
    var text ="";
        if(ans1=="NO"&&ans2=="NO"&&answer=="NO")
          text = "RESULT 1";
        
         if(ans1=="NO"&&ans2=="NO"&&answer=="YES")
          text = "RESULT 2";
         ......
         ......
         ......
    $('#m1-screen3-text1').text(text); //set the value for the result in the screen3
      }//if screen == 3
    

    Note that now you have to compare the answers for each screen (ans1,ans2,answer) and I only write two combinations.

    With this overview you can give an idea on how to achieve this task. Note that I skip a screen because it will be the same, you should only compare between the example that you already have and what I’ve described in this post. Let me know how it goes.

    #329437 Reply

    adikate
    Member

    Octavio its my last tweak for 3 days. I personally apologize for my tweaks. i am already testing my app with the help given 2 me.While calling on buttons, can i use like the one mentioned below
    Screen 1:
    Yes button: gotoScreen(1,”YES”);
    No button: gotoScreen(1,”NO”);

    Screen 2:
    Yes button: gotoScreen(2,”YES”);
    No button: gotoScreen(2,”NO”);

    Screen 3:
    Yes button: gotoScreen(3,”YES”);
    No button: gotoScreen(3,”NO”);

    Screen 4:
    Yes button: gotoScreen(4,”YES”);
    No button: gotoScreen(4,”NO”);

    #329438 Reply

    Hi adikate,

    Yes, you’re right. You should call the same function changing the parameters according the current screen. This is necessary to save the aux vars and get the last result. Let me know if you need more assistance.

    #329440 Reply

    adikate
    Member

    Hello Octavio i am glad to say that my code executed successfully. i am so happy and thanks for all the support given to me. Octavio i just want 2 clarify 2 doubts.

    1.what is the use of next button in my app bcoz when running when i press YES or NO it is automatically redirecting to next screen(without pressing the next button). I even tried by replacing the next button but when i execute its not going to next screen.so is there any option that i can replace that NEXT button.

    2.How can i implement ads to my app so that i can make it free 2 use for everyone

    Kind Regards

    #329485 Reply

    adikate
    Member

    hello Octavio, i am getting result for every thing individually but if i mix all conditions i am not getting values for some conditions(BLUE, WHITE, PINK). I dont know where the problem is, can u please help me…
    HERE are my conditions that are not getting the values

    if(ans1==”YES”&&ans2==”YES”&&ans3==”YES”&&answer==”NO”)
    text = “BLUE”;

    if(ans1==”YES”&&ans2==”YES”&&ans3==”YES”&&answer==”YES”)
    text = “WHITE”;

    if(ans1==”YES”&&ans2==”YES”&&ans3==”NO”&&answer==”NO”)
    text = “PINK”;

    #329513 Reply

    adikate
    Member

    how to clear cache. i am getting everything wat i need but when i am not pressing YES/NO and simply pressing NEXT then its showing the same answer which i got previous. So i want to clear the previous answer. Any help please…

    #329575 Reply

    adikate
    Member

    how to clear cache. i am getting everything wat i need but when i am not pressing YES/NO and simply pressing NEXT then its showing the same answer which i got previous. So i want to clear the previous answer. Any help please…

    #329582 Reply

    Hi adikate,

    As I mentioned in one of my earlier replies to this topic, your request is similar to another topic, so I assumed that your goal was the same but with more screens, but apparently, you want to first select the answer and then move to the next screen. In that case, I recommend the following:

    for each YES / NO button on each screen to create a function that changes the value of the variables ans1, ans2, …

    function changeAns1(answer){
        ans1= answer;
    }
    
    function changeAns2(answer){
        ans2= answer;
    }

    Then you can remove the answer parameter from gotoScreen function:

    function gotoScreen(screen){
    ...
    ...
    }

    Last moditication is call this function with your next button. have in mind that you’ll have to ensure that user have to select an option to avoid undesired results.

    Hope this is clear and helpful. Please let me know how it goes.

Viewing 15 posts - 16 through 30 (of 46 total)
Reply To: Help

You must be logged in to post in the forum log in