This statement uses the following elements:
•
is the variable you are placing the timeout object into.
variableName
•
indicates which type of Lingo object you are creating.
timeout
•
is the name you give to the timeout object. This name appears in the
timeoutName
. It is the
timeOutList
•
creates a new object.
new
•
intMilliseconds
handler you specify. This is the
calls the specified handler every 2 seconds.
•
is the name of the handler you want the object to call. This is the
#handlerName
#timeOutHandler
with the
sign. For example, a handler called
#
.
#accelerate
•
indicates which child object's handler should be called. This is the
targetObject
property of the object. It allows specificity when many child objects contain the same handlers.
If you omit this parameter, Director looks for the specified handler in the movie script.
The following statement creates a timeout object named
handler in the child object
-- Lingo syntax
myTimer = timeOut("timer1").new(2000, #accelerate, car1)
To determine when the next timeout message will be sent from a particular timeout object, check
its
property. The value returned is the point in time, in milliseconds, when the next
#time
timeout message will be sent. For example, the following statement determines the time when
the next timeout message will be sent from the timeout object
Message window:
-- Lingo syntax
put(timeout("timer1").time)
Using timeOutList
When you begin creating timeout objects, you can use
timeout objects that are active at a particular moment.
The following statement sets the variable
property.
count
-- Lingo syntax
x = _movie.timeoutList.count
You can also refer to an individual timeout object by its number in the list.
The following statement deletes the second timeout object in
method.
forget()
-- Lingo syntax
timeout(2).forget()
property of the object.
#name
indicates the frequency with which the timeout object should call the
property of the object. For example, a value of 2000
#period
property of the object. You represent it as a symbol by preceding the name
every 2 seconds:
car1
to the number of objects in
x
would be specified as
on accelerate
that calls an
timer1
timer1
to check the number of
timeOutList
timeOutList
timeOutList
Object-oriented programming with Lingo
#target
on accelerate
and displays it in the
by using the
by using the
63
Need help?
Do you have a question about the DIRECTOR MX 2004-DIRECTOR SCRIPTING and is the answer not in the manual?
Questions and answers