So the first thing you may have noticed is that everything in AS2 that had an underscore in front of it no longer does in AS3. That is a MAJOR issues for all of us lazy coders that just want to copy and paste old AS 2 code into an AS3 document – it will fire all sorts of errors such as this one:
Warning: 1058: Migration issue: The property _x is no longer supported. Use the DisplayObject.x property instead.
Continue reading “Syntax”
If you’re like me you probably never used Event Listeners in AS2. Not unless you needed to do something “crazy” (insert sarcasm here at how amateur I was then, I’m only slightly less amateur now but that’s besides the point)
Well AS3 is all about Event Listeners, well Events actually. Actionscript is an Event based language. When something happens it dispatches an Event of some form and you have to react to it to make things go.
Wiring up buttons is a great way to introduce the concept of listening for and responding to events and has the upside of being THE MOST BASIC THING YOU EVER HAVE TO DO when building a website or anything that requires users to interact with an interface. So lets get started because we have clients waiting.
Continue reading “Buttons and Events”
Using the Hand Cursor on a button
In AS2 we took for granted that when we assigned a mouse event (onRelease, onPress, onRollOut etc) to a movie clip Flash by default would change the cursor from the arrow to the hand when the user interacted with that movie clip.
In AS3 that is no longer the case. You have to implicitly tell the clip that it should work that way. Luckily, it’s a very easy step.
myClip.buttonMode = true;
That’s it. Your done.
Personally I like the change, you have to want the clip to work that way and take the steps to do so. I know when I am doing something quick and dirty that it’s a pain but as a programmer I like the idea that I control the functionality.