there was a fairly in depth discussion a couple months ago on this - end of June to be exact w/ subject akin to scriptInstanceList. During that discussion, I posted a movie http://www.evanadelman.com/puppetTest/puppetTest.dir that's crap at best, but demonstrates adding scripts dynamically. taking the script out on exit frame rather than on mouseUp shouldn't make one bit of difference in the following example -
------- property addScript
on beginSprite addScript = 1 end
on mouseUp me -- save the scriptList for later use and then wipe out existing scripts
i=1 -- put previously saved scripts back if addScript then y = new(script "counter") sprite(i).scriptInstanceList.add(y) addScript=0 else sprite(i).scriptInstanceList.deleteAt(1) addScript=1 end if end
------------ cheers,
Evan
Craig Taylor wrote:
Hello List,
I am building a program where I need to remove the behaviours from a sprite at one point and then reattach further down the score. This all takes place within the same sprite span. The much simplified version of how I was trying to handle it, is as follows:
global gBehaviorScriptsToReattach
on mouseUp me -- save the scriptList for later use and then wipe out existing scripts gBehaviorScriptsToReattach = sprite(x).scriptList llDummyList = [] sprite(x).setScriptList(llDummyList) end
on exitFrame me -- put previously saved scripts back sprite(x).setScriptList(gBehaviorScriptsToReattach) end
In actuality, this process takes place by calling different methods from the same object, but the logic is there. Seems to work during authoring, but not at runtime. However, I didn't see any documentation as such? I have also tried using scriptInstanceList, but ran into errors when it tried to execute the reattached behaviours. Just looking for the best way to handle this!
Thanks! -_Craig
Craig Taylor Renegade Digital Media inc. www.renegadedigital.com
[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!]
--
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
*m u t a n t m e d i a* > /solutions for success // // / *Evan Adelman* | 917.916.7378 | 303 E 71st St NY NY 10021 [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> | www.mutantmedia.com <http://www.mutantmedia.com>
[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!]
