var i=3; btn.onRollOver=function() { a=setInterval(function(){ _root.gotoAndPlay(++i);},500); } btn.onRollOut=function() { clearInterval(a); }