Jump to content
Search Community

Controlling Selection Box Size

flashfreakmx test
Moderator Tag

Recommended Posts

I have a question I am using a movie clip with come children in it. On of the children is its own transform object. It works fine. However, when the child become larger than the parent (which is also a Transform object) the selection box traces the whole parent which is too big. I have a mask over one of the children, so what I end up with in a white gap between my parent selection and the mask inside of it. Is there an yway to set the size of the selection box so the handles trace the shape wrap the size of the child mask?

 

I hope that makes sense.

Link to comment
Share on other sites

Unfortunately, that's a limitation of Flash - it always includes children when reporting a DisplayObjectContainer's bounds and it doesn't factor in masking. There is a complex potential workaround involving rendering it to a BitmapData and checking for transparent pixels, but it has a massive performance cost (I find it unacceptable). If you want to give that a shot, you could override the getBounds() method on your parent and implement that BitmapData logic inside the custom getBounds(), but again, it's far from an ideal solution. I really wish Flash gave us at least the option of incorporating masks when reporting bounds, but it doesn't.

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