This content has been marked as final. Show 8 replies
it's returned as 10 and 10, resp.
>> ie. if a movieclip contains only a 10x10 square at point 5,5 (within the
>> movieclip), width&height is normally returned as 15x15. I want a way to
>> have 10x10 returned.
Right... this is just how Flash works. You need to either position the
square at 0,0 within the clip, or make the square its own movieClip and get
the bounds of that clip specifically like: container.square._width.
Adobe Community Expert
Thanks Dave. So the answer to my question is 'no' - I need to either reposition the square, use another clip, or add two more variables.
width and height return the dimensions of the smallest rectangle that includes all on-stage objects. show me an example where you get 15x15 by placing a 10x10 square at 5,5.
Sorry kglad - you are right, I confused the question (it was nagging me a while back and I didn't recheck it).
The question should be:
How do I find the bounds of a movieclip relative to its position if its non-white space content is not placed with its top-left corner at the origin(0,0) within that clip?
ie. if a movieclip contains only a 10x10 square at point 5,5 (within the movieclip), width&height is normally returned as 10x10 but x,y is given as 0,0 (or wherever the clip is placed on stage). I want a way to either have 15x15 returned or 5,5
use your movieclip's transform matrix.
You mean transform.pixelBounds.