16
Sep
07

AssetLoader.as

This is my first code release in about 5 or 6 years. Warning: It comes without warranty and the only person to debug and use it has been me. Also note that it has grown over the last 2 years and is written in AS2. For all I know it’s totally useless or already built in with AS3.I wrote this class out of frustration. It seemed like every time I started a new project I had to write freakin’ preloader logic. I HATE PRELOADING STUFF. I hate reinventing the wheel even more. There seems to be a ton of preloaders out there but projects seem to have this component loading that and this clip handling an event for loading that etc. So it has seemed to be an endless cycle of writing XML onLoad events and MovieClipLoader error handlers over and over. This class was an attempt to stop doing all that over and over.The basic jist of the class is that you can declare an instance of it, added a list of things you want to preload to it and assign a callback for when they are all done. It will take the core move (self), XML, CSS and images/SWFs and handle all the need events internally for you. As I write this I’ve never used it with sound or video which I usually do within a video player or sound player class. If you want, you can also set up listeners for the broadcasting of events within the class. Start, complete and updates with a percentage are all broadcast from within.If you take the time to download the file PLEASE take a second to post a comment or email me your thoughts of the class. Let me know if it’s junk, deprecated or the best thing you’ve grabbed in a few weeks.Download AssetLoader-1.0.zip


3 Responses to “AssetLoader.as”


  1. 1 J.j. Sep 17th, 2007 at 11:35 am

    i always like to look at your code, it’s always so nice and clean and neat.

  2. 2 F8 FLA please Sep 17th, 2007 at 5:54 pm

    Can you save this as Flash 8, the FLA appears to be CS3 - thanks!

  3. 3 mr.b Sep 17th, 2007 at 9:22 pm

    Sorry everyone… that wasn’t the smartest thing I’ve done. I’ve saved it as Flash 8. Also, some great points have been brought up including someone asking why not have a loadVars type. I’ll add that when time allows. Thanks! These are exactly the things I wanted to hear back.

Comments are currently closed.