Question regarding sound in Flash MX

Is it possible to have a sound clip (mp3) linked to a flash movie? What I mean is, can I have it load somehow without actually putting it in my swf to keep the file size of my movie down?

If so can anybody help me with the action scripting that would be needed? It’s just background music for my intro page that should start playing as soon as the intro starts.

Thanks in advance for any help.

Quote from Reference

Sound.loadSound

Availability

Flash Player 6.

Usage

mySound.loadSound(“url”, isStreaming)

Parameters

url

isStreaming

Returns

Nothing.

Description

Method; loads an MP3 file into an instance of the Sound object. You can use the isSteaming parameter to indicate whether the sound is an event or a streaming sound.

Event sounds are completely loaded before they play. They are managed by the ActionScript Sound object and respond to all methods and properties of this object.

Streaming sounds play while they are downloading. Playback begins when sufficient data has been received to start the decompressor. As with event sounds, streaming sounds exist only in virtual memory, they are not downloaded to the hard drive.

Example

The following example loads an event sound:

s.loadSound( “http://serverpath:port/mp3filename”, false);

The following example loads a streaming sound:

loadSound( “http://serverpath:port/mp3filename”, true);

your solution:

mySound = new Sound();
mySound.loadSound(“yourfile.mp3”, true)

should work…

Hey There,

The last post was not quite what you were looking for. He is the text for dynamically loading and MP3:

mp3 = new Sound();
mp3.loadSound(“http://www.whereeveryourmp3is/nameofmp3.mp3”, true);

This should help you out, however, you need to add controls to effect volume and to turn it on and off.

You might also consider using Flash Traks and players from www.flashkit.com.

If you need any other help feel free to e-mail me at kelly.nunes@k2powered.com.

Thanks,

Kelly

i found this tutorial on using sound with flash extremely useful, it tells you everything you need to know about it, including what you are looking for. Hope it helps.

Working With Sound Objects