View Full Version : uses for MatrixTranformer
so far I have this example on how to rotate a rectangle
with the mouse on ann axis
source:learning as3 ch8
import fl.motion.*;
var down:Boolean = false;
addEventListener(Event.ENTER_FRAME, onLoop);
stage.addEventListener(MouseEvent.MOUSE_UP, onUp);
stage.addEventListener(MouseEvent.MOUSE_DOWN, onDown);
function onLoop(evt:Event) {
if (down) {
var mat:Matrix = clip.transform.matrix;
MatrixTransformer.rotateAroundExternalPoint(mat,mouseX,mouseY,45);
clip.transform.matrix = mat;
}
}
function onDown(evt:MouseEvent):void {
down = true;
}
function onUp(evt:MouseEvent):void {
down = false;
}
are there any other demonstrations of this class and what I can do with it?
I found a nice example here (http://jobemakar.blogspot.com/2007/06/rotating-around-point.html)
does it do anything besides rotate?
Medyman
07-21-2008, 10:30 PM
does it do anything besides rotate?
Yes, the MatrixTransformer class can be used to manipulate any of the properties of a transformation matrix -- rotation, skew, and scale.
There is an example in the LiveDocs (http://livedocs.adobe.com/flash/9.0/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00000189.html) that might be useful.
Make sure you look at the comments of the blog post that you linked to, especially those made by Robert Penner. He wrote the fl.motion package, so you can take his comments with some authority. As an aside, his work (http://robertpenner.com/easing/) is what practically every tweening engine is modeled after.
Of course, Jack Doyle has his own version (http://blog.greensock.com/transformmatrixproxy/) (commercial) to interface with his tweening classes (should you go that route).
As a matter of fact I am doing a final comparison as to which one to use, I contacted Jack Doyle and so far it looks worthwhile to use his.
For future refference..
Is there a good "glossary" of built in classes Flash has and what they do as a point of refference-besides Adobe(Alot of that language is over my head)
That would give me a broader understanding of many things and be able to learn limitations of doing things a certain way.
ie certain things are a snap like using a colorpicker -you can do alot with it and it's built in.
-BUT some things that look easy get REALLY complicated.
As you can see by now I spent alot of time figuring out what NOT to do, which is hopefully just part of the learning curve.
Thankyou for saving me a $^#$-load of time in explaining these things!
Medyman
07-22-2008, 03:07 PM
As a matter of fact I am doing a final comparison as to which one to use, I contacted Jack Doyle and so far it looks worthwhile to use his.
Seems so. Especially since he provides support for members of his green club, or whatever it's called. Having that resource available to you, might be worth the price of membership alone.
Is there a good "glossary" of built in classes Flash has and what they do as a point of refference-besides Adobe(Alot of that language is over my head)
Unfortunately, not really. The only references to a "glossary" of sorts are from AS3 training courses. The AS3 Cookbook (http://www.amazon.com/ActionScript-3-0-Cookbook-Application-Developers/dp/0596526954/) is an awesome reference, but it too is a bit technical. The AS Cheatsheets (http://actionscriptcheatsheet.com/blog/) are also a good reference, but they're more of a index than a glossary. But, the livedocs (both the Flex (http://livedocs.adobe.com/flex/3/html/help.html?content=Part6_ProgAS_1.html) & AS 3.0 (http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/) versions) and the built in CS3 help files are really a good sources. Have you looked through the examples (http://www.adobe.com/go/as3examples) that ship with CS3? There is some really good stuff in there.
ie certain things are a snap like using a colorpicker -you can do alot with it and it's built in.
-BUT some things that look easy get REALLY complicated.
Welcome to the world of programming! :D
But it's really about points of reference. You have to think programmatically rather than as a end-user. AS 3.0 does make the easy things hard, you're right. But that's only so that the hard things are easy. Some things are kind of counter intuitive, but as a whole, AS 3.0 is so so so much more powerful than AS 2.0 because of this.
As you can see by now I spent alot of time figuring out what NOT to do, which is hopefully just part of the learning curve.
Surely, it is. Learning about the tools that are available to you can't hurt. If you don't need a particular class today, maybe you will for a project later on.
Thankyou for saving me a $^#$-load of time in explaining these things!
No problem. Keep the questions coming :D
As an aside, I came across this (http://www.flashandmath.com/intermediate/gummy/index.html) today. You might have already seen it, as you've linked to this blog before. But, if you haven't, you might want to give it a quick look.
As an aside, I came across this today. You might have already seen it, as you've linked to this blog before. But, if you haven't, you might want to give it a quick look.
I love that site, from those demos I got alot of sample code to experement with and expand on, and see what's possible.
That one IS new.
Medyman
07-29-2008, 02:30 PM
Evan,
You might have already heard, but Jack Doyle has released his AS3 TransformManager (http://blog.greensock.com/transformmanageras3/). It's a nice chunk of change though ($199 - $299).
As a matter of fact I we bought a license from him last week.
It will come in handy because it's incredible how much I needed it and at the right time.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.