Advanced Actions
Advanced Actions allow you to perform more powerful sequences of actions and connect with JavaScript functions.
Conditional Actions
Umajin Editor supports simple conditions in your action sequences. This allows you to do things such as go to different pages depending on the state of the Project. Conditions mainly work using Global Variables.
The conditions work similarly to those in programming languages, with the exception of combining multiple conditions or “nesting” – see below.
- After an If Condition, any actions will be performed if the condition is true.
- If the condition is NOT true, and there is an Else, then actions after the else will be performed instead.
- If there is an End Condition, then actions after it will always be performed.
The First Time Only action can be followed by Else or End Condition, in the same ways as an If Condition.
If you use an Else without an If first, it will just be ignored and the following actions will be performed as if it wasn’t there. The same applies for End Condition. You will see a warning in the script console.
Combining several alternative conditions
One can combine multiple conditions with Else followed by If Condition:
if [myvar] is "Yes" ... else if [myvar] is "No" ... else if [myvar] is "Maybe" ...
Nesting
- An If Condition is always checked if it’s encountered during the actions.
- If a condition fails, it jumps to the next Else or End (whichever is first)
- There is no true nesting; an else or end always applies to all the conditions above it.
action 1 if condition A action 2 if condition B action 3 if condition C action 4 else action 5 end action 6
Advanced Actions
Else | Follows actions after an ‘If Condition’ and introduces an alternative set of actions to execute when the condition is not met. It may be followed by an ‘End Condition’ which returns back to running all actions without conditions. |
End Condition | Marks the end of a set of conditional actions, following an ‘If Condition’ or ‘Else’. All the Actions after the ‘End Condition’ will always be executed. |
Execute JavaScript | Lets you execute a small amount of JavaScript. You can call a function you have included in your scripts folder or use any global variables or variables available via data binding, as those will be replaced first. |
First Time Only | Stops all actions that come after it from running if they have ever run before (even if the App has restarted). You can reset their status so they will run again with the action ‘Reset First Time Actions’. |
If Condition | Controls whether other actions are executed. You can check the values of global variables or event parameters, using numbers and text to compare. If the condition is met, then the actions that follow are executed. |
Print to Console | Outputs a message to the Script Console Panel inside Umajin Editor. Helpful when debugging your project. |
Reset First Time Actions | Resets First Time Actions to thinking that they have not run before so that they may fire once more. |
Set Component Focus | Sets the focus on the component you designate. |
Set Global Variable | Sets a global variable such as a myvar that can then be accessed by using [myvar] as an action parameter. Use this action to store values that you need to use later. |
Touch Blocker | Stops actions/touches from triggering actions behind the component you add it to. Useful for blocking/stopping default back navigation. |