Flash Script
none none none
none Preloader in AS3

Summary
Preloading is quite simple in as3.
The best way to explain it is just to comment the code (see below)




Warning
INIFINTE, error message
This one took me all day to figure out.
If you get the INFINITE message, it would mean you are dividing by zero ( totalBytes is set to zero).
Normally this should NOT happen, if it does happen then the cause would most likely be gzip compression on the apache server. it was for my error.
The compression on the web server seems to cause problems to the flash player and it is unable to determine the file size, hence totalBytes is set to zero. The work around is to add in the .htaccess file a rewrite rule to turn off gzip module. Just place the .htaccess file in your swf directory so it the rest of the site will remain gziped.


Code
(Cut and paste the code below into your 'actions' window, Window -> Actions. To execute, Control -> Test Movie)




none
none none none







History Licensing & Pricing Privacy Policy Contact Us
Frequently Asked Questions