Copy link to clipboard
Copied
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?
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
...Copy link to clipboard
Copied
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();
}
Copy link to clipboard
Copied
Thanks, I'll give that a try, but that sounds like it sorts my issue out.
Copy link to clipboard
Copied
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.