PDA

View Full Version : preloader problems



SchmackLab
July 18th, 2009, 01:06 PM
So I have a preloader that works fine except that it shows up after an extended blank screen already half loaded. I understand that this is because the first frame needs to load before the preloader becomes visible.

Is there any way around this? To many of my users it just looks like a broken link.

snickelfritz
July 18th, 2009, 03:10 PM
The problem is that AS3 uses a document class which is always loaded in frame1.
Your preloader is not measuring this, since it is itself a part of the document class that must be loaded prior to any actionscript execution.

The solution is to create a host SWF that includes an instance of the Loader class and all of the preloader assets, and nothing else.
Load your content SWF into this host SWF.
Since the host SWF is extremely small, it will load very quickly, and the preloader graphics/text included within it will display the progress of your content SWF immediately.
Once the content SWF is fully loaded, remove the preloader and set it to null.

SchmackLab
July 19th, 2009, 08:04 AM
thanks I'll give it a whirl.