I want a function to be triggered when a certain global var becomes true - I want to do this using an event listener. I can do it as a one off using an if statement, but how do you set up a listener to trigger the function if the value becomes true at any time?
you have to dispatch an event to an event listener when the variable changes.
Sorry kglad - I'm struggling to work this out.
I've had a look at a few examples, but they don't make sense to me.
I just want Flash to ....
when globals.data.vari1 becomes true, gotoAndPlay(55);
Could you please show me how this is done?
Thanks in advance if you can help out.
there's no magic way to do that. you must explicitly dispatch an event when that variable is changed. if that variable can be changed using code on 10 different timelines, you'll need to dispatch an event from 10 different locations.