Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
Guest ChromeDemon

Mapping Rotation and Size changes to multiple Instances

Recommended Posts

Hello,

 

just wanted to know if it is possible in Transform Manager, to map

the rotation, changes in size and position from one MC Instance to a second

MC instance. For Example

 

I have an MC as a Transform Manager Object, when I rotate and scale it, can it be mapped on a second

MC in Realtime (so that the second MC has the same rotation and size) I hope my question is understandable. Thanx in advance ...

 

Chrome

Link to comment
Share on other sites

Sure, you could simply listen for SCALE, MOVE, and ROTATE events on mc1 and in the handler, apply the matrix to mc2. Kinda like:

 

function transformHandler(event:TransformEvent):void {
   mc2.transform.matrix = mc1.transform.matrix;
}

Link to comment
Share on other sites

Ok, that works :-) Another question now appears. How do i map the Transform.matrix to MC2 with the Factor 4 ... Like MC1 is 100 and MC2 is 100, when I resize MC1 to 200, MC2 will be 800 pixel large? Is there sumthing like mc2.transform.matrix = mc1.transform.matrix *4 ???

 

thanx in advance

 

Chrome

Link to comment
Share on other sites

  • 1 month later...

Thanks, this works well. If possible, I'd like to use this with crop objects (from greensock crop class).

 

Is there a way to apply the matrix of the crop sprite from one crop object to another? maybe by drilling down from the transform Item level or somehow casting the class. Thanks in advance

Link to comment
Share on other sites

Thanks, this works well. If possible, I'd like to use this with crop objects (from greensock crop class).

 

Is there a way to apply the matrix of the crop sprite from one crop object to another? maybe by drilling down from the transform Item level or somehow casting the class. Thanks in advance

I'm not sure I understand your question, but you can take the matrix from any DisplayObject and apply it to another one like:

 

mc2.transform.matrix = mc1.transform.matrix;

 

The Crop object is a DisplayObject too.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×