function progressHandler(myevent:ProgressEvent):void{
//show progress
var myprogress:Number=myevent.target.bytesLoaded/myevent.target.bytesTotal;
bar_mc.scaleX=myprogress;
myTextField_txt.text=Math.round(myprogress*100)+"%";
}
function resizeHandler (event:Event):void {
var MovieWidth:Number = stage.stageWidth;
var MovieHeight:Number = stage.stageHeight;
mySite_mc.x=MovieWidth*.5;
mySite_mc.y=MovieHeight*.5+40;
}
The preloader bar_mc is on the timeline's first frame below the preloader code (on the actions layer), the movieclip holding the mySite_mc and its resize code (on the actions layer) is on the second frame.
The movie loads, but no preloader. Right at the end, the preloader graphics flash onscreen, and then the mySite_mc pops up. The swf then works fine.
I should mention: The same code for the preloader works fine on a timeline where the whole site plays on the same timeline.
Re: Hair Pulling Preloader Problem! by Sher Ali on Jun 28, 2008 at 6:40:53 pm
The best approach developing a full flash website is to load the main .swf file inside an empty .swf holder and the preloader will be inside the holder swf so it will show the preloader immediately.
If you use just one main swf and also put the preloader in that swf file to preloader the whole swf file then you might get problems if you have embedded a lot of fonts and also if the actionscript classes are set to be exported to first frame in the publish settings.
As you have the preloader in the same swf so make sure the export actionscript classes are set to 2nd frame in the publish settings.
Re: Hair Pulling Preloader Problem! by Terrence Dunlop on Jun 30, 2008 at 12:34:49 am
I'm sorry, Sher, I'm something of a noob to this, so I have to get this explained super clearly to me.
The empty holder swf: from a little online research, is that:
a preloader movie clip (which contains the preloader code and preloader graphics only, named "holder") which loads the main .swf, and then on _COMPLETE, it plays the main swf?
Or do you mean nesting the timeline of the main swf in a preloader movie clip whose timeline contains only the loader graphics (and code) and a load call for the main.swf?
Thanks for your time. This is the last thing (besides little tweaks) I have to figure out before I get up a functional flash site.