Keeping a movie loaded, even while changing scenes?

Im trying to keep a sound clip loaded thruout my movie, it works fine on each individual scene but when I switch scenes it unloads it.

Anyway to keep it static thruout all the scenes?

why are you using scenes? I always was told scenes are hazardous to your movie’s health…

Define a Sound object instance and load the sound. It should play through all the scenes. :slight_smile:
[AS]mySound = new Sound();
mySound.loadSound(“mySound.mp3”, true);[/AS]
http://www.macromedia.com/support/flash/action_scripts/actionscript_dictionary/actionscript_dictionary654.html

Edit. I agree, Random Hero. :stuck_out_tongue:

Its not a .mp3

It’s a .swf that has 5 sounds on it, which is why im using load movie =o

… and yes I totally agree now after building an entire movie in scenes that they are the worst =(

Then create a MovieClip and load the SWF. :stuck_out_tongue:
[AS]this.createEmptyMovieClip(“soundMC”, 9876);
soundMC.loadMovie(“sound.swf”);[/AS]

sweet! it worked, thank ya

now if I can only figure out how to set it under a certain layer

[AS]MovieClip.createEmptyMovieClip(instanceName, depth);[/AS]
Set the parameter depth to a lower number. :wink:

http://www.macromedia.com/support/flash/action_scripts/actionscript_dictionary/actionscript_dictionary512.html

how do I determine the depth I need to set the movie clip at?

You could use the MovieClip.getDepth method.

Let’s say you want put soundMC under a MovieClip called myOtherClip…
[AS]var depth = myOtherClip.getDepth()-1;
this.createEmptyMovieClip(“soundMC”, depth);[/AS]
Beware, you can’t have two instances at the same depth, if a MovieClip already exists at that depth, it will be replaced by the newly created MovieClip.

There’s also Button.getDepth and TextField.getDepth, by the way.