Hi all...
Anyone with any experience using setScriptList()? I checked the
archives and couldn't find a clear enough answer.
Below, I'm trying to make a sprite start off with just 1 behavior, out
of the 6 I have attached to it in the score. I save a list of all 6,
use just 1, and then I want to attach the other 5 at a later time. I
can get the list of 6 and save it, but I'm unable to modify the sprite
with setScriptList. In this case, doing a behavior active T/F won't
work.
Have a nice day,
Michael M.
Here's my lingo:
----------------
on beginSprite(me)
pSp = sprite(me.spriteNum)
pSp.member = member("buttonGraphic","sharedAssets")
pOrigScriptList = pSp.scriptList -- gets all instances and parameters
theOnlyDisable = pOrigScriptList.duplicate()
repeat with i = theOnlyDisable.count down to 1
if ((theOnlyDisable[i][1]).name contains "disableEnable") then
theOnlyDisable = theOnlyDisable[i]
exit repeat -- new script list only contains this one behavior
end if
end repeat
pSp.setScriptList(theOnlyDisable) -- Error: periods not allowed in
symbols
end
[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!]