Friday, March 13, 2009

CHAPTER 1 - Add streaming and event sounds

When a movie is downloading from an Internet source, a streaming sound can begin to play as soon as the beginning of the sound file has downloaded. Such sounds are especially suited for continuous background sounds.

Event sounds must download completely and load into RAM before playing; event sounds are useful for buttons. In this section, you’ll learn how to accomplish the following tasks:

• Add a streaming sound to your movie
• Add an event sound to a button

To complete this section, you can either continue to work on your mystiletto.fla file, or you can browse to your Flash MX application folder and open Tutorials/FlashIntro/stiletto6.fla. If you do use the stiletto6.fla file, save the file with a new name in your My_Stiletto folder to maintain an unadulterated version of the original file.


Add a streaming sound

You can include sound in your movie by dragging the sound to the Stage. You’ll add background music that streams and plays for a specified number of times.

1 In the Timeline, with the Buttons layer selected, add a new layer and name it Sounds.

2 Choose File > Import. Within your Flash MX application folder, browse to Tutorials/ FlashIntro/Assets and click track1.mp3. Control-click (Windows) or Command-click (Macintosh) to add ping.mp3 to the selection, then click Open.

The files are imported into the library.

3 With the Sounds layer selected, drag the track1.mp3 sound from the Library panel to the Stage. In the Timeline, a small representation of sound waves appears in the frame.

4 In the Timeline, select the first frame of the Sounds layer. In the Property inspector, type 999 in the Loop text box to specify the number of times the sound can play continuously.


Test the movie

1 Save your file, then choose Control > Test Movie to hear the sound.

2 When you finish playing the movie, click the movie’s close box.


Add an event sound to a button

In addition to dragging a sound to the Stage, you can select a sound from the Property inspector. You will use this method to add an event sound to a button.

As you learned in the Creating Buttons lesson, when you create a button symbol, Flash creates frames for the different button states in relation to the mouse pointer. The Over frame, for example, represents the button’s state when the pointer is over the button. Other button frames/ states are Up, Down, and Hit.

Now you’ll add an event sound to a button, which causes the sound to play during the Over state. Because you’re adding the sound to the button symbol in the library, not just to an instance of the symbol, the sound will play for each instance of the button.

1 In the Library panel, double-click the Button 1 instance to open symbol-editing mode.

2 In the Timeline for Button 1, add a new layer and name the new layer Sound.

3 Select the Over frame (Frame 2) of the Sound layer and choose Insert > Keyframe or press F6.

4 To define the sound properties, click Frame 2 of the Sound layer. In the Property inspector, select Ping.mp3 from the Sound pop-up menu. Verify that Event is selected in the Sync pop-up menu.

5 Save your document and choose Control > Test Movie to hear the button sounds. When you finish viewing the SWF file, close its window to return to the document.
.
.
==============================================
.
Contents
Trademarks
CHAPTER 1 - Introduction to Flash MX Tutorial
CHAPTER 1 - What you should know
CHAPTER 1 - View the completed movie
CHAPTER 1 - Analyze the stiletto.fla file
CHAPTER 1 - Define properties for a new document and create a ...
CHAPTER 1 - Create and mask vector art
CHAPTER 1 - Tween bitmap effects within a movie cl...
CHAPTER 1 - Load dynamic text at runtime
CHAPTER 1 - Add animation and navigation to button...
CHAPTER 1 - Add streaming and event sounds
CHAPTER 1 - Organize your Library panel
CHAPTER 1 - Test download performance and publish ...
CHAPTER 1 - The next steps
.
CHAPTER 2 - Introduction to ActionScript Tutorial
CHAPTER 2 - View a completed movie
CHAPTER 2 - Initialize the movie
CHAPTER 2 - Save and retrieve information
CHAPTER 2 - Display information in a dynamic text ...
CHAPTER 2 - Write an expression
CHAPTER 2 - Control the flow ofthe movie
CHAPTER 2 - Create commands and reuse code
CHAPTER 2 - Use a built-in object
CHAPTER 2 - Test the movie
CHAPTER 2 - The next steps
.
CHAPTER 3 - Introduction to Components Tutorial
CHAPTER 3 - Types of components
CHAPTER 3 - View the completed form
CHAPTER 3 - Create a form
CHAPTER 3 - The next steps
.
==============================================