Question
Scoping Question when one movie loads a second movie
I have a movie that is just a preloader for the main movie.
This preloader movie has the loader and progress bar components so
that I can show the process of the main movie loading. When I load
a sound file in frame 1 of the main movie to be used later in the
movie and run the main movie (with out being called from the
preloader movie) the sound will play when it is called (told to
play). However if I call the main movie from the preloader movie,
the sound will not play. To make the sound play I have to load the
sound in the preloader movie.
I am sure that this is a scoping problem and I am not correctly coding for the location of the sound.
The code for loading the sound is :
if(_global.Behaviors == null)_global.Behaviors = {};
if(_global.Behaviors.Sound == null)_global.Behaviors.Sound = {};
if(typeof this.createEmptyMovieClip == 'undefined'){
this._parent.createEmptyMovieClip('BS_sndErrorMsg',new Date().getTime()-(Math.floor((new Date().getTime()) /10000)*10000) );
_global.Behaviors.Sound.sndErrorMsg = new Sound(this._parent.BS_sndErrorMsg);
} else {
this.createEmptyMovieClip('_sndErrorMsg_',new Date().getTime()-(Math.floor((new Date().getTime()) /10000)*10000) );
_global.Behaviors.Sound.sndErrorMsg = new Sound(this.BS_sndErrorMsg);
}
_global.Behaviors.Sound.sndErrorMsg.attachSound("ErrorMsgSound");
if (false) {
_global.Behaviors.Sound.sndErrorMsg.start(0,1);
}
The code to play the sound is:
_global.Behaviors.Sound.sndErrorMsg.start(0,1);
I would like to keep the preloader movie as small as possible and don’t want to load any sound files in it.
How do I load the sound files in the main movie and play them when needed (using actionscripts) from the main movie when the main movie is loaded from the preloader movie?
Thank you,
Steve

I am sure that this is a scoping problem and I am not correctly coding for the location of the sound.
The code for loading the sound is :
if(_global.Behaviors == null)_global.Behaviors = {};
if(_global.Behaviors.Sound == null)_global.Behaviors.Sound = {};
if(typeof this.createEmptyMovieClip == 'undefined'){
this._parent.createEmptyMovieClip('BS_sndErrorMsg',new Date().getTime()-(Math.floor((new Date().getTime()) /10000)*10000) );
_global.Behaviors.Sound.sndErrorMsg = new Sound(this._parent.BS_sndErrorMsg);
} else {
this.createEmptyMovieClip('_sndErrorMsg_',new Date().getTime()-(Math.floor((new Date().getTime()) /10000)*10000) );
_global.Behaviors.Sound.sndErrorMsg = new Sound(this.BS_sndErrorMsg);
}
_global.Behaviors.Sound.sndErrorMsg.attachSound("ErrorMsgSound");
if (false) {
_global.Behaviors.Sound.sndErrorMsg.start(0,1);
}
The code to play the sound is:
_global.Behaviors.Sound.sndErrorMsg.start(0,1);
I would like to keep the preloader movie as small as possible and don’t want to load any sound files in it.
How do I load the sound files in the main movie and play them when needed (using actionscripts) from the main movie when the main movie is loaded from the preloader movie?
Thank you,
Steve