flash preloader problem

Need help with Photoshop, the GIMP, Illustrator, or others? Want to show off your work? Looking for advice on your newest Flash stuff?

Moderator: General Moderators

Post Reply
Paltas
Forum Newbie
Posts: 1
Joined: Mon Dec 07, 2009 6:20 am

flash preloader problem

Post by Paltas »

Hi,
I have a problem with my preloader. You can see it here: http://www.moko.lt/Portals/0/biologija2/0pagrmeniu.html. for example press the upper button and then the one with the running skeleton on the left.

here is my preloading code:

Code: Select all

vid1_btn.addEventListener(MouseEvent.CLICK,krauna1);
 
function krauna1(evt:Event):void {
    var krauna: Loader=new Loader();
    krauna.load(new URLRequest("h001.swf"));
    krauna.contentLoaderInfo.addEventListener(Event.COMPLETE,pakrove);
    flash.media.SoundMixer.stopAll();
    stage.addChild(preloaderis)
}
 
function pakrove(aa:Event) {
    stage.removeChild(preloaderis)
    var pav1:Sprite=Sprite(aa.target.content);
    stage.addChildAt(pav1,1);
    stage.removeChildAt(0);
}
when its loading .swf file the sound comes firs. How can I fix that?
User avatar
Jade
Forum Regular
Posts: 908
Joined: Sun Dec 29, 2002 5:40 pm
Location: VA

Re: flash preloader problem

Post by Jade »

You need to do two things. First go to the properties bar for the sound file and give it an instance name, something like themeMusic or whatever. Then on the first frame of your .fla file you need to add themeMusic.stop(); which will prevent the sound from starting to play. Then once your pre-loader has finished you can call themeMusic.play();
Post Reply