I have some touchscreens I maintain at work, we use Flash with Actionscript 2 to display the content. The touchscreens display a series of images as a screensaver, then when you touch the screen it goes to the main menu. Occasionally when you touch the screen, the file will then start simply going through every frame in the file in order and ignoring all the actionscript. I can't tell if this is a hardware or scripting issue, since I can't reproduce it with any regularity, but it happens often enough to be annoying. It definitely seems to happen in the transition between screensaver loop and the main menu.
The screensaver button script is simply:
on (release)
{
gotoAndPlay ("Bumper");
}
The menu menu and every section of content has script like this:
stop();
//number of second to wait before going to screensaver
//var secondsToWait = 40;
//converts milliseconds to seconds;
var duration = 1000 * _global.timeToWait;
var inv;
// the function to activate the screensaver (go to frame 1 or "slideshow")
// and clear the interval
function screensaver() {
clearInterval(inv);
gotoAndPlay("screensaver");
}
//sets the interval to run the screensaver function every 40 seconds(1000ms * 4 = 40 seconds)
function inactive(){
inv = setInterval(this,"screensaver", duration);
}
function reset(){
clearInterval(inv);
}
//clears previous timer
reset();
//calls the inactive function.
inactive();
Any idea what might be doing this?
if that frame (or those frames) play before an interval is cleared, the interval in inactive() is apt to never be cleared. use:
stop();
//number of second to wait before going to screensaver
//var secondsToWait = 40;
//converts milliseconds to seconds;
var duration = 1000 * _global.timeToWait;
var inv;
// the function to activate the screensaver (go to frame 1 or "slideshow")
// and clear the interval
function screensaver() {
clearInterval(inv);
gotoAndPlay("screensaver");
}
//sets the interval to run the screensaver function every 40 seconds(1000ms * 4 = 40 seconds)
function inactive(){
clearInterval(inv); // always clear the interval before setting. ie, every setInterval() should be preceded by a clearInterval()
inv = setInterval(this,"screensaver", duration);
}
function reset(){
clearInterval(inv);
}
//clears previous timer
reset();
//calls the inactive function.
inactive();
North America
Europe, Middle East and Africa
Asia Pacific