Wait? ... or a Timer?
by Rob Maples
on
Sep 11, 2008 at 12:42:57 pm
Hi guys,
I'm writing a lingo script in Director 10. Currently, the script works beautifully, until the end user gets their hands on it. :)
The script sends commands to another device via serial commands over rs-232.
To make it work better with the end user, I need to add a delay before the commands are sent over serial.
So, in essesnce, this is what I'm trying to acheive:
User clicks button...
Director waits 3 seconds then
Sends the command down the serial pipeline.
How can I achieve this? I've been trying differeing things using the startTimer function, but nothing seems to be working. I'm a director novice, so if there's a glaringly obvious fix for this, please enlighten me.
Re: Wait? ... or a Timer? by Bouke Vahl on Sep 11, 2008 at 1:57:13 pm
Kudos that you can work with serial connections in Director while being a novice. (It took me a week to control a 422 VCR...)
You can use a Timeoutscript. See the help.
Important is that you also check the ScriptExecutionStyle, as the syntax is different and you will get crazy if you have it set wrong.
Another simple option is to fire the command from a frame script.
Like:
On exitframe me
global myCustomTimer
if myCustomtimer <> 0 and the milliseconds > myCustomtimer then
FireMySerialCommand
myCustomTimer = 0
end if
end
On the User's command, set the global myCustomTimer to
the Milliseconds + 3000 -- for a 3 second delay
Bouke
http://www.videotoolshed.com/
smart tools for video pro's