Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

PopUp box on setInterval with timer

Guest
Feb 14, 2014 Feb 14, 2014

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

TOPICS
ActionScript
814
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Feb 14, 2014 Feb 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

}

Translate
Community Expert ,
Feb 14, 2014 Feb 14, 2014

:

//when something is pressed, use:

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Feb 14, 2014 Feb 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)

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 14, 2014 Feb 14, 2014
LATEST

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

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines