ActionScript
I found the Computer Language Shootout on debian.org via Jim Rutherford and thought it was just too tempting.. just where does ActionScript fit in there? Hmm.. that's a question I've been wondering since AS3 was released to developers. I did a few tests comparing ActionScript3 and JavaScript and found that AS3 had closed the performance gap finally... but just how does AS3 compare to Fortran?
So I picked the "binary-trees" test to find out.. I've only tinkered with AS3 (I won't be able to use it for production for probably a year) so I've still got a couple of warnings showing up when it compiles, but the results are very promising.
Here are the results for Flash Player 9/ActionScript 3/Flex2 I saw on my old AMD 2Ghz Athlon Win XP system.. It looks like the system they're using, "a single-processor 2.2Ghz AMD™ Sempron™ machine with 512 MB of RAM", is fairly close to what I'm using.. so we're in the ballpark.
And here's where ActionScript3 would fit into the benchmark table for this test..

Now.. as you can see it takes roughly 39 seconds on my system to run this test.. that's not blazing at all when compared to
Clean at 1.73 seconds (on their system). ... but.. Ruby came in at 352 seconds.
Here's the SWF that I made if anyone cares to try it.. (requires Flash Player 9).
And the code.. in case someone wants to fix my errors (yep.. I'm a AS3 rookie..). Ideally I'd run their tests on my system or have them run my test SWF on their system.
There's a critical upgrade for the Flash Player that was released today, so you need to get the latest version (8.0.24.0) from
the Flash Player Download Center.
It looks like this also affects Breeze users and the Shockwave Player.. ..and.. it looks like if you're stuck using Flash Player 7 for some reason then you get an update too! Hurrah! So go get version
7r63 or 7.0.63.0 of the Flash Player. Flex 1.5 is also affected..
Read all about the upgrade and the vulnerabilities at the security zone page about.. ..it.. .
Also, you might consider signing up for the
e-mail notification service that will alert you whenever there's a security issue found with Macromedia products (I'd point you to the
Adobe page for this, but it only lists Adobe products at this point.. the acquisition is still young..)
Hey.. and for you Flash developers or designers out there.. there's a tiny gotcha in this update apparently. I'm reading
the release notes to see what else changed and noticed this:
"This update introduces additional version checking to the installation process.... Flash and Flex developers may need to make slight modifications to their normal methods of switching between player versions during testing to account for this change"
And there's
a technote on that little issue of course..
Time to get serious about learning ActionScript 3.. put down that Java book and get prepped for the next revolution in Flash.
Here's the link, and oh yeah.. you won't be compiling that with your old Flash 8 IDE.. you'll need to go
to the labs and install Flex Builder 2.0
Good stuff in there by the way.. and it's clear that unlearning much of the ActionScript 2 syntax is a necessity for working with AS3..
All of this change in Flash to a more OOP centered, make the Java and .NET developers feel warm and fuzzy when they look at Flex, etc is great for moving Flash into the position of being a more respected and used technology.. but something has been kind of bugging me for a while and I couldn't put my finger on it. Well, after looking through some of the AS3 docs it hit me... how many of the people that have made Flash such a cool technology to play with are going to stick with it? When I went to Flash conferences in the past I didn't feel terribly out of place. I got my degrees in Art and didn't go through the formal computer science degree that a lot of programmers go through, and it seemed that most of the Flash folks that I met who were doing the cutting edge stuff came from art backgrounds. Some of this might be because Flash started out primarily as an animation tool and so the folks who have used it the longest are the art crowd. Flash8 with all the new filter effects, improved video features, etc made those designers happy, but how many of the "designers turned coders" will throw in the towel when they start looking at the necessity to learn AS3? Have you
looked over the migration sheet? Gulp..
some ActionScript 3 links Wednesday, November 30, 2005
I put these together a while ago and almost lost them.. so time to post them here so I’ll have ‘em in one place..
asteroid simulator
http://www.rocketboots.com.au/preso/flashteroids.swf
Identify character under mouse
http://broadcast.artificialcolors.com
Tooltips
http://wahlers.com.br
Fluid particle demo (5000 particles on screen.. 15% cpu)
http://www.unitzeroone.com
AS3 lightening particals
http://blog.andre-michelle.com
Andre Michelle loads and displays a 3DS (3dmax) file and renders the scene including shading.. amazing.
http://blog.andre-michelle.com
Showcase on labs.macromedia.com
http://labs.macromedia.com/wiki/index.php/Showcase
bitMapArray to PNG (example code only)
http://www.kaourantin.net/2005/10/png-encoder-in-as3.html
and to JPEG
http://www.kaourantin.net
AS3 Language reference
http://livedocs.macromedia.com
AS2 to AS3 Migration info
http://livedocs.macromedia.com
Jesse has how to embed images with AS3 (yow.. I needed this..)
http://www.jessewarden.com
and adding listeners to movieclip events
http://www.jessewarden.com
AS3 “First Steps” from helpQLODhelp
http://www.helpqlodhelp.com/blog/archives/2005_10.html
and of course I have to throw in my little “Ajax vs. Flash” tests.. I’ll be updating them soon I hope..
http://oddhammer.com/actionscriptperformance/set4/