View Full Version : setInterval question
SpiderJerusalem
10-08-2002, 03:06 PM
Probably a simple question but I'm having no luck getting a setInterval to not loop. Any suggestions? Thanks
obj = new Object();
obj.interval = function(){
loadMovieNum("box1.swf",2);
}
myVar = setInterval(obj,"interval",2000);
time = new Object();
function (time){
getTimer();
if (time >=5000){
unloadMovieNum (2);
clearInterval ("interval");
delete myVar;
}
}
farafiro
10-09-2002, 09:58 AM
have u read the tutorial about it in the tutorials section??
SpiderJerusalem
10-09-2002, 08:35 PM
The tutorial for timed events doesn't address clearing a setInterval. I'm simply testing the setInterval function to load a movie and then unload another movie. Let me explain in more detail.
Using the setInterval function I'm able to load my test file 'box1.swf'. The problem I'm having is removing that file after a set amount of time, and keeping it removed. The script (above) removes the clip but the statemant loops. I've tried several combinations including various combinations of getTimer,clearInterval, and even delete (object), to no avail.
Any ideas?
farafiro
10-10-2002, 06:45 AM
what u mean by the statments loops after removeing the clip?? after deleting the myVar, u can trace its value and see if it's still in so there is something wrong in the code. coz as u delete it, it supposes to do nothong
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.