as3: April 2008 Archives

Stop. You had me at TransformMatrixProxy.

tom.jpg

We at squidder have a total actionscript crush on Jack over at GreenSock. He continues his run of amazing classes his TransformMatrixProxy class, which performs some kind of strange voodoo magic using the transform.matrix property to let you tween skewX, skewY and more.

To get access to this awesome class, you'll need to join Club GreenSock. 50 scoots gets you these goods and more.

Faust: Use flash, skip deal with devil.

faust.jpg

We're late to the game as usual on this one, but if you've ever had a client who wanted MAXIMUM standards complacency and compatibility, its time you checked out Faust flash augmenting standard, evangelized by the future-loving folks over at space150.

Basically, its a really clever way of passing the content that you're overwriting when you use SWFObject directly into the flash. Super clean and requires only one data call. Handy for things like navigation bars, which while fancy in flash, can also easily be viewed (and indexed) without flash. Hats off, space150, hats off.

Bulk loader makes other loaders cry

url_cry.jpg

Bulk loader is an excellent open source package for managing multiple file loads in AS3. Supporting a wide variety of file types (xml, swfs, images, sounds and more) as well as multiple progress indications (files loaded / total files, weighted percentage and beyond), it's hard to imagine writing a big, asset heavy project without it.
seo_rap.jpg

Lee Brimelow, of TheFlashBlog fame, has posted up a neat AIR app that lets you easily download videos from YouTube in their original flv format. Good example of something that really works well for AIR - more often than not, people make AIR apps out of things that should really just be on the web (you need to make that countdown timer into an application? really?). Next steps: convert to quicktime and add to iTunes.

By the way, if you haven't seen the SEO rap, you owe (OWE) it to yourself to check out all of m0serious' work. Make it happen.

Delayer, uh, delays call to a function

Sometimes all you want to do is wait a few seconds to make a call to a given function, particularly when you're doing some sequenced animation. While this is certainly easier now that we've got the Timer instead of setInterval (*shudder*), it's still not a one-liner, especially once you take garbage collection into account.

That's where Delayer comes in. 

  1. import com.squidder.delayer.Delayer;
  2. new Delayer( _testfunction , 3000 , "hello there" , 33 );
  3. function _testfunction( s:String , n:Number ) : void {
  4.       trace( s + " , " + n );
  5. }

Simple enough! The only required variables are the function and the delay (in milliseconds). From there, you can pass through as many arguments you like, if any. There's also a cancel function, in case you're into that kind of thing.

Go grab it up over at our fancy Google Code project page.

And speaking of TweenMax...

TweenMax is the band new tween class, from the outrageously brilliant mind of Jack Doyle. It is the wonderful love child of TweenLite and TweenFilterLite and has some really excellent features, not least of which is the inclusion of bezier points, so we can finally and easily do some tweens on a curve. 

Amazingly, Jack managed to pack all of this functionality in 8k (vs 3k for TweenLite), so serious hats off to him - I can certainly say we'll be using this from now on. Be sure to check out his comparison chart for full deets.
tweenlite.jpg

Now more than ever, flash developers are dependent on outside source code for tweening. In as2, you could get away with using the built in tween class, but the as3 version has proved itself virtually unusable, especially in light of some of the alternatives.

There are a slew of good options out there: Tweener, TweenLite, TweenMax, Go, and more, all with similar feature sets. So which one's the best? 

We here at squidder have this debate often, with some devs who prefer Tweener and others who rely on TweenLite. Fortunately, there are others who have done the heavy lifting for us to give a numbers to numbers face-off.

My favorite point of comparison is the speed tester over at GreenSock. Although it was created by the author of TweenLite (so you could cry foul, I suppose, though it doesn't seem like there's any reason to), it seems to be the easiest way to quickly compare tweens in a real world situation.

For those of you interested in running your own test, you can roll over to the TweenBencher. Again, this is a tool created by one of the makers of a tween class (Go), but read that as you will. Regardless, the tool certainly puts out some good hard numbers.

Personally, I don't think you can go wrong with TweenLite TweenMax, but one thing is for certain: they're all better than the built-in tween classes.

ASDocs and Eclipse: BFF

Face it. Documentation is a total pain. Fortunately, generating it doesn't have to be. And while projects like NaturalDocs make things a little easier (and cleaner) to work with, there's nothing quite like a good ol' Adobe style, frame loving, totally unorganized doc folder.

Seriously, though. Commenting for ASDocs is extremely easy and ultimately a great way to go if there's even the slightest possibility that someone else might look at your code. Plus, it's standard and has a lot of great benefits, like showing up in introspection for those of you developing in FDT 3. And, if you are developing flash/AS3 in Eclipse, it's super easy to set up documentation generation at the click of a button. Screenshots and more after the jump.

AS3 library for the wiimote + mac

default.aspx.jpeg

While the folks at wiiflash.org have done a great job of providing wii functionality in flash, there remains a large-ish gap when it comes to mac support. 

That's where MoteDaemon, an awesome project out of Berlin, comes in. Ultimately, the plan is to integrate the tiny server application with the wiiflash.org library, but it updates have been spotty at best. To fill the gap in the interim, however, we have developed an as3 library based on Sebastian's javascript / as1/2 examples using the XMLSockets.

A very early version is available here and while we may not grow this library much beyond its current state -- hopefully we'll find a way to get into the wii flash library with a mac -- you may find it handy (or at least fun).
AS3 and Flash you'll lose your ink over.