On Tuesday, Sep 24, 2002, at 12:13 US/Central, Tab Julius wrote:
> At 12:52 PM 9/24/02, Howdy-Tzi wrote:
> No it won't. I misremembered. This is the code you want:
>
>> sprite(nSpriteNum).scriptInstanceList = []
>>
>> setScriptList is for *adding* behaviors. It doesn't work for clearing
>> them!
>
> Also I don't believe it works for score recording either, which was in
> the original request.
setScriptList does work with score recording, but it seems almost like
a weird kitbash of slapping together proplists and using variants of
'do' without actually using 'do'. For instance you cna use it to set
behavior parameters as you would with a gPDL dialog, on the fly, and
those params are saved when you do the recording. The procedure's
something like this:
1. Begin recording.
2. Puppet a sprite into an empty channel.
3. Set any sprite params you want.
4. Instantiate behaviors you want to attach withy 'new' to the behavior
itself (oInstance = new ( yourBehavior ) ).
5. setScriptList with the behavior and its params as needed.
6. Keep going until you're all done with the sprites.
7. End recording.
8. Save the movie.
> However, I did notice in at least previous versions of Director (not
> sure if it holds true in D8.5 or not) that if I set the script
> instance list to empty, like you do here, it made it impossible to add
> new scripts.
Yes, you also have to set the sprite channel's member to 0 and unpuppet
the sprite! Otherwise you can't add more behaviors later. Weird, all
right.
> In other words, keeping the original list container but deleting each
> of the contents. It seemed that assigning a new container made it
> impossible to apply new scripts afterwards and have them work.
I'll have to keep that in mind for other versions. ;)
Warren Ockrassa | http://www.nightwares.com/
Director help | Free files | Sample chapters | Freelance | Consulting
Author | Director 8.5 Shockwave Studio: A Beginner's Guide
Published by Osborne/McGraw-Hill
http://shop.osborne.com/cgi-bin/osborne/0072195622.html
[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!]