i’m reusing a function as a timer with setInterval. it works the first time around but then for some reason the counter var gets stuck at 10 (the delay var = 10) and won’t reset and start counting up from zero again…
code:
_global.count=0;
startTimer1=function(){
trace("COUNT: "+count);
trace("timer!");
if (count==delay){
_global.count=0;
trace("switch!");
if(disSet==1){
trace("switchin to 2nd set");
clearInterval(sInt1);
_global.count=0;
firstSetOut();
}
if(disSet==2){
trace("switchin to 1st set");
clearInterval(sInt1);
_global.count=0;
secondSetOut();
_global.count=0;
}
}else{
count++;
}
}