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;
}
精彩评论