Information Technology Reference
In-Depth Information
Make a Movie Clip of the Sound File for Easy Handling
Placing sound files on the main stage in Flash gets a bit messy. The timeline
expands and now you can't really control the audio they way you might like. To
solve this problem, you can place the sound file in a movieclip symbol. This
will allow you to place the movieclip on the main stage and control the sound
with ActionScript.
• Create a new movieclip symbol by going to Insert>New
Symbol>Movieclip. Name the new symbol sound_clip_mc.
• Place a keyframe in the first frame, first layer. From the Properties
Inspector>Sound drop down menu pick the sound. All the available
sounds from the library will be showing here.
• Go back to the main timeline by clicking Scene 1 on the Scene path tabs
above the timeline.
• In the sound layer, click on Frame 1 and drag sound_clip_mc on to the
outer part of the stage. The file does not need to lay on the stage because
it is a sound file embedded in a movie clip that will play anywhere in the
stage window it is placed.
Save and test the movie (F12). The sound should play. The button is not
created and will not show yet. Close the Flash player window and let's
begin the next phase of creating the audio on/off switch.
Next we will make the button. The button will act simply as a rollover graphic.
We will be coding the ActionScript to an invisible button . The invisible button
is great for starting to develop your interactive tendencies in Flash. The button
symbol we make now will have a text rollover that will grey out the on/off switch
when rolled over.
Make a button by going to Insert>New Symbol>Button. Name it
text_btn. This will catapult you into the button symbol editor which has
the UP, OVER, DOWN, HIT states that we discussed earlier in the text.
We want to create a rollover only for this audio switch so all we really need
are the up and over states. The hit state is not needed because it's job will
be performed by an invisible button.
Select the text tool in the Flash tool panel. Go to the UP state and type
in the words:
music on / off. Use the same color text for all the words.
Search WWH ::




Custom Search