Flash 9

Published June 30, 2006
Advertisement
I got Flash 9 going on the Mac Mini. Apart from a weird Java error message, and some random crashes and a complete lack of help files and the fact that the Flash IDE is almost unusable on a 1024x768 screen, it seems to be working.

The new-n-fancy ActionScript 3, however, is gonna require some code-changes. In previous incarnations of ActionScript, it'd happily allow me to put ActionScript code anywhere I wanted. For example, I could click on a button and add the following code to the button itself:

on(release){    trace("somebody just clicked me");}


As expected, if I compiled the code and clicked on the button, I'd get a message in the trace window. Once Flash started becoming more of a development tool than an animation tool, the Flash folks realized that such a construct, while convenient, was pretty unruly for all but the most trivial of projects, as you end up having little bits of code all over the place.

But in the name of avoiding broken code, they allowed it to live for ActionScript 2. They did, however, add "listeners". It's basically a standardized way of having code call code in other objects. So instead of adding code to the button itself. You'd add this code to the parent frame.

myButton.addEventListener(MouseEvent.RELEASE, clickHandler);function clickHandler(event:MouseEvent):void{    trace("somebody just clicked me");}


It's not quite as trivial as the old way. The main thing it does is allow you to put all of your code in one place rather than little snippets all over your objects. And you were encouraged to do things this way rather than the old way.

Well, now you're REALLY encouraged to do things the new way, because the old way won't compile and any event code you've added to buttons or movieclips on the stage will be ignored.

So I'm gonna need to make a few changes before I can try out my stuff in the new optimized ActionScript 3.0 VM.
Previous Entry Update
0 likes 2 comments

Comments

Ravuya
Seems like it makes the code cleaner or at least more explicit.

Judging from some of the Flash abortions I've seen, that can only be a good thing.
June 30, 2006 11:17 AM
noaktree
This makes me happy that I came to flash during the 2nd phase of actionscript. I don't need to update any of my code. If I had any code that is.
June 30, 2006 03:19 PM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement