Contents
Articles
Behaviors
Books
Director News
Director Web Sites
FAQ
Games
Mailing Lists
News Groups
Project Examples
Reviews
Software
Tools
Useful Web Sites
Utilities
Xtras

Don't miss these
3D Rotation
Fraction Scripts
PixelToolbox Beta - Imaging Lingo Application
Urdu text editor
My Paradise Islands
Prompt for Disk
Play and Review Flash
Postscript to Vector Converter
rescale
simODBC Xtra
 

 

 

Behavior A Lingo Timer Script

Added on 6/30/1999

 

Compatibilities:
D6_5 D7 D8 Mac PC Script

Rating:

Author: AlexZavatone

Servicable timer. To initialize, call the timer with the number of seconds. To check, call the timer again, a 1 will be returned if time is up. With this timer events are not suspended like in a repeat loop. Also included is a handler which will suspend events till time is out.

-- Timer Scripts (c) Alex Zavatone Feb 1, 1995
on timer seconds
  global gTimerStart
  if gtimerstart = 0 then
    set gTimerStart = the ticks
  end if
  if 60 * seconds + gtimerStart < the ticks then on timer seconds
  global gTimerStart
  if gtimerstart = 0 then
    set gTimerStart = the ticks
  end if
  if 60 * seconds + gtimerStart < the ticks then
    put "time up" -- for debugging purposes
    set myResult = true
    set gTimerStart = 0
  else
    set myResult = false
  end if
     return myResult
end

on timeout seconds
  repeat while not (timer (seconds))
  end repeat
end

 


Contact

MMI
36 South Court Sq
Suite 300
Newnan, GA 30263
USA

Send e-mail