Here is a behavior that utilizes a timeOut object and can be attached
multiple sprites.
If you are working in Director MX 2004 do a search for "creating timeout
objects" in the help file. It is explained in detail there.
Hope this helps.
Anthony
www.lifelinestudios.com
----------------------------------------------------------------------------
property spriteNum
property psTimeOut -- unique timeout object name
property pnTimerLength -- length of timer expressed in milliseconds
----------------------------------------------------------------------------
on beginsprite (me)
-- get a unique name to use as a reference to the timeout object
psTimeOut = string(me)
-- set timer length to 5 seconds
pnTimerLength = 5000
-- -- create a timeout object (use this line instead if using
Director versions earlier than MX 2004)
-- oTemp = timeout(psTimeOut).new(pnTimerLength , #doSomething, me)
-- create a timeout object
oTemp = timeout().new(psTimeOut, pnTimerLength , #doSomething, me)
end beginSprite
----------------------------------------------------------------------------
on endSprite (me)
-- remove timeout object|
me.removeTimeOutObject()
end endSprite
----------------------------------------------------------------------------
on doSomething (me)
-- do something here
-- -- remove timout object| (include this line to call handler only
once)
-- me.removeTimeOutObject()
end doSomething
----------------------------------------------------------------------------
on removeTimeOutObject (me)
-- remove timeout object
timeout(psTimeOut).forget()
end removeTimeOutObject
----- Original Message -----
From: "Jayp" <[EMAIL PROTECTED]>
To: "Lingo programming discussion list" <[email protected]>
Sent: Monday, March 07, 2005 5:25 AM
Subject: <lingo-l> Timeout Parent Object
> Hi all
>
> Recently i posted a message on Postnettext with parent scripts. From
> the response i got i was told i need to use a timeout parent object.
> The problem is ive never used one before and not sure what to write
>
>
> Does any have any examples or info
>
>
> regards
>
> jon
>
> [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!]
>
[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!]