movieClip.stop(); private function onEnterFrame(e:Event = null):void { if(animate){ movieClip.gotoAndStop(movieClip.currentFrame + speed); } }