A week on ActionScript 3.0

So I’ve spent about a week now hacking away at the latest incarnation of Flash ActionScript. It’s been an interesting journey, and one that is getting more and more rewarding, the longer I spend time with it. AS3 has been around for a while now, but the nature of the work that I do on a daily basis has meant that I’ve not had a. the need, and b. the opportunity to actually spend any time learning it up until now.

Late last year I spent a day looking at some tutorials, and following on with them – but the only real way I know to really learn something is to actually do it. As a self-taught slash web-taught coder, it raises interesting challenges – as you rely on other’s sharing and structure to begin the process.

As part of the learning process, I set up labs.shiftperception.com/ – which I intend to fill with useful examples (for my own future reference as much as others). As is often the case though, at the moment it belies the amount of learning i’ve undergone in just a short week. However, the process of making the labs itself gave me a great start to feeling confident approaching development using this new codebase. Some reflections:

There are some really smart people out there, ready to help.

It can be daunting at first, to realise that there are soo many really good Flash developers out there that are doing amazingly cool stuff… but as you dig deepeer, you realise that these same developers are the first to offer help, examples and understanding that quite frankly put the Adobe help files to shame. I’m quite sure some of these same people either worked closely with Adobe to develop AS3, or helped test it, and if they didn’t, they should. A few links to help the weary searcher (ive posted many of these before, but well worth doing again! bear in mind it’s non-exhaustive) :

Flash is moving away from designers, and towards developers.

I know, it’s a bold statement, but it feels true. What I mean is that, yes – for all intense and purpose, Flash CS3 still functions the same as Flash 8 and MX2004. As a designer I can still go in and add MovieClips, manipulate the timeline, and do all my usual tricks using reasonably simple AS2 code. But as soon as I want to do anything specific to AS3, simple things become a lot more difficult to understand – memory management, adding and removing event listeners, and that’s not even approaching Classes and that can of worms. These are the realms of the developer. Someone versed in the language of zero’s and one’s. Not your average Designer. Not even (for the most part) your very good designer.

This is a very interesting point, because it seems that Flash, as it becomes ubiquitous on multiple devices, and as the language matures, it is invariably becoming a true development environment, aimed less at the original target market, and more and more at the developer. And it’s a very difficult juggling act to make. I wonder how long until a completely developer-oriented version is made?

I’ve been lucky enough to have access to a mate of mine, OJ, who – while not a Flash developer, is an extremely good programmer in pretty much everything else… and the great thing (at least for me) is that, while knowing next to nothing about AS3, he’s now able to help me with my coding woes. Sure there are some Flash-specifics that he needs me to enlighten him about, and he could certainly help me with theory in older versions of AS, but because AS3 now more than ever closely resembles other standard programming languages, people with skills like his can now give advice and help to us lowly slashes.

Migrating from AS2 to AS3 is not as simple as you think.

Unless you came clean into ActionScript at version 2.0, and embraced the developer’s approach to writing code, and even if you did – some fundamental things have changed between AS2 and AS3. Like dynamically attaching a MovieClip. Like references to _root, _parent and _global. Like keyboard events. If you have a project in AS2 that uses any of these, and want to port it to AS3, depending on your competencies as a programmer, this might not be a worthwhile task.

And for the designer, the inability to have code backwards compatible might not make sense. IE, in AS2 there was code from AS1 that you could still use, ie the fundamental way you went about doing things remained the same. Not so when making a project for AS3.

Give it a week, AS3 will grow on you!

If you are a reasonably competent coder/hack, you will really enjoy the move to AS3. It will be painful at first, but there is so much opportunity in the latest incarnation that it will be worth it in the long run.

In the near future, hopefully you will be able to see the fruits of my toils, but in the mean time, ill try and gather snippets together into useful downloads and post them in the lab. It may take a few weeks, but I think they will still be of use :)

Of Stacks and Heaps

OK, so I may not be a hard-core programmer like some in th room (you know who you are), but there are times when I really enjoy understanding just that little bit more about the (computer) world we live in today. So it was a very pleasant time spent on Kirupa this evening, learning and understanding (I think) about how memory is allocated based on my hacked together code. All very interesting, and perhaps someone can tell me if it’s all correct?

Stacks and Heaps