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

Is there a way to have a SWF autoplay, but still allow for manual user input?

New Here ,
Dec 15, 2016 Dec 15, 2016

I am building an interactive display which contains several full screen videos and animations. But that challenge I have is it needs to autoplay when unattended, but also allow a user to stop and explore the display at will and navigate to any part of the overall display. Is it possible to have both autoplay and manual user input co-exisist in the same SWF?

216
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 , Dec 15, 2016 Dec 15, 2016

sure.

you can use a timer (that's reset whenever user input is detected) that triggers autoplay. eg,

var autoT:Timer=new Timer(10000,0);  // autoplay after 10 seconds

autoT.addEventListener(TimerEvent.TIMER,autoF);

auto.start();

function autoF(e:TimerEvent):void{

// do whatever to restart

}

// reset whenever the mouse moves

stage.addEventListener(MouseEvent.MOUSE_MOVE,resetF);

// reset whenever video is playing and anything else that you'll want to use to prevent resetting

function resetF(e:Event=null):voi

...
Translate
Community Expert ,
Dec 15, 2016 Dec 15, 2016

sure.

you can use a timer (that's reset whenever user input is detected) that triggers autoplay. eg,

var autoT:Timer=new Timer(10000,0);  // autoplay after 10 seconds

autoT.addEventListener(TimerEvent.TIMER,autoF);

auto.start();

function autoF(e:TimerEvent):void{

// do whatever to restart

}

// reset whenever the mouse moves

stage.addEventListener(MouseEvent.MOUSE_MOVE,resetF);

// reset whenever video is playing and anything else that you'll want to use to prevent resetting

function resetF(e:Event=null):void{

autoT.reset();

autoT.start();

}

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
New Here ,
Dec 15, 2016 Dec 15, 2016

Thanks, I'll give that a try, but that sounds like it sorts my issue out.

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 ,
Dec 15, 2016 Dec 15, 2016
LATEST

you're welcome.  but be careful with those videos.  you don't want users to be watching a video and after 10 seconds everything resets.  ie, while videos are playing reset the timer.

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