This tutorial was written for the Flash Designer software, which allows you to create flash animations in a much easier way than by using Macromedia Flash. You may get Flash Designer here.
This tutorial demonstrates how to import, play and stop a MP3 sound using Flash Designer.
Import the loop
1. Launch Flash Designer and choose "Blank document" from the startup screen
2. Choose "Movie" > "Import Sound...". Select your MP3 file and click OK. Flash Designer will show the sound in the list. Click OK to close "Sounds" dialog:
3. Choose "Frame" > "Frame Sound". Select imported sound. Our sound is quite short so we make it play 10 times in the row. Click OK to close the dialog.
4. Choose "Movie" > "Play Animation" to preview the file in Flash player. You should see a blank frame with the sound playing in the background. Hit "Esc" to quit Flash player preview.
Add some graphics
We can hear the sound. Now we are ready to add some graphics and animate it.
1. Choose "Frame" > "Insert Symbol" to display symbols gallery. Choose "Musical Symbols" and select musical note symbol. It will appear in the design view:
2. While the symbol remains selected choose "Item" > "Sprite". Change speed to "Fast" and click OK to confirm "Fade" effect. The symbol will fade in and out in an infinite loop.
3. Hit F9 to preview the symbol in Flash player.
Add "Stop" button
If a user doesn't want to hear the sound add a "Stop" button.
1. Choose "Button" tool:
2. Click and draw the button somewhere in the right-bottom corner of the frame. While the button is selected choose "Item" > "Set Font". Decrease font size to 10. Click OK. To edit button text choose "Item" > "Edit Properties". Rename the button to "Stop Sound".
3. To make the button working use the following ActionScript code:
| stopAllSounds(); |
4. While the button is selected choose "Item" > "Actions" > "On Click". Select "ActionScript" and enter the code in the edit field. Click OK to confirm. Flash will execute the code when the user clicks the button.
5. To prevent animation looping and starting the sound over and over define the frame as static. Choose "Frame" > "Frame Delay" and check "Stop" option.
The last thing is to export the animation.
- Choose "File" > "Export SWF File" command. Name your swf file and click OK.
- Choose "File" > "Export HTML Page". The page should popup in a blank browser window.
Download Flash Designer source project: t1002.zip (300kb)












