变的奇怪行为 [英] Strange behavior with variable
问题描述
有很奇怪的问题,在行动脚本变量。我用它(变量)的dinamically的进度条,变化幅度在我的MP3播放器, 这里是code:
There is very strange problem with variable in action script. I use it (variable) to dinamically change width of progress bar in my mp3 player, here is code:
filledProgress.width = Math.round (progressPercent * 1.56);
它工作在开始的时候很好,但一段时间后停止,经停我的意思是,filledProgress.width并不想从0改变它的值,虽然对前$的右部P $ pssion总是一些成绩,我甚至产生不同的变量,以检查它是否会得到值:
it works very good in the beginning, but after some time it stops, by stops I mean, filledProgress.width doesn't want to change its value from 0, although on the right part of expression is always some result, I even created different variable, to check whether it will get value from:
Math.round (progressPercent * 1.56);
和它工作得很好,但filledProgress.width没有,更改所有,但是我重装后,明确现金在我的浏览器,它再次开始工作,之后的又一次短时间内停止。
And it works perfectly well, but filledProgress.width didn't change at all, however, after i reload and clear cash in my browser, it again starts to work, and again after short period of time stops.
这里是什么地方?
推荐答案
此行为可能是由于移除事件监听器发生。
This behavior may occur due to removed event listener.
检查要删除您更新宽度事件侦听器。
Check where you remove event listener in which you update width.
这篇关于变的奇怪行为的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!