header
ask question
Click here to ask Question Now Its free No registration required. Flash, Flex, Flash Media Server, ActionScript,Adobe Air. Most questions receive a response in an hour.
Priyanka Kshirsagar
Points:0
Posts:0

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?



1
Flash_Guy
Points: 850
Posts:0
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

2
Priyanka Kshirsagar
Points: 0
Posts:0
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?

3
Wilbur
Points: 510
Posts:0
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;

4
Mac_UK
Points: 0
Posts:0
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


5
Mahender
Points: 0
Posts:0
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?

6
Jovi
Points: 0
Posts:0
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


Post your Reply
Name  

Email

Type your Reply or Answer

Are you human? What is 8+2 



Members Login

Email  
Password
Forgot Password





This website focus on: Flash | Flex | FMS | RED5 | WOWZA | Flash Media Server | Adobe AIR | ActionScript,Flash Solutions | Flash Question | Flash Answers | Flash Developers | Flash Problem, Flash Help, Flash bugs, Flash workaround | Flash Blog | Flex Question Answers | Flash Forum | Flex Development | Actionscript development | Flash development | Adobe AIR development
Copyright © 2008 AskMeFlash.com. All rights reserved. Privacy Policy | Terms & Conditions