Use A Behavior To Play An Mp3 File; Test Your Document - MACROMEDIA FLASH 8-FLASH Tutorials Manual

Hide thumbs Also See for FLASH 8-FLASH:
Table of Contents

Advertisement

Use a behavior to play an MP3
file
When you want to add interactivity to your document with ActionScript,
you can often rely on behaviors to add the ActionScript for you. You'll use
a sound behavior to play an MP3 file from the library.
1.
In the Library panel, right-click (Windows) or Control-click
(Macintosh) ping.mp3 and select Linkage from the context menu.
2.
In the Linkage Properties dialog box, select Export for ActionScript and
verify that Export in First Frame is selected.
3.
Verify that ping.mp3 appears in the Identifier text box, and click OK.
4.
On the Stage, select the playSound_btn instance.
5.
In the Behaviors panel (Window > Behaviors), click Add (+) and select
Sound > Load Sound from Library.
6.
In the linkage ID text box, enter ping.mp3, and in the Name text box
below, enter ping.
Then click OK.

Test your document

Test your document to verify that the interactivity works as expected.
1.
Select Control > Test Movie.
2.
In the SWF file, click the left button to play Scene 2.
When you finish viewing Scene 2, click Back.
3.
Click the middle button in Scene 1 to see the movie clip play.
4.
Click the right button to play the MP3 sound.
5.
Click the left button again to verify that the movie clip unloads.
Test your document 243

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents