影片剪辑的宽度是负1亿美元(-1.073741604E8) [英] Width of MovieClip is minus 100 million (-1.073741604E8)

查看:118
本文介绍了影片剪辑的宽度是负1亿美元(-1.073741604E8)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序工作正常,但我有一个函数,计算什么在原有基础上MC的宽度的小地图,但它不工作时,宽度为负。所以现在的问题基本上是,怎样才能宽度是负的?这是什么意思? 谢谢

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

- 编辑: 很抱歉,我不能发表任何code,这是一个30K LOC项目。解决的办法是将这一在另一个影片剪辑中,它更好地工作。

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

推荐答案

我期待你的MC其中宽度你测量是不是在舞台上现在。我遇到同样的问题,我的Sprite对象,如果它不是在舞台上的宽度是不可靠的,而我也试过不要求宽度,但要求的getBounds()来代替。先尝试将其添加到舞台上,然后请求宽度。

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.

这篇关于影片剪辑的宽度是负1亿美元(-1.073741604E8)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆