It may be possible, (and this is just an assumption), that recommending
objects may not be the best thing for this poster, so here's a possible
alternative.

Ali, if you can work with objects, it's a lot better in this case. However,
another way to work with Director's one timer, to achieve multiple timing
checks, is to use variables.

The timer starts when the app (projector, Director, etc.) starts.
"startTimer" merely REstarts the single timer in Director. You can compare
the constantly running timer to a value stored in a variable to see how much
time has elapsed. NOTE: the timer is measured in ticks (1/60th of a second).

Record the current time when you want your "timer" to start. In this case,
when a sprite loads:

property pTimerOne 
--you can also use globals, store all your timers in a list, etc.

on beginSprite me
    pTimerOne = the timer
end

on exitFrame
    --some uses of the timer...

    --elapsed time in seconds
    put (the timer - pTimerOne)/60

    --a test to see if a timer has expired
    if the timer > (pTimerOne + 5*60) then
        put "timer one, five seconds, has expired"
    end if

    --etc.
end

if you don't like ticks, you can also use "the milliseconds", but there are
a few differences. I don't think you can "startMilliseconds". However, using
"startTimer" can sometimes cause problems, too. If you just want to use
variables, you can pick between timer (ticks) and milliseconds
(milliseconds).

--Rich Shupe




[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email 
[email protected]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
learning and helping with programming Lingo.  Thanks!]

Reply via email to