Hi Chris,

>   this might be an old question, but is it possible to
> dynamically attach
> behaviours to sprites. I am working on dynamically generating
> sprites in
> successive score channels, and have got that far, but need to attach
> behaviours to them as I go

Look into the "scriptInstanceList" keyword:
put sprite (52).scriptInstanceList
-- [<offspring "change cursor" 1 1266008>, <offspring "tooltip trigger" 1
4ffb28>]

Any behavior attached to a sprite will appear in that list. A sprite with no
behaviors attached will have an empty list (also if you type the above code
in the message window when the movie isn't running). You can add or remove
script instances, by using the usual list operations. I don't know how it
handles gpdl defined properties, but I suppose you could always pass the
values to a custom handler.
One thing to watch out for, don't let the sprite itself add or remove it's
own instances on any sprite event (like exitFrame or mouseUp), because
director cycles through the instance list when the even happens, and
performing such operations will interfere and cause unpredictable results...

I can't be more specific, since I don't use that feautre too often myself,
but I hope that pointed you in the right directon.

Regards,
Karina Steffens,
Lead Programmer

Martello Media Ltd.
4 Islington Avenue
Sandycove
Co. Dublin

Tel: +353 1 2844668
Fax: +353 1 2803195
http://www.martellomm.ie




[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