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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reset an idle application

Status
Not open for further replies.

stu74uk

Technical User
Jun 10, 2002
8
GB
Can anybody please help?

I have an application that has an intro leading to a menu screen. Using 'go to the frame' the application waits until a user clicks a button moving to another screen. I would like the application to reset itself to the start if the menu screen is idle for a certain length of time.

Any help will be appreciated.
 
On the frame script on the main menu frame, write a handler for on enterFrame that reads as follows:

on enterFrame
if the lastEvent >y*60 then go to frame x
end

x being the start frame for your projector. Y being the amount of seconds that the application stays idle before it resests. Director checks for key presses, rollovers, and mouse clicks for this lastEvent function.

Hope this helps you out.
 
Thanks for replying, it did help. It now resets itself but then doesn't stop the second time round it just carries on looping. You wouldn't know how to solve this?

Again any helpwould be appreciated.
 
Sorry I made an oversight in my response. Of course it loops because after the certain period of time with no event on the main menu if goes to the start frame of the intro. If you still do nothing until you get to the main menu frame, Director still records there being no event. So the enterFrame handler's if statement executes, thus making it look like it is looping. This is simple to fix.
on the frame script of the last frame of the intro write this code in

on exitFrame
startTimer
end

This resets the timer for the lastEvent action, so problem should be solved. Hope this helps and feel free to respond again if anything is unclear or this does not solve the problem
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top