jim skolmoski wrote

> listers,
> I have created this timer behaviour below.
> I drag it to a frame script, and specify the delay.
> It seems to work fine.  However, ocassionally, I can see
> via the trace that this frame behavior is executing in frames that
> the behaviour is not attached to.  I can see no reason why this
> is occurring.


The timeout is keeping a reference to the instance of your frame script --
see the line

>  timeOut("Attract").new(integer(pTime), #timeOutReply, me)

So while the timeout exists, an instance of the frame  script will exist
(and it wont be destroyed when you leave the frame with the script).

To achieve what you want, you probably don't need to use a timeout - just
something like this

property mytime

on beginSprite me
 mytime = the milliseconds + howEverLongYouWantToHoldOnTheFrame
end

on exitframe me
  if the milliseconds < mytime then go to the frame
end


Luke


[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