What would be the best way to have an MC loop after 45 seconds without having a bunch of added frames?
Here you go. Quick and easy! The bold area controls the time. 45000 Milliseconds = 45 Seconds
// DO FIRST THING (IF NEEDED)
timer = setInterval(function(){
// DO SECOND THING (AFTER 45 SECONDS)
clearInterval(timer);
}, 45000);
so where do u add, gotoandplay 1
Here you go
timer = setInterval(function(){
_root.wherever.whatever.gotoAndPlay(1);
clearInterval(timer);
}, 45000);
Sorry to be a pain but could you use this in an example. It doesn’t seem to be working for me…
Hi, Wyclef. Since you had 701 posts I imagined that you were familiar with event handlers and dot syntax. I do not know the layout of your page so I can’t know which mc you want to load, wehre it is or even if you use buttons or MCs as buttons.
Lets say your using an button and that your clip has an instance name of ABC and is on the root timeline. You would do this.
on (release) {
timer = setInterval(function(){
_root.ABC.gotoAndPlay(1);
clearInterval(timer);
}, 45000);
}
702, actually. lol. thanks for the help.
No problem. I’m glad it helped
var count = 0;
looper.onEnterFrame = function(){
count++;
if(count = 45){
trace("booya shaka!");
this.onEnterFrame = null;
}
}
Trying to upstage me!? :hitman2: hahaha Nicely done! The only problem is taht onEnterFrame functions take up RAM.