This content has been marked as final. Show 7 replies
You could use an Interval or onEnterFrame to check for variables, and as each function executes, it sets a variable to lets say 1, then in an if statement, it will go on to the next function.. just set the variables to 0 before any functions execute.
How about this? I can't think of a scenario where it would not work.1 person found this helpful
Seems to me this was asked and answered last week.
It really depends on what you're doing in each of these functions. At1 person found this helpful
its very simplest, you can call the next function from the last line of
the current function. Or, you may need to set some boolean variables
that are tripped by something in one function as dzedward suggests.
Maybe if you give us a scenario that describes what you're up to,
someone can give you a suggestion that will work for you.
Adobe Community Expert
That is what I'm doing now:
It does work, but I was worried that it might not be 100% safe. Does the fact that there is one thread in this case mean that each function completes before the next one starts?
I've never had a problem. Of course your functions can't have any onEnterFrame, setInterval, externally loaded assets, that determine when they are done.1 person found this helpful
what language are you using - AS2? AS3?
Just backing up earlier comments....If the function calls are in order like that and just running as part of a sequence of instructions and not triggered by any event handlers then they should always run in order.... unless you do something intentional like mess around with them (e.g. functionOne reassigns functionTwo to functionThree and vice versa).
On a slightly different note... If the code is running in a frame on a timeline then it also doesn't matter whether the functions are defined before or after the function calls within that frame. Its also OK if they were defined in a frame on higher layers in the authoring tool. But the function doesn't exist yet if its defined in a layer lower down. This was not something I knew until just recently when someone else had a question about it and I tried it. I had assumed that the layers - which don't exist in a compiled swf would not make a difference - but it seems they do.