Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

determining when a function finishes

Status
Not open for further replies.

rube

Programmer
Dec 24, 2000
41
0
0
CA
hello,

i can't think of a good way to tell when a function is finished. i wanna do this:

function function1(){
function2();
function3();
}

i want function2() to finish before the function3() starts.
anyone?

thank you
 
How about...

function function1(){
function2();
if (condition_set_in function2()== true){
function3();
}
}

Regards,
new.gif
 
thanks, but i have an issue. if the value set in function2 is not true, then the function3 will not execute before the main function ends, will it? function3 must execute, whether or not f2 returns anything, but not until it finishes. i can easily mimic the effect using a movie clip, but i'd rather have a series of functions than a jumble of clips that each perform a different role.

in this case, i am reading info from an asp page, and when that task is done, load those variables into objects or an array. obviously, i need to have all variables loaded from the page before i can go ahead and create the array. is there a better way to automate this process than to use a clip or a function?
 
It might be better to use the onClipEvent(data) action - this will actually not fire until the data you've requested is loaded.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top