Home >> Communication >> Motion and Sound >> Sound

Sound and Load Movie

Please read the Load/Unload movie section before continuing.

This example illustrates how you can use the load and unload movie commands to build a Music Jukebox. You will need to download the following files for this example:

mp3-Jukebox.fla
mp3-Jukebox.swf
mp3_1.fla
mp3_1.swf
mp3_2.fla
mp3_2.swf
mp3_3.fla
mp3_3.swf

How it works:

There are only 2 layers and one frame in this movie. The top layer, Text, contains the white boxes and the labels. These items are not symbols.

The button layer contains all 4 buttons. Each button has a mouse event action attached to load movie on release of mouse.

Soft Rock mp3_1.swf
Hard Rock mp3_2.swf
Jazz mp3_3.swf
Off unload movie

When you press one of the play buttons, it will load an swf file into level 1 and begin playing it.


In order for this to work the files mp3_1, mp3_2 and mp3_3 must be in the same folder as mp3-Jukebox.

 

Notice that each of the files mp3_1 and mp3_2 and mp3_3 each consist of only a single sound file on the timeline. These sounds are dragged onto the timeline, set to event, and loop 500 times. Then they are exported as a swf file. The main movie, mp3-Jukebox loads a swf file in level 1 until another movie is loaded into level 1 replacing it, or the off button is pressed, which unloads the movie from level 1.

And finally: This movie mp3-Jukebox which loads 3 different movies, can itself be loaded into a movie. See this example:

Load Jukebox in another movie