----- Original Message ----- 
From: Eva Fadeel <[EMAIL PROTECTED]>
Subject: <lingo-l> Remove behavior

>I have tried to use the "scriptInstantList" but i can�t get it to work.
>can you give me an example?
>For example if I have a behavior (x) that is attached to sprite 20 and
>when the marker gets to 2 I want to remove the behavior (x)

This handler will delete the first behavior attached to any sprite

on deleteBehavior mySprite
  deleteat(sprite(mySprite).scriptinstancelist,1)
end

This will add the behavior to the sprite (again):

on addBehavior mySprite,myScript
  x=new(script myScript, mySprite)
end

Where mySprite refers to a spritenumber and myScript refers to a unique script's name! 
In your case you would probably write: "deleteBehavior(20)" in the prepareframescript 
in frame 2 or perhaps already on the mouseUp handler that jumps there. To add it 
again, use: "addBehavior(20,"theScriptName")"
You might want to check out the "scriptinstancelist" in the Dir.help. That's where I 
know all this from.   ;-)

Hope this helps

/jonas




[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