How to set a button with specific requirements for the next page?

I would like to make buttons go to the correct page, but the catch is that which page it should head depends on a checked slider.

I’m trying to make some kind app out of a flow chart for a game with a lot of expansions. But what you see would depend on what expansion you have. Therefore the need to have sliders(or checkboxes) bonded to certain pages. I have it now set up to go to specific pages and that works well. But I would like it to check if an expansion is on or not, and if it’s not, then it should skip all those pages. Would this be possible?

If this doesn’t make any sense, I would gladly try to elaborate :wink:

Thanks in advance,
Koda

edit: basicly I wanna know how the if - then function works :stuck_out_tongue: and how to name certain things

You can use JavaScript in the Action Editor. Here you’ll find list of all properties: https://docs.flipab.it/api/api.html

Add following action:

The code:

function () {
   var check1 = document.childByName("checkbox1").content.checked
   var check2 = document.childByName("checkbox2").content.checked
   if (check1 && check2)
     return 2
   else if (check1)
     return 3
   else if (check2)
     return 4
  else
    return document.currentPageNumber
}

See the example: controls_conditions.pma (541.1 KB)

1 Like

Thanks for the quick reply ^^
I’m a complete beginner, so this really helps out a lot.
Gonna try it out ^^
Thanks again!

Edit: Tried it out and I got it working ^^ Thanks again ^^


Back to Flipabit >
Copyright © 2018. Flipabit Team. All rights reserved.