SetInterval Question
SetInterval Question
- Started
- Last post
- 4 Responses
- aktive
How do I set the code to gotoAndPlay frame 250 after 15 seconds? I'd like to put this action on the first frame. Thanks
- blaw0
create a function to gotoAndPlay, then use setInterval to call that function.
- aktive0
Figured it out:
stop();
function aktive() {
gotoAndStop(2);
}
setInterval(aktive,15000);
- heavyt0
dont forget to clear the interval.
otherwise, you are gonna be looping it every 15 seconds.
unless that is what you are trying to do.
- Mick0
You will need to clear your interval or it will keep running (forever)
stop();
function aktive() {
gotoAndStop(2);
clearInterval(myInterval);
}
myInterval = setInterval(aktive,15000);You can also use settimeout which is much easier for calling a function once only...