Results 1 to 7 of 7

Thread: uses for MatrixTranformer

  1. #1
    Join Date
    Jan 2008
    Location
    Near Chicago
    Posts
    247
    Thanks
    105
    Thanked 2 Times in 2 Posts

    Default 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
    does it do anything besides rotate?
    Last edited by evan; 07-21-2008 at 05:06 PM.

  2. #2
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    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 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 is what practically every tweening engine is modeled after.

    Of course, Jack Doyle has his own version (commercial) to interface with his tweening classes (should you go that route).
    Last edited by Medyman; 07-21-2008 at 10:55 PM.

  3. The Following User Says Thank You to Medyman For This Useful Post:

    evan (07-22-2008)

  4. #3
    Join Date
    Jan 2008
    Location
    Near Chicago
    Posts
    247
    Thanks
    105
    Thanked 2 Times in 2 Posts

    Default

    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!

  5. #4
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    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 is an awesome reference, but it too is a bit technical. The AS Cheatsheets are also a good reference, but they're more of a index than a glossary. But, the livedocs (both the Flex & AS 3.0 versions) and the built in CS3 help files are really a good sources. Have you looked through the examples 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!
    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


    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.
    Last edited by Medyman; 07-22-2008 at 03:20 PM.

  6. The Following User Says Thank You to Medyman For This Useful Post:

    evan (07-22-2008)

  7. #5
    Join Date
    Jan 2008
    Location
    Near Chicago
    Posts
    247
    Thanks
    105
    Thanked 2 Times in 2 Posts

    Default

    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.

  8. #6
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    Evan,

    You might have already heard, but Jack Doyle has released his AS3 TransformManager. It's a nice chunk of change though ($199 - $299).

  9. #7
    Join Date
    Jan 2008
    Location
    Near Chicago
    Posts
    247
    Thanks
    105
    Thanked 2 Times in 2 Posts

    Default

    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.
    Last edited by evan; 07-29-2008 at 03:40 PM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •