Everything listed under: Actionscript-2.0

  • The Best Animation Engine for Flash / Flex - A Developer's Must-Have for Actionscript

    This is one of those things that is so good, you almost want to keep it to yourself just to have your own secret weapon.  Unfortunately, the generous author of such an ActionScript library, Jack Doyle, is such a good programmer and has given so much to the community that I feel obligated to pay it forward.

    IMHO- the Greensock Tweening Platform, TweenLite, TweenMax, etc... is the best animation engine and as3 utility library ever made.

    The Fastest.
    You can use the benchmarking application jack has on his site to test his engine with a particle generator script- check it's performance against Tweener, Flash, and other major tweening engines and the comparison is obvious- the particles fly fast and smooth at a much, MUCH higher count than any of the other engines can handle without looking like 3 fps.

    The Easiest.
    Besides being ridiculously easy to use with a quick 1-liner syntax, you can add event handlers and other interesting things all in line.  Here's a 1 second slide/fade in that cues a function called "nextAnimation()":

    TweenLite.to(anyObject, 1, {x: 100, ease: Strong.easeOut, alpha: 1, onComplete: nextAnimation} );

    The Smoothest.
    Watch your animations slide across the screen smoothly with plenty of well optimized easing classes included with the library.

    Thanks and kudos to Jack and his excellent work, the Greensock library has become a not-so-secret weapon for many flash developers. Check out the Greensock site to see how many other awesome classes you can get for things like full screen layouts, filter tweening, sequencing, easing, managing XML, and a lot more.

    Get the Greensock Tweening Platform and other great actionscript classes here.

  • Parsing XML in Actionscript (AS2 / AS3, Flash / Flex) - the EASY way

    AS2

    If you've come from a longer history with Actionscript & XML. you may have written some pretty elaborate / gnarly AS1/AS2 XML parsers in the past- and you probably know what a pain that can be.  (especially when someone tells you to change the spec!)

    If you are stuck in corporate America and thus still working in AS2, save yourself more headaches and get Jack Doyle's Greensock XML manager.  XPATH is great too, but this might be easier.  It allows you to convert XML to Object with arrays and properties, and reference nodes by name.  All in all, it's very well documented / explained with examples and very easy to use- yet another useful and stable class from Jack:

    http://blog.greensock.com/xmlparseras2/

    AS3

    If you are in AS3, you don't need much to parse XML anymore, thanks to E4X (an ECMA script approach to XML).  In fact...

    ...if you've written any for() loops to parse XML, you've already gone too far!!!

     

    Here's a great tutorial on E4X from Senocular:

    http://www.senocular.com/flash/tutorials/as3withflashcs3/?page=4#e4x 

    Here's another at dispatchEvent:

    http://dispatchevent.org/roger/as3-e4x-rundown/