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?
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.
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.
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.