PDA

View Full Version : stalling a timer?????



earleybird
May 8th, 2004, 12:33 PM
Hi,

I'm tyring to do something a little complicated and I was hoping for some expertise!

I'm using a timer which triggers a gotoAndPlay after 5 secs. It works fine but I am now trying to work out if it is possible that if I press a button I would be able to stall the timer. i.e the goToAndPlay only happens after 5 sec otherwise the it is prevented and the the timer goes back to zero.

I know its a bit difficult to describe but I have attatched the .fla to help you see what I mean.

In terms of the code I'm using:

I have the function:

stop();
function pause(){
//play();
gotoAndStop(21);
clearInterval(timer);
};
This function is called when the playhead hits a certain frame:
i.e.

stop();
timer = setInterval(pause, 3000);


If anyone has a clue what I'm talking about and can help I'd really apprectiate it!


Thanks Rache:q: :smirk:

earleybird
May 8th, 2004, 12:35 PM
sorry i meant to say ".....otherwise the TRIGGER is prevented...."

earleybird
May 8th, 2004, 01:01 PM
hey, worked it out myself.
Just had to put a clearInterval(timer) thing on the button.

Thanks anyway,

Rache x