Width of MovieClip is minus 100 million (-1.073741604E8)

北城以北 提交于 2019-12-12 02:18:15

问题


My application works fine, but I have a function, what calculates a minimap based on the width of the original MC, but it doesn't work when the width is negative. So the question is basically, how can width be negative? what does it mean? thanks

--edit: sorry, I can't post any code, it's a 30K LOC project. The solution was to include this in another movieClip, where it worked better.


回答1:


I expect your MC which width you're measuring is not on stage right now. I'm experiencing the same issue with my Sprite object, if it's not on stage its width is unreliable, while I have tried not asking for width, but asking for getBounds() instead. Try first adding it to stage, then requesting width.




回答2:


I don't know your code. but i'm afraid overflow occur. MovieClip property width value is Number.

Numer of the range are as follows:

4.9406564584124654e-324 <= Number <=1.79769313486231e+308

if you've initialized a positive number to width, somewhere in the code will be occur overflow.



来源:https://stackoverflow.com/questions/11824850/width-of-movieclip-is-minus-100-million-1-073741604e8

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!