Presentation is loading. Please wait.

Presentation is loading. Please wait.

XP Tutorial 5 Buttons, Behaviors, and Sounds. XP New Perspectives on Macromedia Flash MX 2004 2 Buttons Interactive means that the user has some level.

Similar presentations


Presentation on theme: "XP Tutorial 5 Buttons, Behaviors, and Sounds. XP New Perspectives on Macromedia Flash MX 2004 2 Buttons Interactive means that the user has some level."— Presentation transcript:

1 XP Tutorial 5 Buttons, Behaviors, and Sounds

2 XP New Perspectives on Macromedia Flash MX 2004 2 Buttons Interactive means that the user has some level of control over the movie, such as being able to stop or play its animation. Buttons are symbols that contain a Timeline with only four frames, each of which represents a different state of the button. –Up frame –Over frame Rollover effect –Down frame –Hit frame

3 XP New Perspectives on Macromedia Flash MX 2004 3 Buttons

4 XP New Perspectives on Macromedia Flash MX 2004 4 Adding a Button from the Common Libraries A quick way to add buttons to your document is by using one of the buttons in the Buttons library. The Buttons library is one of the Flash Common Libraries.

5 XP New Perspectives on Macromedia Flash MX 2004 5 Viewing the Playback – Stop Button’s Behavior Once you have added a button instance to a document, it is a good idea to see how it works. Click Control on the menu bar, and then click Enable Simple Buttons. Click a blank area of the Stage away from the button to deselect the button. Position the pointer over the playback-stop button instance on the Stage. Click the playback – stop button.

6 XP New Perspectives on Macromedia Flash MX 2004 6 Editing the Button to Change its Color Double-click the button’s icon in the Library panel to open it in symbol-editing mode. If necessary, increase the magnification of the button. Click the Down frame of the appropriate layer in the Timeline. Change the color of the object associated with this layer by using the Fill Color pop-up window on the toolbar.

7 XP New Perspectives on Macromedia Flash MX 2004 7 Editing the Button to Change its Color

8 XP New Perspectives on Macromedia Flash MX 2004 8 Creating a Button Create the button’s shape on the Stage and select the shape. Click Modify on the menu bar, and then click Convert to Symbol. In the Convert to Symbol dialog box, name the symbol and assign the Button behavior to it. Add a text block to the button to label it.

9 XP New Perspectives on Macromedia Flash MX 2004 9 Testing the Button Instance’s Rollover Effects After you are finished creating the button and its different states, preview the button instance’s behavior on the Stage. Click Control on the menu bar, click the Enable Simple Buttons command to select this option, and then click a blank area of the Stage to deselect the button. Move the pointer over the button to see the rollover effect, and then click the button. Click Control on the menu bar, and then click the Enable Simple Buttons command to deselect it.

10 XP New Perspectives on Macromedia Flash MX 2004 10 Testing the Button Instance’s Rollover Effects Rollover effect

11 XP New Perspectives on Macromedia Flash MX 2004 11 Aligning the Buttons When adding several similar objects to a document, you should align the objects. Buttons should be lined up vertically or horizontally and they should be evenly spaced to give your document a professional appearance.

12 XP New Perspectives on Macromedia Flash MX 2004 12 Aligning Buttons Using the Align Panel Click Window on the menu bar, point to Design Panels, and then click Align to open the Align panel. Using the Selection tool, click the first button instance on the Stage, press and hold the Shift key on the keyboard, and then click the remaining buttons. Make sure the To Stage button on the Align panel is not selected. Click the Align bottom edge button in the Align panel. Click the Space evenly horizontally button. Close the Align panel, and save the changes you have made to your document.

13 XP New Perspectives on Macromedia Flash MX 2004 13 Understanding Actions and Behaviors Actions are instructions that are used to control a document while its animation is playing. Actions are part of Flash’s programming language called ActionScript, which is very similar to JavaScript. A script is a set of one or more actions that perform some function. An event is a situation where the user is interacting with a button such as clicking a button with a mouse and then releasing it. Behaviors are actions with pre-written ActionScript scripts which assign controls and transitions to an object on the Stage. An event handler tells Flash how to handle an event.

14 XP New Perspectives on Macromedia Flash MX 2004 14 Behaviors and Scripts Goto and Play action event Delete Behavior button Add Behavior button Symbol and name of object Event handler comments event action

15 XP New Perspectives on Macromedia Flash MX 2004 15 Adding Behaviors Using the Behaviors Panel When adding behaviors to a button, you add them to the button instance on the Stage and not to the button symbol in the library. If you want an action to execute at a certain point in the animation, then attach it to the frame where you want it to start.

16 XP New Perspectives on Macromedia Flash MX 2004 16 Adding Behaviors to Frames Behaviors in a frame execute when a particular frame is played. You can create an animation in which a group of frame is played repeatedly by having the playhead go back to an earlier time. This is called a loop.

17 XP New Perspectives on Macromedia Flash MX 2004 17 Testing the Frame Behavior Click Control on the menu bar, and then click Test Movie. The animation plays and when the playhead reaches the end of the loop, it goes back to the frame labeled Loop Start. Click File on the menu bar, and then click Close to return to the document. Save the changes to your document if the frame behavior is acceptable to you.

18 XP New Perspectives on Macromedia Flash MX 2004 18 Sound Macromedia Flash offers several ways to use sounds. You can add sounds to your document to play continuously and that are independent of the Timeline. You can add sound effects to instances of buttons to make them more interactive. You can also add sounds that are synchronized with the animations. Sounds can be added in the form of voice narrations.

19 XP New Perspectives on Macromedia Flash MX 2004 19 Types of Sounds Event sounds, which are the default type, will not play until the entire sound has downloaded completely. Stream sounds are synchronized with the Timeline and begin playing as soon as enough data has been downloaded.

20 XP New Perspectives on Macromedia Flash MX 2004 20 Finding Sounds for Your Documents Flash Kit’s Web site

21 XP New Perspectives on Macromedia Flash MX 2004 21 Finding Sounds for Your Documents Killersound at www.killersound.com SoundShopper.com at www.soundshopper.com It is best to look for sounds that are royalty free, which means that there are no additional usage fees when you distribute them with your projects. Sounds to be used with your documents must first be imported into Flash.

22 XP New Perspectives on Macromedia Flash MX 2004 22 Adding a Sound to a Button Import the sound to the document’s library. Open the button in symbol-editing mode. Create a new layer in the button’s Timeline. Create a keyframe in the frame where the sound will be placed. Select the keyframe. Select the sound from the Sound list box in the Property inspector or drag it from the Library panel to the Stage.

23 XP New Perspectives on Macromedia Flash MX 2004 23 Sound Settings Once you have added a sound to your document, you can control the way it plays by using the sound settings found in the Property inspector. Sound information Sound name Click to see available sound effects Number of times to repeat

24 XP New Perspectives on Macromedia Flash MX 2004 24 Sound Effects

25 XP New Perspectives on Macromedia Flash MX 2004 25 Sound Settings The Sync list box lets you set a sound as an Event sound or as a Stream sound. You can also control event sounds by using the Start and Stop sync settings. If you want a sound to play continuously for a period of time, then enter a number in the Repeat text box that specifies how many times you want the sound to play.


Download ppt "XP Tutorial 5 Buttons, Behaviors, and Sounds. XP New Perspectives on Macromedia Flash MX 2004 2 Buttons Interactive means that the user has some level."

Similar presentations


Ads by Google