Jump to content
Search Community

Mapping Rotation and Size changes to multiple Instances

Guest ChromeDemon
Moderator Tag

Recommended Posts

Guest ChromeDemon
Posted

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

Posted

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;
}

Guest ChromeDemon
Posted

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

Guest ChromeDemon
Posted

Ok, got this baby working.

  • 1 month later...
matshriver
Posted

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

Posted

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.

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.
×
×
  • Create New...