Problems with setInterval and clearInterval in flash

[ 2006-09-21 13:40:12 | Author: liuhuan ]
Font Size: Large | Medium | Small
If setInterval in flash as :
Quote
this.btn.onPress = function() {
  var LoadingProcessInterval2 = setInterval(_root, "loadingprocess", 1);
};
Then we can't clear this interval using such as:
Quote
function loadingprocess() {
  clearInterval(LoadingProcessInterval2);
}
The only way to clear it is to set the Interval as global , like :
Quote
this.btn.onPress = function() {
  _global.LoadingProcessInterval2 = setInterval(_root, "loadingprocess", 1);
};
Then clear it by :
Quote
function loadingprocess() {
  clearInterval(_global.LoadingProcessInterval2);
}
Comments Feed Comments Feed: http://www.liuhuan.com/blog/feed.asp?q=comment&id=624

There is no comment on this article.

You can't post comment on this article.