View Single Post
Old 03-29-2003, 09:48 AM   #3
senocular
six eyes
 
senocular's Avatar
 
Join Date: Jan 2003
Location: San Francisco, CA (USA)
Posts: 7,784
Send a message via ICQ to senocular Send a message via AIM to senocular Send a message via MSN to senocular Send a message via Yahoo to senocular
Default

or you can use setTimeout - clearing itself after one call.
First though, since its not a native Flash function it needs to be defined, so put this in the first frame of your movie to define it:

ActionScript Code:
_global.setTimeout = function(a,b,c, args){     // for a basic function call:     if (typeof arguments[0] == "function"){         args = arguments.slice(2);         var ID, func = function(){             a.apply(null, args);             clearInterval(ID);         }         ID = setInterval(func, b, args);             // for an object method call:     }else{         args = arguments.slice(3);         var ID, func = function(){             a[b].apply(a, args);             clearInterval(ID);         }         ID = setInterval(func, c, args);     }     return ID; } _global.clearTimeout = clearInterval;

Then replace your setIntervals there with setTimeout and they'll only run once.
__________________
(6)
senocular is offline   Reply With Quote