ActionScript Math.abs() 条件不起作用

发布于 2024-09-16 15:49:17 字数 682 浏览 5 评论 0原文

我有一个数字变量 vx,它随着输入帧事件而变化。在输入帧函数中,我有以下代码:

if  (Math.abs(vx) <= 0.05);
    {
    trace(Math.abs(vx));
    }

立即,它开始输出远高于 0.05 的数字:

12.544444075226783
12.418999634474515
12.29480963812977
12.171861541748472
12.050142926330986
11.929641497067676
11.810345082097
11.69224163127603
11.575319214963269
11.459566022813636
11.3449703625855
11.231520658959644
11.119205452370048
11.008013397846348
10.897933263867884
10.788953931229205
10.681064391916912
10.574253747997743
10.468511210517764
10.363826098412586
10.260187837428461
10.157585959054176
10.056010099463634
9.955449998468998
9.855895498484308

这对任何人都有意义吗?

i have a number variable, vx, that is changing with an enter frame event. in the enter frame function i have the following code:

if  (Math.abs(vx) <= 0.05);
    {
    trace(Math.abs(vx));
    }

immediately, it's starts outputting numbers that are well above 0.05:

12.544444075226783
12.418999634474515
12.29480963812977
12.171861541748472
12.050142926330986
11.929641497067676
11.810345082097
11.69224163127603
11.575319214963269
11.459566022813636
11.3449703625855
11.231520658959644
11.119205452370048
11.008013397846348
10.897933263867884
10.788953931229205
10.681064391916912
10.574253747997743
10.468511210517764
10.363826098412586
10.260187837428461
10.157585959054176
10.056010099463634
9.955449998468998
9.855895498484308

does this make sense to anyone?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

絕版丫頭 2024-09-23 15:49:18

if 后面有一个额外的冒号 ';'

if (Math.abs(vx) <= 0.05);<--

如果没有,我认为它会工作得更好:

if  (Math.abs(vx) <= 0.05) {
 trace(Math.abs(vx));
}

You have an extra colon ';' after your if.

if (Math.abs(vx) <= 0.05);<--

Without i think it will works better:

if  (Math.abs(vx) <= 0.05) {
 trace(Math.abs(vx));
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文