PDA

View Full Version : time delay in actionscript


wasp007
03-26-2003, 08:58 PM
does anybody know how to create a time delay of around 2 seconds.

I have two functions running one after the other on the main time line. But I want to put a delay at the end of the first function before it calls the 2nd one.

I dont want to put extra frames in the timeline, as I have confined all my movement using actionscript.

many thanks.

senocular
03-26-2003, 09:35 PM
setInterval (http://www.umbc.edu/interactive/flash/tutorials/setInterval.php)

tyard
03-26-2003, 09:35 PM
function firstFunction() {
trace("first function called at " + getTimer()/1000);
waitInterval = setInterval(secondFunction, 2000);
}

function secondFunction() {
clearInterval(waitInterval);
trace("second function called at " + getTimer()/1000);
}

firstFunction();