sorry..yes there are a couple ways that you can simulate a pause in execution of code. I think that first prototype does it. Anyway you can use getTimer(); ie:
ActionScript Code:
startTime = getTimer();
this.onEnterFrame = function () {
currentTime = getTimer();
if(currentTime-startTime > 4000) {
// do something cause 4 seconds have passed
}
}
You can also do it using an interval, because an interval will start its count first and then execute at the end of the first count.
ActionScript Code:
function doSomething() {
// this would be the code to execute
clearInterval(doSomethingID);
}
doSomethingID = setInterval(doSomething,4000); // it will execute after 4 seconds, or 4000 milliseconds
Those are probably the best ways.
However, if you are trying to use this delay to sync something up you might want to look into having the object that is ahead call the function when it is ready, because delays will be probably be different on different machines. So you could use an onLoad event to trigger the function call, so that when the liveStream loads it will call the function.
ActionScript Code:
liveStream.onLoad = doSomething;
web