Adding Behaviors To The Menu Buttons Flash

Adding Behaviors To The Menu Buttons Flash
In the last tutorial, you added the content for the individual pages of your Flash website to the Content layer along the Timeline. But you still need a way to navigate from one page to the next and like all websites we will use the buttons in the navigation menu. We have already created these buttons and now we will assign behaviors that will tell our Flash website which frame, and its contents, to display for each button. But you won't need to write any code. We will use Flash's built-in behaviors from the Behaviors Panel. So if you are ready, let's get started.

Step 1. Choose A Button. Click on Frame 1 on the Timeline Header to set the Playhead back to the beginning. The first button we will work on is the Home button so click on the Home button on your website menu.

Step 2. Behaviors Panel. The Behaviors Panel should be open in the Flash workspace so click on the Add Behavior button (plus sign) to open the drop-down list. Choose MovieClip > Goto and Stop at frame or label.

Step 3. Goto Dialog Box. In the Goto and Stop at frame or label dialog box, keep the this, _root and Relative settings for the movieclip. Now type in the name of the frame you wish to go to, which in this case is Home, and click OK. If you open the Actions Panel you will see the following code has been added. This code tells your Flash movie to go to the Home frame when the Home button is released (clicked on).

on (release) {

//Movieclip GotoAndStop Behavior
this.gotoAndStop("Home");
//End Behavior

}

Step 4. Repeat For Each Button. Repeat the previous steps for each button in your menu but each time type in the name of the corresponding frame in the dialog box.

Contact
Artist
Products
Weblog
Portfolio

Step 5. Test The Buttons. Click on Frame 1 on the Timeline Header to set the Playhead back to the beginning. Now click the Ctrl and Enter keys on your computer keyboard to open a preview of your website for testing. Click on each button in the menu and verify that the correct contents is displayed.

Step 6. Save Your Flash Movie. You can now save the new additions to your movie. Click File> Save.

Macromedia Flash MX 2004 Workspace

Copyright 2018 Adobe Systems Incorporated. All rights reserved. Adobe product screen shot(s) reprinted with permission from Adobe Systems Incorporated. Adobe, Photoshop, Photoshop Album, Photoshop Elements, Illustrator, InDesign, GoLive, Acrobat, Cue, Premiere Pro, Premiere Elements, Bridge, After Effects, InCopy, Dreamweaver, Flash, ActionScript, Fireworks, Contribute, Captivate, Flash Catalyst and Flash Paper is/are either [a] registered trademark[s] or a trademark[s] of Adobe Systems Incorporated in the United States and/or other countries.





RSS
Related Articles
Editor's Picks Articles
Top Ten Articles
Previous Features
Site Map








Content copyright © 2023 by Diane Cipollo. All rights reserved.
This content was written by Diane Cipollo. If you wish to use this content in any manner, you need written permission. Contact Diane Cipollo for details.