FORUMS: list search recent posts

function acting out of turn

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
function acting out of turn
on Jan 3, 2007 at 9:40:18 pm

I have a function that calls another function. No biggie. The thing that's happening is that the function being called (we'll call it showStuff()) is being run before the lines of code inside the caller function (we'll call it callStuff()) are executed. Simplified, when we run callStuff,
function callStuff(){
trace("This is a trace statement.");

function showStuff(){
trace("I am a dog.");
it is giving us an output of:
I am a dog.
This is a trace statement.
Notice the mix-up of order here.
As far as I can tell, this is an issue with a bug in the compiler; perhaps there is something that decides when a function is run in relation to another of which I am unaware....but I've tried moving both functions up and down inside my code, but it is always executing the called function before it executes lines of code that precede its call inside the caller function, when the variables used are not ready, which then messes up my results...and my output. Why?
What other possibilities can I consider that it might be? The only thing I can think of afte examining it for a day is that it must be an issue the compiler has and I just need to work around it (I've had that before....).

Return to posts index

Re: function acting out of turn
on Jan 10, 2007 at 6:21:56 pm

How are you calling the functions? It shouldn't show you anything just because you defined the functions. You should have to call them somehow whether by an event or straight call?

Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 All Rights Reserved