Right now I have my preloader in a swf and my game in another swf. I need to get them into one swf.
Right now I have a preloader with actions in frame 1 like so:
var l:Loader=new Loader();var played:Boolean=false;
var sGulagSound:Sound=new sunnyGulagSound();
var sGulagSoundChannel:SoundChannel=new SoundChannel();
var sulagSoundTransform:SoundTransform=new SoundTransform();
l.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,loop);
l.contentLoaderInfo.addEventListener(Event.COMPLETE,done);
l.load(new URLRequest("MVCSpringBeauty12512.swf"));
function loop(e:ProgressEvent):void
{
var perc=e.bytesLoaded/e.bytesTotal;
if(perc>.75&& played==false)
{
sulagSoundTransform.volume=.1;
sGulagSoundChannel.soundTransform=sulagSoundTransform;
sGulagSoundChannel=sGulagSound.play();
played=true;
}
ProgBar.scaleX=perc;
}
function done(e:Event):void
{ while(numChildren >0)
{
removeChildAt(0);
}
trace(numChildren)
addChildAt(l,0);
}
This works but still always requires that the main swf be in the folder. Is there a way to publish one SWF with both preloader and main swf in one swf ???