Problems with setInterval and clearInterval in flash
[ 2006-09-21 13:40:12 | Author: liuhuan ]
If setInterval in flash as :Then we can't clear this interval using such as:The only way to clear it is to set the Interval as global , like :Then clear it by :
Quote
this.btn.onPress = function() {
var LoadingProcessInterval2 = setInterval(_root, "loadingprocess", 1);
};
var LoadingProcessInterval2 = setInterval(_root, "loadingprocess", 1);
};
Quote
function loadingprocess() {
clearInterval(LoadingProcessInterval2);
}
clearInterval(LoadingProcessInterval2);
}
Quote
this.btn.onPress = function() {
_global.LoadingProcessInterval2 = setInterval(_root, "loadingprocess", 1);
};
_global.LoadingProcessInterval2 = setInterval(_root, "loadingprocess", 1);
};
Quote
function loadingprocess() {
clearInterval(_global.LoadingProcessInterval2);
}
clearInterval(_global.LoadingProcessInterval2);
}
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.