----- Original Message -----
From: "Jeremy Aker" <[EMAIL PROTECTED]>
>
> What is the proper method for removing objects from a sprite's
> scriptInstanceList?
> I've been using a script such as the following with good results:
>
>    repeat with i = 1 to sprite(mySprite).scriptInstanceList.count
>      sprite(mySprite).scriptInstanceList[i] = VOID
>    end repeat
>    sprite(mySprite).scriptInstanceList = []

Unless you need to delete just one specicif behaviour, you can skip most of
that and just go straight to:

sprite(mySprite).scriptInstanceList = []

However: *never* do this from a behaviour attached to that sprite. Another
sprite is OK, or the frame, or a timeout, whatever; but if you do it from a
behaviour that is in the scriptInstanceList you are modifying then it will
not be properly deleted and will cause a memory leak.

- Robert

[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!]

Reply via email to