Currently Being Moderated
Jun 20, 2007 5:57 AM
I need some help with (hopefully) a small addition to my
actionscript.
I have a touchscreen in our reception, the Flash presentation
on here currently has a set-up screen (1st Scene, named "Input")
with a text input box, the results of which get displayed on the
next Scene which is called "Welcome". When a visitor touches the
screen the presentation jumps to another Scene called "Main". On
the timeline of "Main" there's a counter set up to detect whether
the screen has been touched in the last 5 mins, if not the
presentation jumps back to "Welcome", waiting for the next touch.
I'd like to change the "Input" Scene and have two options for
the person setting up the presentation (someone has to do this
every morning). I'd like two welcome screens, one with a static
standard greeting "Welcome to Gillingham" for example. The other
welcome screen would be the same as described above with the input
text box.
The trouble is once the presentation jumps into the "Main"
Scene, there's no way to indicate from WHICH welcome screen it
started from - the static text or the input text. So what I think I
need is a simple variable or "flag" somewhere in the timer
actionscript to indicate that if the flag is on go to "Welcome_1"
and if not go to "Welcome_2" after the 5mins of inactivity.
Here's my timer script set-up on Frame 1 of the "Welcome"
Scene:
DisplayedCompany.text=_root.CompanyName;
var timeoutID = setInterval(timedOut, 180000);
function timedOut () {
clearInterval(timeoutID);
gotoAndStop("Welcome",1);
}
onMouseMove = function(){
clearInterval(timeoutID);
timeoutID = setInterval(timedOut, 180000);
}
And here's my timer script on Frame 1 of my "Main" Scene -
looking for activity within 5 mins:
if(!timeoutID){
var timeoutID = setInterval(timedOut, 180000);
}
function timedOut () {
clearInterval(timeoutID);
_root.gotoAndStop("Welcome_1"); // be sure to label this
frame on Welcome's frame 1.
}
onMouseMove = function(){
clearInterval(timeoutID);
timeoutID = setInterval(timedOut, 180000);
}
I'm not a programmer, all of the above script has been
suggested by other forum users, so a very simple explanation on
what I suspect is a very simple addition would be much
appreciated.