开发者

How to make actionscript run once?

开发者 https://www.devze.com 2023-01-30 06:55 出处:网络
When I add actionscript to 开发者_C百科a Flash movie, it runs every time the movie enters a new loop. How do I make it run only once, when the movie has finished loading?Just set a flag telling you if

When I add actionscript to 开发者_C百科a Flash movie, it runs every time the movie enters a new loop. How do I make it run only once, when the movie has finished loading?


Just set a flag telling you if the script has already executed. Like this;

var done:Boolean;
if (!done) {

    // any code here will run only once.

    done=true;
}
0

精彩评论

暂无评论...
验证码 换一张
取 消