> I know this is probably a bit of a strange request but...
> 
> I have been using Director & Lingo since v4.0 and have recently been getting
> much more into the middleweight side of lingo with behaviours etc.  However,
> the documentation on parent scripts does just not make much sense to me -
> maybe its because I am a designer as opposed to a full on programmer, but
> can anyone give me some pointers to their advantage in relation to a
> behaviour and how they work in conjunction with them - I'm really confused
> and want to further my lingo skills, but know that I will not get there
> unless I bridge this gap. Examples, Technotes anything welcome.
> 
> Kind regards to you all.
> 
> Dave.

Actually, learning OOP through behaviors is not a bad approach. You could
certainly code in an OOP style using only behaviors, but many people adopt a
style that mixes parent scripts and behaviors.

Personally, I use parent scripts for things that are not directly related to
user actions, and use behaviors for things that the user manipulates. In
other words, I will use a behavior for sprites that recieve mouse clicks,
etc., and child objects for things like data collection and storage. For
example, in a quiz program, I would use behaviors for the answer buttons,
which will handle roll-overs, button changes on mouseDown, etc., and send a
message on mouseDown to a managing object that keeps track of answers and
does things like scoring the quiz as a whole.

I would suggest that if you have not tried attaching behaviors to sprites
through the scriptInstanceList, and setting the properties of the behaviors
through the new handler or a custom handler, then start there. Creating an
object from a parent script is not much different. You might also want to
invest in "Lingo Sorcery" by Small.

If you would like some example code, contact me off-list and I'll send you a
script that uses both child objects and dynamicly-attached behaviors.

-Kurt


[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