Recipe 12.3. Adding Back and Forward Buttons to a Slide PresentationProblemYou want to add back and forward buttons to a Slide presentation. SolutionAdd two button instances on the top-level slide and add ActionScript to instruct Flash how to respond when the user clicks the buttons. DiscussionThough 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:
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 is somewhat convoluted. Fortunately, however, you can apply some of the built-in behaviors from the Behaviors panel in order to have Flash apply the ActionScript for you:
After you've completed these steps, you can test your applicationyou should be able to navigate between the slides using either the keyboard or the buttons you just added.
See AlsoRecipe 12.2 |
Tripod >> 3pod Tips & Learning and manuals for educations