Pausing a timeout is not straightforward. But here's a quick solution:
var intervalID:Number;
var startTime:Number;
var timeLapsed:Number;
var func:Function;
var ms:Number;
function startTimer(func:Function, ms:Number):Void {
this.func = func;
this.ms = ms;
startTime = new Date().valueOf
ch 27, 2007 9:18 AM
Subject: Re: [Flashcoders] another setInterval question
> Hi,
> note that the proposed solutions restart the interval, they do not pause it.
>
> Otherwise calculate how much time there is still left of the interval.
>
> greetz
> JC
>
Delegate.create(this, rolloverHandler);
my_mc.onRollOut = Delegate.create(this, rolloutHandler);
rolloverHandler();
regards,
Muzak
- Original Message -
From: "Mauricio Furtado Massaia" <[EMAIL PROTECTED]>
To:
Sent: Tuesday, March 27, 2007 12:46 AM
Subject: Re: [Flashcoders] anoth
OTECTED]>
To:
Sent: Tuesday, March 27, 2007 12:46 AM
Subject: Re: [Flashcoders] another setInterval question
>i think so , like this :
>
> var intervalID;
>
> function initInterva()
> {
>intervalID = setInterval( this , "nextScene" , 5000 );
>
i think so , like this :
var intervalID;
function initInterva()
{
intervalID = setInterval( this , "nextScene" , 5000 );
}
function stopInterval()
{
clearInterval( intervalID );
}
// onRollOver will stop the interval
my_mc.onRollOver = function (){
stopInterval();
}
// onRollOut res
yourbutton.onRollOver = function
clearInterval(autoID);
}
yourbutton.onRollOut = function() {
setInterval(autoPilot, 5000);
}
On 3/26/07, Raphael Villas <[EMAIL PROTECTED]> wrote:
I have got a setInterval like this:
-
var autoID = setInterval(autoPilot,5000);
function autoPilot
I have got a setInterval like this:
-
var autoID = setInterval(autoPilot,5000);
function autoPilot():Void {
nextScene();
};
-
If a rollover occurs, I'd like to pause the setInterval until the
rollout occurs. Is there a way to suspend the setInterval during a
7 matches
Mail list logo