This is more like what you are looking for:
addEventListener(Event.ENTER_FRAME, function(e:Event){ if(currentFrame == totalFrames){ stop(); removeEventListener(event.type, arguments.callee); } });
I added an event listener (for ActionScript 3), so on each frame this function will be launched and check which frame it is on. If this is the last frame, it will stop. Based on your example, I assume that you have a class extending MovieClip.
Newtang
source share