12.6. Adding Buttons to a Presentation Using Flash 8 Cookbook Components

Problem

You want to add next and previous buttons to a presentation made with the Presentation component.

Solution

If using the frames technique, add button instances named btNext and btPrevious.

If using the named movie clip technique, add another movie clip symbol with nested button instances named btNext and btPrevious.

Discussion

The Presentation component does not add next and previous buttons by default. Instead, it allows you to specify whether you want them, what they should look like, and how they should be placed relative to the contents of the presentation. However, should you opt for adding next and previous buttons, you can do so without having to add any ActionScript code. How you can add the buttons varies slightly depending on which technique you have used to construct the presentation— sequential frames or named movie clips (see Recipe 12.5 for more details).

If you have constructed your presentation using sequential frames, you can add next and previous buttons by adding a layer to the timeline in which the sequential frames have been placed, and adding the button instances to the layer. The key is that the button instances must have specific instance names. Using the Property inspector, you can give them instance names of btNext and btPrevious. The component will take care of the rest.

If you have used the named movie clip technique to construct your presentation, adding next and previous buttons ...

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.