> I have a question regarding timeout objects.
>
> Let's assume we have a behavior that creates a timeout object. Let's
> further assume that the behavior will be attached to two
> different sprites.
> When the timeout handler is executed how do I know to which sprite it
> corresponds?

If you take a look at the documentation for creating a timeout object, the
syntax goes like:
tTimer = timeout("timeoutName").new( period, #callbackHandler{,
scriptObject} )

The scriptObject parameter is optional, if you don't supply one, the
callback is routed to movie scripts. If you do use this parameter, more
often than not the syntax would be:

on mMethod me
  -- some stuff here
  timeout("timeoutName").new( period, #callbackHandler, me )
end

The "me" parameter in this timeout's "new" method means that the behavior
that created the timeout will be the target for its callback. If you need
unique names for the different timeout objects, you can tie them to the
object that created them, or to the sprite channel to which the behavior is
attached, by using string(me) or string(me.spriteNum) when the new timeout
object is named.

HTH,
-Sean.


[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/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