Trying to get movieclip width

6 posts

Flag Post

So I have a MovieClip symbol, and I’m trying to get its width. The width that I have in Adobe Flash Professional CS6 is 620, but when I try to trace the width using code, I get 644.6. Does anyone know why this is?

 
Flag Post

Can’t really tell for sure without examining the movie clip. There are many reasons why the width returned by code may be different from what is reported in Flash Professional. If you add a child that is outside the left or right border of its parent, the parent movie clip will adjust its width accordingly. Alternatively, if the movie clip scales up at some point, so will its width.

 
Flag Post

Well the I decreased the size of the movieclip, and it’s still adding a small amount to the width. I’m definitely adding it inside the boundaries of the parent, because I center it. I haven’t scaled the movieclip up, so unless a movieclip can scale up by itself in some other way, I don’t really see why the width would change.

 
Flag Post

Does Flash define width in some special way? I only seem to have this problem when I use a movieclip symbol that has shapes drawn with a stroke.

 
Flag Post

Width would be furthestrightpoint.x – furthestleftpoint.x

So if it is rotated or something, that would naturally change the width. Or if something has somehow infilatrated your movieclip.

But apart from that, I’m not sure.

 
Flag Post

The thickness of the stroke is not included in the width of the object when it is created by the Flash Authoring Tool. But I’m still using CS3 so it might be diff by now.

EDIT:

This object is only 200 pixels in width (according to CS3), but it is actually well over 200 pixels in width because of the thick stroke. The same thing happens on the height too.