At 13:23 -0600 03/01/01, Bryce Hall wrote:
>do a startTimer in the 'on beginSprite' handler, rather than 'on 
>enterframe'.  this way it will only be executed once.

Yes, using the 'beginSprite' event is a good idea. However using a 
global and volatile property such as the timer is maybe not the 
safest approach. So below is a simple behavior for the scriptChannel, 
that uses a "private" property to keep track of the time.
There was a request to change the duration at runtime by lingo, but 
since the context was not supplied, it's hard to devise a solution. 
This should be a starting point though, but give a sign if you need 
help with runtime control of the duration.

property pDur, pGoTime

on beginSprite me
   pGoTime = the milliSeconds + pDur
end

on exitFrame me
   if the milliSeconds < pGoTime then go the frame
end

on getPropertyDescriptionList me
   return [#pDur:[#comment:"Duration mS",#format:#integer,#default:1000]]
end

Jakob

And if you don't believe what I'm saying, just ask Irv!  ;-)

[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