Strange behavior with variable

烂漫一生 提交于 2019-12-25 02:53:38

问题


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);

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);

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.

What can it be?


回答1:


This behavior may occur due to removed event listener.

Check where you remove event listener in which you update width.



来源:https://stackoverflow.com/questions/24117620/strange-behavior-with-variable

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