Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
ICOM Productions

Exclude child of target object in TransformManager?

Recommended Posts

Hi Jack,

 

Back again! Thanks again for your help last time around!

 

Just a random bit of curiosity - is there a way to exclude a child of an existing TransformManager instance's targetObject from bounds calculations and selection UI?

 

For example, let's say I've called addItem on a MovieClip that has two Sprites as children. I want one of the sprites to be visible all the time, and be accounted for in the TransformManager's selection bounds, etc. I'd like the other sprite to be hidden by default, and when I set it's visibility to true, not to be counted toward the overall bounds of the selection. Both children should be scaled and moved by TransformManager, the second would Ideally just being invisible in bounds calculations. I had hoped to use addIgnoredObject, but saw in the documentation that the supplied targetObject cannot be a child of a targetObject.

 

I'm thinking that there's no real way to go about this other than to take the second sprite out of the original target Object, tie its scale and position to the targetObject, and leave it out of TransformManager's hands, but if you have an alternate suggestion, I'd be glad to hear it!

 

Thanks Kindly,

Chris

Link to comment
Share on other sites

No, sorry, but Flash always includes children when calculating bounds. You could indeed create a separate proxy-like object that is managed by TransformManager and just listen for SCALE/MOVE/ROTATE events and adjust its position/scale/rotation accordingly each time the proxy is updated. See what I mean?

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.

×