With my latest project I had lots of external assets loading. I wanted to make sure people knew something was happening while an asset was loading and I didn't want to create a preloader everytime, in comes ProxyLoader.
ProxyLoader is simply a Sprite that takes care of loading the asset via a Loader, draws a preloader, and border. It then destroys the preloader after the asset has been loaded.
One feature I added to this Class is the ability to create any type of visual preloader using the IPreloadable interface. So you can have a text preloader of one type of asset and a Movieclip for another as long as it implements the interface.
You can use the class in a very similar fashion as Loader, but you need to pass a width and height argument.
var loader:ProxyLoader = new ProxyLoader(435, 250);
loader.load(new URLRequest("path.to.asset"));
addChild(loader);
If you want to see the methods I have posted some docs here. You can download the package here. Hope it helps someone out.
Saturday, May 17, 2008
ProxyLoader Class
Posted by noti at 1:20 PM 0 comments
Labels: Actionscript 3, AS3, ProxyLoader
New Site - www.forkedup.com
Over the past 2 months I've been really busy developing and building a new AS3 site for Masterlift called Forked Up. It's a new reality TV series similar to American Hot Rod, but with forklifts. They're trying to have this show picked up by one of the networks here in Canada and the pilot looks fairly interesting.
I built the client side Flash, server sided PHP Classes and the database. It is now officially the largest project I've ever undertaken by myself. The previous was also a job from Masterlift, pimpmylift.
Hope you enjoy it.
Posted by noti at 1:11 PM 0 comments
Labels: AS3, forkedup.com
Thursday, March 20, 2008
New AIR app for Aveda
My second AIR app (the first for work) has been finished. It's an application that polls a web server and synchronizes a local database with any new media alerts.
It rose out of the need for Aveda Partners (aka AP's ... think regional managers) to have a quick and easy way to know of new media reviews on products. Previously, this was done via e-mail and caused some issues, like having many alerts in the inbox and having to sort through them all. AP's wanted the e-mail channel free for more sales related issues. They also wanted to have the ability to only download the full pdf alert for the one's they were interested in. This was especially important for AP's in Quebec, where some english alerts have had little value.
I learned quite a bit about AIR building it, like interacting with the local db and using icons. I also learned more about php building the back end.
I'm really looking forward to my next app... a rebuild of my Chart generator.
Unfortunately the application isn't publicly available but I have included a screenshot below.
Posted by noti at 12:19 PM 0 comments
Wednesday, February 27, 2008
SQLStatement lesson
I've been working a lot with the new built-in database that comes bundled with AIR and I ran into something that gave me a bit of trouble.
It was retrieving some info from the database and reading the SQLResult using the getResult() in my retrieving method from my SQLStatement. Like usual, I was trying to read if the method was called using a trace statement and also tracing out the result using getResult(). With the trace statement, I was reading everything fine, but when I went to evaluate the SQLStatement again using getResult(), I always got NULL. How can this be? I traced out a result!? Well it turns out (if you read the help files carefully) that "When there are no more SQLResult objects left in the queue, getResult() returns null." So even tracing out getResult() removes it from the SQLStatement queue! So be warned, pass it to a variable BEFORE reading it and you'll save a lot of time troubleshooting!
Another lesson learned, but it wouldn't fun if it wasn't ;)
Posted by noti at 6:24 PM 0 comments
Wednesday, February 6, 2008
AS3 Custom Events
I've read in couple of blogs (this one recently) on the problems with passing data between Objects/Classes. I, myself, used to use Proxy as well as binding data to dynamic classes (ie-MovieClip) a LOT of the time in AS2, but now in AS3 things have changed (for the BETTER!).
In comes Custom Events. I recently used Custom Events in a project where I wrote a Class for controlling the Sound object. I found using Custom Events was MUCH easier than it's reputation is known for, and very similar in nature to Proxy. Below is a quick Sample of the SoundControlEvent.
With CustomEvents it easy to read the passed property without having to access the dispatching object. As outlined below:
var evt:SoundControlEvent = new SoundControlEvent(SoundControlEvent.SOUND_POSITION);
evt.position = _channel.position;
dispatchEvent(evt);
Hopefully Custom Events will become more popular as AS3 gets futher into the mainstream. It makes for easy to read code that extremely portable.
Posted by noti at 9:11 AM 0 comments
Labels: Actionscript 3, AS3, Custom Events
Tuesday, February 6, 2007
AS3 news
I found some convincing arguments to speed up my transition to AS3. Granted they're more visual elements than arguments, but they're still convincing:
PaperVision3d - Private beta 3d engine for Flash. Available for both AS2 and AS3, but to see the real power in AS3, view this (click on the icon in the bottom right corner for FULLSCREEN). I've just got the classes and will hopefully get something together in the future. Although I love 3d, I don't anything about modeling.
computeSpectrum AS3 method - This is way overdue; the ability to generate visualizations from supported sound files. An example can be found here. (Not the best example, and you need Flash Player 9 to view it).
Posted by noti at 6:16 AM 0 comments
Labels: Actionscript, AS3