How to Create Previous and Next Buttons in Adobe Flash CS6 - dummies

How to Create Previous and Next Buttons in Adobe Flash CS6

By Jennifer Smith, Christopher Smith, Fred Gerantabee

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:

  1. Drag the playhead to Frame 1.

    The code you add for your buttons must be added at the beginning of the movie.

  2. Click and select a button to use for the Previous button on the stage.

  3. 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.

  4. In the Code Snippets panel, click to expand the Timeline Navigation category.

  5. 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.

  6. A prompt lets you know that Flash will create an instance name for the new button automatically; click OK.

  7. Click to select the button you’ll use for the Next button on the stage.

  8. 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.


  9. Save your movie by choosing File→Save.

    Next, you test it to see your new code in action.

  10. 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.