Skip to main content
February 14, 2014
Answered

PopUp box on setInterval with timer

  • February 14, 2014
  • 1 reply
  • 857 views

Simply put I have a pop-up box that appears on a setInterval timer.

However, I need this pop-up to also run on a timer that if nothing is pressed on the pop-up it goes to another frame.

This is the script I have so far:

popup._visible = false;

var timer=setInterval(timeOut,6000);

function timeOut():Void{

_root.popup._visible =

!_root.popup._visible;

clearInterval(timer);

}

Any help for this to then time again and go to another frame would be appreciated

This topic has been closed for replies.
Correct answer kglad

var timer=setInterval(timeOut,6000);

var gotoTO:Number;

function timeOut():Void{

_root.popup._visible =

!_root.popup._visible;

clearInterval(timer);

clearInterval(gotoTO)

gotoTO=setTimeout(gotoF,3000);

}

function gotoF():Void{

_root.gotoAndStop("presentation_frame1");  // label this frame

}

1 reply

kglad
Community Expert
Community Expert
February 14, 2014

:

//when something is pressed, use:

clearInterval(timer);
timer=setInterval(timeOut,6000);

February 14, 2014

Thing is I don't want anything pressed at this point, when the pop-up is visible. I am simply looking for it to hold for x amount of seconds and then goto frame 1 (start of the presentation)

kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
February 14, 2014

var timer=setInterval(timeOut,6000);

var gotoTO:Number;

function timeOut():Void{

_root.popup._visible =

!_root.popup._visible;

clearInterval(timer);

clearInterval(gotoTO)

gotoTO=setTimeout(gotoF,3000);

}

function gotoF():Void{

_root.gotoAndStop("presentation_frame1");  // label this frame

}