Showing posts with label ActionScript. Show all posts
Showing posts with label ActionScript. Show all posts

Saturday, October 2, 2010

AS2 to AS3 - Common DisplayObject Properties

Properties in AS3 now use CamelCase. Here are some common DisplayObject properties.

ActionScript 2

ActionScript 3

_xx
_yy
_widthwidth
_heightheight
_xscalescaleX
_yscalescaleY
_xmousemouseX
_ymousemouseY
_namename
_alphaalpha
_visablevisable
_rotationrotation
_rootroot
_parentparent

Friday, October 1, 2010

AS2 to AS3 - onEnterFrame

The onEnterFrame method of AS2 is now done through the use of Event Listeners in AS3.

ActionScript 2

this.onEnterFrame = function() {
// Your code here
}

ActionScript 3

this.addEventListener(Event.ENTER_FRAME, myFunctionName);
function myFunctionName(e:Event):void {
// Your code here
}