I need some "security" code to run consistently with set intervals (for example, run once each minute). I am developing a program that needs to have the USB pen inserted to avoid multiple computers using the same USB. I know how to check for the USB, but the problem lies in making it check each 60 seconds. I already tried this:
if the timer > 60 then
And it only gets triggered in that frame (which makes sense), and I need it to be triggered from any place as long as the movie is running.
Is there a way to make a code run independently of whatever frame the movie is on? I can add an invisible sprite to the stage with a "on exitframe me" behavior, but that sounds like a sorta dumb workaround. Is there a better one?
I'm using DirectorMX 2004 in Windows 7.
Use a timeout object. The help file in Director is particularly terrible with respect to the syntax for timeouts, so I would recommend that you read this article which describes their use very well:
Basically, on startMovie (or whenever you want to start monitoring the USB key), you would add code to create the timeout. This would call a #movie script every second (or whatever interval you want).
Thank you, that helped out quite a bit!