Tutorials on Using Conditionals

Hi. I believe you touched on using conditional logic in another post but are there any tutorials specific to using/implementing conditionals?

For example, we are trying to build a settings panel where “A” would do one thing, “B” another and when “A+B” are both selected, a third thing happens.

It can be done using Actions editor.

function () {
    if (document.childByName("switchA").content.checked && document.childByName("switchB").content.checked) {
      document.childByName("rect").setY(0.8)
      return "Both checked"
   }
   else  if (document.childByName("switchA").content.checked)
      return "A checked"
   else  if (document.childByName("switchB").content.checked)
      return "B checked"
   else  {
      document.childByName("rect").setY(0.2)
      return "None checked"
   }
}

See the attached example simple_condition.pma (1006.1 KB)


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