Background sound through multiple scenes in the same flash file

I’ve created a flash presentation and I would like to keep a background sound going throughout the movie. This movie has multiple scenes. I have it working fine with just one scene. I have the “on” and “off” buttons working okay for the sound in this one scene. So what do I do when I go to add scenes? I’m using Flash MX 2004 Pro.

Thank you.


if you want to have a sound play across multiple scenes, the best way is to create another swf containing the soundtrack and then loading it in at another level.
ie. loadMovie(“music.swf”,2);

Thanks JRMillion.

Could you help me out a little more? How do I control the sound from my main movie that contains multiple scenes? I want to have the “Sound On” and “Sound Off” buttons throughout the presentation. You helped me with the buttons last week and that worked fine. But now I’m going to be adding multiple scenes - does that change the action script?

Thank you.

you dont have to control the sound from main.swf.
all controlling can and should be done insite the sound.swf

create a sound.swf witch contains a sound, and a button, witch turns it
on, and off.

then in your main.swf load the sound.swf using loadMovie(“music.swf”,2);
remember, that when you load a movie onto a level (2) its possision is relatove to the 0,0 point of the main.swf. it means that your on/off button
will be displayed in the top left corner of the stage.

assuming you dont want this there are to solutions to possition your

  1. stage of sound.swf should be the same size that main.swf.
    when it is place the on/off button where you want it (ex. in the top right corner)
    it will be placed there when you load the sound.swf from the main.swf

  2. this is much more elegant and gives you much more control.
    stage of sound.swf may be whatever the size you want it.
    the trick is to load it into a movieclip, not onto a level.
    so, in the loadMovie you should use a MovieClip instance name,
    instead of a level number. ofcourse you should have a
    movieclip on the main.swf stage. for ex. create an empty movieclip on the stage,
    and call it bkgsound_mc (the _mc after the name gives you the access to the
    attributes, and methods of the mocieclip when you put “.” (dot) after the name)
    then use loadMovie(“sound.swf”,_root.bkgsound_mc);
    (loadMovie or loadMovieNum - i dont remember right now :))
    you can place the bkgsound_mc whereever you want, and the sound.swf
    will be displayed in the same place. moreover, you can even MotionTween the
    bkgsound_mc for example :slight_smile:

cool, huh?

if you find this difficult, let me know. i’ll post an example .fla for you.
take care, and good luck.

Thanks explorer_pl,

I’m not understanding fully. Do I load my sound.swf into my bkgsound_mc and then place the bkgsound_mc into my main movie?

I appreciate your help - I’m just starting to use sound in my presentations.


yes… you may do it that way. but i think it better to do in manually,
by putting the mc on the stage in the design time.

this gives you ability to animate it. ofcours you can animate the mc
using advanced actionscript, but i guess, you dont want thet yet :slight_smile:

so just put the mc on the stage byhand, that load the sound to it.

if you have any troubles, fell free to contact me. i’ll post en example then.

take care

take a look at my AS2 Extended Sound Class

take care

Thanks for your help explorer_pl.

I appreciate the help. Do you think you could post an example. When I have a minute to catch my breath, I would like to take a look at it.

Thanks again.

the example is right there in the zip file.
take a look at my thread.


Thanks. I’ll take a look at it.