H  15  16.1  16.2  17  18  19  20  21  22  23 

Hands-On: Flash MX 2004 Working with Sound File

Exercise 19: Loading a Streaming MP3 File

You can load a MP3 music audio file using a built in Flash behavior. The advantage to this process is that the file is loaded when needed, and it never increases the size of the original Flash movie. Steaming MP3 files are not a part of a pre-existing Flash movie, they’re just available form a common location.

Streaming MP3 audio files begin playing before they’re completely loaded; for large files this cuts down on the wait time for the page or music to load.

  1. Select a button object from the Window > Other Panels > Common Libraries > Buttons and drag it on the Stage, or use a Timeline Keyframe to place the sound.
  2. Load Streaming Sound Click the plus sign +, located in the upper-left portion of the Behaviors panel, point to Sound, and then click Load Steaming MP3 file.
  3. Enter the URL to the source MP3 file and the sound instance name placed in the Properties Inspector panel.
    Load streaming MP3 file
  4. Enter a unique name in the instance field, I chose music for this exercise.
    arrowProperties Inspector for button
  5. Click OK.
  6. Click the Control menu, and then click Test Movie, or [Control] + [Enter] to test the ActionScript.

 

Back to Top