12.3. Adding Back and Forward Buttons to a Slide Presentation

Problem

You want to add back and forward buttons to a Slide presentation.

Solution

Add two button instances on the top-level slide and add ActionScript to instruct Flash how to respond when the user clicks the buttons.

Discussion

Though the Slide presentation adds keyboard navigation by default, it does not add any button-based navigation. You have to add that functionality yourself if you want it, requiring a fairly simple, two-step process:

  1. Add button instances to the top-level slide.

  2. Add ActionScript to tell Flash how to respond when the user clicks on the buttons.

Adding button instances is something with which you should already be familiar. If it is a new concept to you, review Chapter 9. Essentially, you want to create a back button symbol and a forward button symbol, and then drag instances of each symbol onto the top-level slide. Because you’re placing the instances on the top-level slide, they will appear throughout the nested slides. An important thing to keep in mind is that all artwork on the top-level slide will appear below the artwork in the nested slides. Therefore, make sure that the button instances are not going to be hidden by artwork in the nested slides.

The next step is to add the appropriate ActionScript, so that Flash knows what to do when the buttons are clicked. Slide presentations in general do not tend to lend themselves to good coding practices, and to further complicate things, the required ActionScript ...

Get Flash 8 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.