Browse the notebook

Category: DisplayObject

Skew DisplayObject

var box:Shape = Shape(addChild(new Shape()));
with (box.graphics) beginFill(0x006666), drawRect(0,0,50,50);
box.x = box.y = 100;

addEventListener(Event.ENTER_FRAME, onLoop);

function onLoop(evt:Event):void {
	
	var m:Matrix = box.transform.matrix;
	// skew on the X
	m.c = (mouseX - stage.stageWidth / 2 ) / stage.stageWidth;
	
	// skew on the Y
	// m.b = (mouseX - stage.stageWidth / 2 ) / stage.stageWidth 
	
	box.transform.matrix = m
}

This skews a box Shape using the c and b properties of the transformation matrix. Note that these values don’t match those in the IDE’s transform window. This is good further reading if your interested in this topic.

Read snippet: Skew DisplayObject

DisplayObject describeType()

for each(var prop:String in describeType(DisplayObject).factory.accessor.@name){
	trace(prop);
}
/* outputs
scaleY
mouseX
mouseY
mask
rotation
alpha
transform
blendMode
x
root
loaderInfo
width
z
rotationX
scale9Grid
filters
rotationY
y
stage
scaleZ
parent
accessibilityProperties
scrollRect
rotationZ
height
name
opaqueBackground
blendShader
cacheAsBitmap
visible
scaleX
*/

I First saw describeType() at senocular’s AS3 Tip of the Day on Kirupa.

Read snippet: DisplayObject describeType()