iv already tried myself to use setinterval() to make it call a function for a timed powerup. like you would touch the powerup and after 5 seconds it would go back to the original value. heres what i tried,
onClipEvent(load){
function slowdownloop() {
if (counterloop >= 5){
for (var i = 0; i<61; i++) {
_root["enemys"+i].enemys.divspeed = 100;
}
counterloop = 0;
clearInterval( loopint );
} else {
for (var i = 0; i<61; i++) {
_root["enemys"+i].enemys.divspeed = 500;
}
counterloop++;
}
}
}
onClipEvent(enterFrame){
if (checkCircleCollision(_root.ball, _parent)) {
loopint = setInterval( slowdownloop, 1000);
removeMovieClip(_parent);
}
}
it doesnt work right though, it will set the divspeed to 500, then set it to 100, and just loops like that. i wanted it to just set divspeed to 500 for 5 seconds then set it too 100. can anyone fix it or write new code that does what i want? thanks :beam: