11/17/2010 10:21:38 PM
Title:
matrix class in flex3
How to use all these static methods Skew(),Scale(),rotate() and translate() in one application using matrix?
11/19/2010 5:27:47 AM
to use transform with matrix , you must declare the transform object then set its matrix property with matrix object and then apply it as transform property of your object. A transform object can support a single effect at a time to my knowledge and if you want to use multiple then you must declare multiple transform and apply them on your transform object. Form more info on using matrix class in flash builder you can check this link
http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/geom/Matrix.html
11/19/2010 5:49:16 AM
Hi Flash_guy,
I want the example in flex 3 not in Actionscript. can you please provide it?
11/20/2010 12:32:17 AM
you can use matrix in flex 3 like this
var myMatrix:Matrix = new Matrix();
var rotation:Number = 2 * Math.PI * (30 / 360);
var scaleFactor:Number = 2;
myMatrix.scale(scaleFactor, scaleFactor);
myMatrix.rotate(rotation);
myMatrix.scale(scaleX, scaleY);
myMatrix.rotate(rotation);
yourDisplayObject.transform.matrix = myMatrix;
11/20/2010 12:36:37 AM
check these examples related to matrix class in flex
http://blog.flexexamples.com/2007/09/14/rotating-images-using-the-matrix-class/
http://blog.flexexamples.com/2008/04/07/skewing-an-image-control-in-flex/
http://www.foxarc.com/blog/article/66.htm
12/1/2010 11:19:31 AM
Hi Flex_guys,
var myMatrix:Matrix = new Matrix();
var rotation:Number = 2 * Math.PI * (30 / 360);
var scaleFactor:Number = 2;
myMatrix.scale(scaleFactor, scaleFactor);
myMatrix.rotate(rotation);
myMatrix.scale(scaleX, scaleY);
myMatrix.rotate(rotation);
yourDisplayObject.transform.matrix = myMatrix;
In The Above "myMatrix.scale(scaleX,scaleY);" how can we pass scaleX,scaleY values from Sliders?
12/1/2010 11:09:31 PM
use mySliderX.value in place of scaleX and similarly for y. If you want to update it with slider then you should use the slider change event and declare matrix function in the change event handler