Tutorial 2: Changing Pages

Follow

Comments

24 comments

  • Avatar
    Brian Quinn

    When I select  Tutorial 3: Using Files. I get nothing

  • Avatar
    richard

    Oops, you're right - it's not quite ready yet. However, the help on the Image widget covers some of the same ground.

    Richard

  • Avatar
    chris brayne

    Very useable tutirial - a minor problem I have is that occasionally when previewing I get a blank black window. I have to restart the editing session to clear it.

    Otherwise splendid.

  • Avatar
    Pietenpol

    I'm enjoying this. It seems like I will be able to use it quite well but there is one thing I would like to learn how to do. My goal is an app to aid in monitoring the maintenance of bowling alley machines. Where I am stuck right now is to have a flag (basic programming and a little assembly was the extent of my archaic programming). I want to have a button that I can click on that switches from text and color depending on the state of the flag. Normally says 'Online' in green but if you tap it it changes to 'Offline' in red and that change is consistent on any page that has that button.

  • Avatar
    ben

    Hi Peitenpol.  

    Try this.

    • Add a button to a page. Set it's code name to ui.online. Set it's tapped function to switchOnline.
    • Set the background color of the button to #00bf00 (a green color)
    Copy and paste this code

    var online = true;

    function switchOnline() {
     if (online) {
      online = false;
      ui.online.backgroundColor("#ff0000");
     } else { 
      online = true;
      ui.online.backgroundColor("#00bf00");
     }
    }


     

     

  • Avatar
    Pietenpol

    Seems to work like I want it to but I'm having a little trouble copying it to other buttons. My goal on this page of the app is to have 20 buttons that should be all green by default but I can tap them and change to red or back to green depending on if the lane is down. When I copy no matter what button I press it just changes the state of the first button.

  • Avatar
    cosmikrishi

    One problem i noticed was that the button animations when navigating, work only for iPhone, not android.

  • Avatar
    kieron

    Hi cosmikrishi,

    Could you tell us which animation you're testing, what Android device you're using, and what version of Android? Also, whether you're using the most recent version of the AppFurnace Player app?

    Thanks

  • Avatar
    cosmikrishi

    I am only previewing online as of now, and the animations don't work for android!

  • Avatar
    kieron

    Sorry - I should've realised this earlier, but the page animations aren't supported for Android.

  • Avatar
    Horacio

    Hi, how change pages dynamic, by sample: 

    if(data.success){
      popup("Success: " + data.message);
      ui.inicio.show();    <---??????????? how???

    }

    thanks and sorry for my bad english.

  • Avatar
    kieron

    Hi Horacio,

    It sounds like you could do this with the "navigate.to" function, like this. It uses the page name, rather than the codename:

    if(data.success){
      popup("Success: " + data.message);
      navigate.to("inicioPageName");

    }

    Hope that helps

  • Avatar
    harshat30

    Hi there,

     

    I want my first page to wait for 3 seconds and then proceed to second page by itself. Like a splash page. How to do that

  • Avatar
    kieron

    Hi harshat30,

    I'd do this with a "setTimeout" function, something like this:

    setTimeout( function(){
        navigate.to("Page 2");
    }, 3000 );

    This calls the "navigate.to" function after waiting 3000 milliseconds (which is 3 seconds) - just make sure that you've got the name of the page correct (here, it's Page 2).

    Hope that helps

  • Avatar
    harshat30

    Thanks for the reply Kieron. BUT

    I have added that to the codes areas. It is not working.

  • Avatar
    kieron

    Hi harshat30,

    Is your second page named "Page 2"? Also, the code should be placed at the very top of your code file if you want it to run at start-up

  • Avatar
    harshat30

    Thanks man got it...

  • Avatar
    whiterock

    This works on iPad and Hudl (without animation) but not on Nexus 7. The home page button has no effect.

  • Avatar
    Nanakweku

    Hello, i want my qr code scanner app to perform this fxn after scanning *134*scanned data# call. please help me input that function to my app

  • Avatar
    kieron

    Hi,

    I can help you with your function, but I'm not sure I understand the desired behaviour.

    Could you explain the function in more detail please, breaking the behaviour into steps if possible?

  • Avatar
    Nanakweku

    This is what i want my app to do, please help! :)

    1. Scan a QR code after opening my app

    2. Assuming after scanning a QR code the hidden data is this “2234567894568”

    3. Now, I want my app to: Use the phone’s dial pad to perform the following fxn with the digits from the scan. Like this *134*2234567894568# Call

     

  • Avatar
    Nanakweku

    Hi Kieron

     

    I have attached a file. maybe you could get more understanding to what i want to do




    QR code tins.docx
  • Avatar
    kieron

    Hi,

    I understand, you can start phone calls from functions like this:

    function call() {
    af.openLinkInWebBrowser("tel:"+ number +"",true);
    }

    From a quick test, adding the * character to the string results in the function not working - so I'm not sure you're desired effect would be possible, but theoretically, you could achieve the QR code functionality like this (and including "call" as the function in the QR Code manager:

    function call(number) {
    af.openLinkInWebBrowser("tel:*111*"+ number +"#",true);
    }

    Hope that helps.

  • Avatar
    Nanakweku

    Hi,

    That helps! Thanks a lot

     

Please sign in to leave a comment.

Powered by Zendesk