Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how do I set the goto command to be active if the mouse does not move

Status
Not open for further replies.

jezx

Technical User
Jul 15, 2002
18
GB
Any Ideas?
how do I set the "goto" command to be active if the mouse does not move for say 3 minutes.
The code should say
if x coordinate of mouse does not change for 3 minutes then
goto scene 1.
 
Stick this to a dummy clip on the stage:

onClipEvent(load){

oldX=_root._xmouse;
time=getTimer()+3000;

onClipEvent(enterFrame){

if(_root._xmouse != oldX){
//reset timer if mouse moves;
time=getTimer()+3000;
}

else if(getTimer()-time>0){
//if 3 seconds has elapsed since time was reset
_root.gotoAndStop("targetFrame");
}

oldX=_root._xmouse;

} Slainte

 
And I missed of the closing brace on the (load) part of the script... must get an install of Flash on my new work PC.

onClipEvent(load){

oldX=_root._xmouse;
time=getTimer()+18000;

}

onClipEvent(enterFrame){

if(_root._xmouse != oldX){
//reset timer if mouse moves;
time=getTimer()+18000;
}

else if(getTimer()-time>0){
//if 3 minutes has elapsed since time was reset
_root.gotoAndStop("targetFrame");
}

oldX=_root._xmouse;

} Slainte

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top