How to Create Previous and Next Buttons in Adobe Flash CS6
After your Timeline is under control in Adobe Flash CS6, you need to give users the ability to move back and forth between the images you’ve placed across the Timeline.
You should have a layer on the main Timeline with two button instances — one that represents the Previous button and another that represents the Next button.
You can use two instances of the same button symbol or instances of two unique symbols in the library. Follow these steps to create the buttons:
Drag the playhead to Frame 1.
The code you add for your buttons must be added at the beginning of the movie.
Click and select a button to use for the Previous button on the stage.
If the Code Snippets panel isn’t already visible, choose Window→Code Snippets to open it, or expand it from its icon view in the panel group on the right.
In the Code Snippets panel, click to expand the Timeline Navigation category.
Locate and double-click the Click to Go to Previous Frame and Stop code snippet.
This step adds some new ActionScript to the existing Actions layer, which is tied to your selected button.
A prompt lets you know that Flash will create an instance name for the new button automatically; click OK.
Click to select the button you’ll use for the Next button on the stage.
Within the Code Snippets panel, you should already have expanded the Timeline Navigation category. Locate and double-click the Click to Go to Next Frame and Stop code snippet. Click OK in the Set Instance Name that appears.
This step adds code to the Actions layer.
Save your movie by choosing File→Save.
Next, you test it to see your new code in action.
Choose Control→Test Movie.
When your movie launches in Flash Player, click the Next button a couple of times to advance through your images. Click the Previous button to navigate backward.