Archive for January, 2008

AS2 SequentialLoader Class:

A long while back, i needed to write a class that could be used to load a series of swfs or images in sequence, and monitor the progress of each item in the sequence or the sequence as a whole. SequentialLoader is what i came up with, and it has come in handy every once and a while since. Essentially, the instance is created by passing in an array of assets (images or swfs) and an array of holder MCs to load the assets into. Once instantiated, startLoad can be called on the SequentialLoader instance, and the instance will broadcast events to anything that has registered as a listener.

Now that i'm thinking about making it publicly available, i've decided to go back and clean it up a bit. It should be done in a day or two, and when it's ready, i'll post the code, and an example for download. Check back for updates to this post...

Here's a really simple example of how the class is used:

Actionscript:
  1. import com.staticmethods.loader.SequentialLoader;
  2.  
  3. var assets:Array = new Array("one.jpg", "two.jpg", "three.jpg");
  4. var holders:Array = new Array(holder1_mc, holder2_mc, holder3_mc);
  5.  
  6. var sl:SequentialLoader = new SequentialLoader(assets, holders);
  7. sl.addEventListener(SequentialLoader.EVENT_SEQUENCE_COMPLETE, this.handleSequenceComplete);
  8. sl.start();
  9.  
  10. function handleSequenceComplete($eventObj:Object):Void
  11. {
  12. trace("Everything is loaded!");
  13. }

Another Flash/Development Blog:

Ok. So, it seems that everybody has a flash/development blog now days. I had been thinking about setting one up for a while now, but it never happened - mostly because i could think of like 100 other things i should be doing instead. Like sleeping. Or showering, maybe.

Then the other day, my friend Matt (he has a blog too), was asking if it would be ok to distribute an ActionScript class that i had wrote, to some people that were interested. I thought, "Sure, that's fine...", and after some back and forth, he had convinced me that i finally needed to set up a blog of my own. So here it is... Thanks Matt, for getting me to set it up, and answering my wordpress-noob questions.

More posts to come, maybe.