Hi,
 
if you just need to start and finish a function before the next one
execute, i'll have no problems, thats the default behavior.
 
private function doThisFunction():void
{
myFunctionOne(); // execute and wait for it returns
myFunctionTwo(); // execute and wait for it returns
myFunctionThree(); // execute and wait for it returns
}
 
Think this way, if you need a return for variable, you need the complete
execution of the function before it goes for the next one
 
private function doThisFunction():void
{
var a:String = myFunctionOne(); // execute and wait for it returns
myFunctionTwo(a); // a isnt null
}
 

________________________________

De: [email protected] [mailto:[EMAIL PROTECTED] Em
nome de Mike Anderson
Enviada em: quinta-feira, 3 de abril de 2008 13:35
Para: [email protected]
Assunto: RE: [flexcoders] Question on calling multiple Functions in
sequence



Thank you Rick - I will take a peek at this, and see if I can integrate
this into my app.
 
Again, thank you everybody else - I appreciate it :)
 
Mike

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Rick Winscot
Sent: Thursday, April 03, 2008 2:55 AM
To: [email protected]
Subject: RE: [flexcoders] Question on calling multiple Functions in
sequence



You could create an 'event chain' to prevent collisions... I've attached
a sample for reference.

Rick Winscot

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Mike Anderson
Sent: Wednesday, April 02, 2008 7:54 PM
To: [email protected]
Subject: [flexcoders] Question on calling multiple Functions in sequence

Hello All,

I was wondering how things work, when calling multiple functions in
sequence. For example, in this function:

private function doThisFunction():void
{
myFunctionOne();
myFunctionTwo();
myFunctionThree();
}

When I execute "doThisFunction", does it literally run the 3 functions
"one-two-three", or does it execute the first function, waits for it to
finish, then runs the second function, waits for it to finish, then
finally runs the third function. How could "doThisFunction" possibly
know when "myFunctionOne" even finishes?

My end goal, is to create a way for a function (containing more
functions within) to stop and wait for each function to "run &
complete", before executing the next one. I know Events are used quite
often when things must happen in a sequence, but when it comes to things
like "Scaling or Sizing a Component", how could I possibly know when
something like that finishes?

Thanks in advance for any advice you can all throw my way :)

Mike

 

Reply via email to