Jump to content
  • Advertisement
  • entries
  • comments
  • views

Flash 9

Sign in to follow this  


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:

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.
Sign in to follow this  


Recommended Comments

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.

Share this comment

Link to comment
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.

Share this comment

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!