Search Tutorials
The Rewind Button Next you have to create a button that will trigger the rewind code when pressed. For further instruction on how to create a button, check out our tutorial on Building Buttons. Once you have your button add the following code to it.
On (Press)
Begin Tell Target ("/rewind")
Go to and Play (2)
End Tell Target
End On
On (Release)
Go to and Play (_currentframe + 1)
Begin Tell Target ("/rewind")
Go to and Stop (1)
End Tell Target
End On
What this code does is when the mouse button is pressed it will execute the rewind code in frame 2 in the rewind engine movie clip. When the mouse button is released, normal play will resume by playing the next frame (current frame +1) then stopping the rewind engine movie clip by halting it on the first frame. Now its time to create the rewind engine code. Insert a new Movie symbol onto the stage. To do this select Insert> New Symbol from your menu. Name it "Rewind Engine" and set its behaviour to Movie Clip. When you click OK the editing screen will appear for new Movie. This engine only uses three keyframes so once you have created them place the following code in keyframe No. 1: Stop This code is the default position. The rewind engine lies dormant here until the mouse button is pressed. This is also where the rewind engine playhead is made to go to stop the rewind effect and allow normal play.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|