Mike,
I assume that you are referring to parent scripts.dir in the Learning
section that accompanies Director. While it does work through some
parent script examples, unfortunately, I think this is bad example of
how and where to use parent scripts. This example would have been
better off written using a single "FlowerManager" parent script and a
single "Flower" behavior.
Parent scripts and behaviors are very similar. The big difference is
that behaviors are typically attached to sprites and parent scripts
are not. That is, behaviors are attached to things that show up on
the screen (buttons, graphics, flowers, etc). Parents scripts are
generally used for things that are not screen related (a Sound
Manager, a Network Manager, a Random Range number generator, etc.) -
or as I often use them, to be a "manager" for a group of sprites.
In answer to your specific question, in the example program that you
are looking at, look at the location (locH and locV) of the single
pixel cast members that are being used as place holders. You will
find that they are positioned off-screen.
And in answer to your other question, yes, you always need at least
non-parent script to create an object. Creating an object from a
parent script is also called "instantiating" an object. You can
instantiate an object from a movie script, a behavior, or even a
parent script. In the example you are looking at, when you click on
a button to plant a new flower, a handler is called which executes
the following line:
newFlowerChildObject = new(script"flower parent script")
This line instantiates a new flower object from the code in the
"flower parent script".
Again, I urge you to read my book at:
http://www.furrypants.com/loope (especially chapter 3)
Irv
At 12:26 PM -0700 4/16/01, mike massey wrote:
>i have been trying to analyze the parent script
>examp[le that comes with director.....when making a
>parent script does a movie script also have to
>accompany it? because you need an event to call the
>parent script? the example that comes with director
>puts a few one-pixel placeholders on the stage is that
>necesary? so when you click plant a flower it swaps
>the place of the placeholder with teh flowers? i
>don't even see where the placeholders are placed on
>the stage... do they have to be on the stage?
>
--
Lingo / Director / Shockwave development for all occasions.
(Home-made Lingo cooked up fresh every day just for you.)
[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!]