Internet Commerce

Partners & Affiliates

Developer Channel


Featured Flash FLA
Gallery Downloads 11401 Flash Movies | 5 New Flash Movies Added
What's New | Top 100

Featured FLA

»  Author Miguel Panos
»  Title: Tarta
»  Description: It is a circle graph or pie chart that takes the data entered by user
»  More by Miguel Panos


Random FLAs | Add Flash Movie
Featured Flash Site
Gallery Downloads 4839 Flash Sites | 1 New Flash Links
What's New | Top 100 Flash Site

Featured Site

»  AuthorDeft Creative Ltd
»  Link: Home Page
»  Description: Portfolio site for .DeftCreative Ltd. A UK based web design studio specialising in flash websites, games and interactive CDROMs. With an emphasis on making things different.


Random Links | Add your own Flash Related Links
Flash Tutorials 1484 Tutorials 7 New Tutorials Added!
What's New | Top100

» Making Automatic Training Screen Capture Easily
» Create Undersea Life Animation
» Making Deinterlace Video with a low bitrate Easily
» How To Make A Simple Animation Using Christmas Clips
» Simple Step by step flash game tutorial Spot the diffrence
» How To Make A Moving Text Slide
» Create Flash Banner With Text Float Effect
» How To Make Zoo Photos Slideshow
» How To Make A Dolphin Photos Slideshow
» Unknown Tag: Title10
Random Tutorial | Add Site


Tutorials Home What's New Top Rated Submit myTutes Random!

Search Tutorials


Tutorials Tutorials » Getting_Started

Categories Adding and Controlling Music in a Flash Movie
Author: Oleg Lazarenko | Website: http://www.metamorphozis.com |

 
Page 1
1

Adding and Controlling Music in a Flash Movie.

a. Launch Flash MX 2004

b. Create new Flash file. Click File> New…
Screenshot

c. Select Flash Document in a new window
Screenshot

d. Now you need to download some sound loop to put it into your new flash file. The best place to get the sound loops is:
http://flashkit.com/loops/
Just download any from the thousands of selected loops on your computer and remember the folder where you saved it. Now click "File -> Import -> Import to Library…"
Screenshot

e. You should see the "Import to Library" browsing window. Then find mp3 file you have downloaded from flashkit.com and select it. Press "OK". To see the mp3 file you need to press "Ctrl+L". "Library Panel" with the imported mp3 file must appear on the right side of your flash work space. Library panel displays the objects, motion tweens, movies, shapes and images used in entire flash movie.
Screenshot

f. Click on the icon of mp3 file and drag it to the white working area. You may see that the first frame in layer is not empty now. It contains the loop you imported. Rename the "Layer 1" to "Music"
Screenshot

g. Press "Ctrl+Enter" to compile the movie. If you did everything right the inserted music should be playing now.

Let me explain you how to turn off the sound and then turn it on again. We will create on and off buttons. You may use the same technique, while you making your flash intro or website, for those people, who do not like to listen to the music loops. To tell you the secret, those loops can be really annoying. I think if somebody puts music on his page then he should provide website user with some solution to stop it. "On/Off Music" button is better way to do that then simply making your visitors close browser window.

h. You may read how to make buttons by clicking the link below:

http://www.metamorphozis.com/tutorials/flash_creating_buttons_tutorial.shtml

Add 3 new layers and name them: "On button", "Off button" and "Word". Create 2 buttons: "On" and "Off" in the corresponding layers, add the word "Music" to the "Word" layer.
Screenshot

i. Press "F9" to open the Action panel. To copy and paste action script codes use the right window of the action panel. On the illustration bellow you may see that the appropriate window is marked with the red sign "Copy your Action Script Code Here!!!"
Screenshot

j. Click on the "On" button to select it and copy and paste the following piece of code:
on (press){
gotoAndPlay(1);
}
Screenshot

k. Click on the "Off" button to select it and copy and paste the following piece of code:
on (press)
{
stopAllSounds();
}

l. Now we need to add one more frame to all 4 layers. Then click the lower layer "Music" in the Time panel and paste the following code:
stop();
Screenshot

m. Well, we are ready to test it;-) Press "Ctrl+Enter" to see the movie. Click on the "Off" button to turn the music off and "On" to switch it on from the beginning.

n. This is basic techniques of manipulating sounds in flash. We plan to add more advanced tutorials later so stay in touch to get more tutorials from Metamorphosis Design:-)

Click here to download source fla file.

About the Author: Oleg Lazarenko
Production manager of
Metamorphosis Website Design Studio -
Custom design, Website Templates,
Web design Articles and Tutorials.

You may reprint this tutorial for free as long as the content, About the Author sections and all links remain unchanged.

1

» Level Basic

Added: : 2004-11-01
Rating: 7.39 Votes: 42
Hits: 736
» Author
Production manager of
Metamorphosis Website Design Studio -
Custom design, Website Templates,
Web design Articles and Tutorials.
» Download
Download the files used in this tutorial.
Download (0 kb)
Get conversion and unzipping tools for PC and Mac here!

» Forums
More help? Search our boards for quick answers!

Please rate this tutorial, 10 is the top rating, you can also click the comments link to read/write a review.
10 9 8 7 6 5 4 3 2 1
Read or Post Comments