Tuesday, March 31, 2009

Transformation Matrix

Came across changing registration point of a flex component from (0,0) to (x,y)..
DisplayObject class has a property 'transform' which contains object of Matrix.

var do : DisplayObject = new DisplayObject();
var matrix : Matrix = new Matrix();
matrix.tx = x;
matrix.ty = y;

do.transform.matrix = matrix;

That's it..

No comments: