Its all about timing
- Started
- Last post
- 4 Responses
- DJHD
Is there a way to have events happen within flash based on a timer, rather then on the time line, I am loading a swf into movie, but want to sync up things based on the movie im loading
Thanks for your time
Jamie
- Nirvous0
// Increment Time during loop
time = time + 1;
// Set timeout
timeout = 15;
trace(time);
if (time == timeout) {
_root.reciever.gotoAndStop("time...
stop();
}
- o0o0
But that's not really time based, since the framerate could vary depending on the clients machine...
Colin Moock has a good time-based animation lesson here http://www.moock.org/webdesign/l… it's for flash 5, but the principle is the same...
- finnpimp0
setInterval is the only timebased function I can think of. combine that with Nirvous script, incrementing the var with, say, 50 milliseconds interval, and when it hits 15, something goes boom.
time-based indeed.
- fusion410
Try this
// number of seconds pause
var countdown = 5;function open() {
if (countdown > 0) {
countdown--;
} else if (countdown == 0) {
clearInterval (intervalID);
play();}
}
var intervalID;
intervalID = setInterval( open, 1000 );stop();