-
1. Re: preloader script
kglad Jan 27, 2010 11:27 PM (in response to k.loy)don't add any unneeded frames to preloaderMC and use:
function update(e:ProgressEvent):void{
var fraction:Number = e.bytesLoaded/e.bytesTotal;
preloaderMC.gotoAndStop(Math.ceil(fraction*preloaderMC.totalFrames));
}function loadCompleteF(e:Event){
play();
}
loaderInfo.addEventListener(ProgressEvent.PROGRESS, update);
loaderInfo.addEventListener(Event.COMPLETE, loadCompleteF);
stop(); -
2. Re: preloader script
k.loy Jan 28, 2010 9:45 AM (in response to kglad)Thanks, though I put this script in and it doesn't seem to be working.
I uploaded the .swf with the preloader and this script on to the site, but the area is still white while it's loading and then it plays the actual scene.
Am I doing something wrong?
-
3. Re: preloader script
kglad Jan 28, 2010 11:42 AM (in response to k.loy)your preloader won't display until all items designated to load in frame 1, have loaded. that includes all classes and embedded fonts so, if you have a lot of those things, you're not doing anything wrong. that's just expected with an internal preloader and your setup.
otherwise, you're doing something wrong.
-
4. Re: preloader script
k.loy Jan 28, 2010 12:33 PM (in response to kglad)the preloader is pretty simple just a 25 frame movie clip vector animation, no text and your script.
I'm supposed to put that code in frame 1 of the preloader scene ---right? Not the main scene.
-
5. Re: preloader script
kglad Jan 28, 2010 1:15 PM (in response to k.loy)if you're using scenes, the preloader and preloader code should be in the first frame of the first scene. what you call your scenes is irrelevant.


