1 person found this helpful
Use a MOUSE_MOVE event listener to detect that the mouse has moved and then have the event handler function read the mouseX position and translate that to whatever frame it represents in the movieclip. The width of the the stage will represent the length of the movieclip so you take whatever percentage mouseX is relative to the stageWidth and move to the frame of the movieclip that represents that same % ratio relative to the movieclip's total frames.
Thanks for your reply. I've come to some success with your suggestion, thanks a lot! This is what I tried:
1. Imported a sequence of images, 25 frames on a layer.
2. Put this actionscript on frame 0:
// add Event listener for mouse moves.
stage.addEventListener(MouseEvent.MOUSE_MOVE, handleMouseMove, false, 0, true);
trace("Mouse moved: " + e.stageX);
gotoAndStop(Math.round(e.stageX / 1280 * 25));
(Frame size is 1280px wide)
I'm gonna trie some more with longer sequences now. Thanks again!
You do not need the ENTER_FRAME event listener/handler (init). Just the code inside init is sufficient with init itself.