Forum Discussion
DeveloperIgniti
1 month agoCommunity Member
Nested if conditions
Hi,
It doesn't happen often, but I occasionally want an if condition within another if condition.
Is this possible?
Many thanks in advance.
JeremyDittmer
1 month agoCommunity Member
If you want to accomplish this and can't just use multiple AND & OR conditions in the initial trigger there's a couple of options:
[1] Use the base trigger to open a new layer and then add a 'on timeline start' trigger(s) to the layer that uses your additional condition(s). Make sure to add a final 'on timeline start - hide layer' trigger so you can re-show the layer. You're kind of treating the layer as a re-useable function.
[2] Resort to Javascript! I'd need to see an example of what you want to check to suggest how best to code this. In general I would do something like:
- Set a true/false variable (let's call it 'jsResult') to false. You can also use numeric or string variables. Strings are most flexible but let's stick to t/f to keep it simple.
- Run the Javascript check & set jsResult to true if your condtions are met
- Add a 'when jsResult changes' trigger that carries out your desired action 'if jsResult = value true'
Does that make sense?
Related Content
- 2 months ago
- 1 year ago
- 8 months ago