-
setInterval..
how to call setInterval to loop again after the clearInterval? example.. if i press button i want to call the loop again do its function. Thanks..
-
AKA [ Paul Bainbridge]
Check the flash Doc's. They are very clear on how to use setInterval, clearInterval.
hope it helps
-
yes, i already check it and there is no clue on how to loop it again.. anyway thanks...
-
this will call the interval everytime you press the button
function interval() {
trace("interval");
clearInterval(intervalId);
}
button.onRelease = function() {
intervalId = setInterval(interval,1000);
}
-
Senior Member
You can also use setTimeout.
setTimeout is undocumented, but takes exactly the same arguments of setInterval (works both with and without an object just like interval as well).
The only difference with setTimeout is that it does not return the intervalID, becuase it only performs the function ONCE.
button.onRelease = function() {
setTimeout(trace,1000,"Words to trace")
}
-
thanks a lot.. i figure it already. and is used setTimeout also.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|