- First you have to declare a boolean variable reverse (2 values, either true or false).
- Then add event listeners for mouse over, mouse out and enter frame events to the button instance box_01.
- When the mouse pointer is on the button, reverse value is set to true.
- When the mouse pointer is NOT on the button, reverse value is set to be false.
- Event.ENTER_FRAME executes the run function continuously. It executes the run function 30 times per second if the frame rate is 30 fps.
- run function continuously checks if the reverse value is true or false.
- It goes to the previous frame when reverse is true and it goes to the next frame when reverse is false.
- You may see how the timeline pointer goes in bandwidth profiler while testing this movie.
- Check below image for reference.
