Parent scripts and behaviors are very similar, but there are
important differences. I think it would help if we first
straightened out some naming conventions.
Parent scripts are used as a "template" for creating (child) objects.
Objects created this way typically have no relation to things on the
screen.
On the other hand, Behavior scripts (or simply "behaviors", also
called "sprite scripts") are intended to be attached to sprites, and
affect the sprite they are attached to. A sprite is defined to be a
cast member in a sprite channel.
So, in your write-up, when you talk about parent objects having a
drag and drop behaviour, that's really confusing, and it's even more
confusing when you say that you "could click on a child object ...".
Instead, it sounds like you have four identical sprites, all of whom
have (or should have) the same behavior script attached to them. If
this is the case, then in your one "Drag and drop then interact
behavior", I would suggest something like this. Have a property
variable that keeps track of whether or not this sprite has been
dragged and dropped in the "correct place" (however you define that).
Behaviors automatically get sent a "beginsprite" message. In your
"on beginSprite" handler, set this property variable to FALSE, e.g.,
property pDraggedAndDroppedCorrectly
property spriteNum -- automatically gets the value of the channel in
which it is used
on beginSprite me
pDraggedAndDroppedCorrectly = FALSE
-- anything else you want to do here
end
Then in your mouseDown handler, you want to perform different actions
depending on the state of this variable:
on mouseDown me
if pDraggedAndDroppedCorrectly then
-- here, you have successfully done the dragging and dropping, so now
-- do your changing picture thing: sprite(spriteNum).member = <whatever>
else
-- here do your dragging and dropping thing
-- if dropped successfully, set: pDraggedAndDroppedCorrectly = TRUE
end if
end
Hope this helps rather than confuses,
Irv
At 8:29 AM -0800 3/25/02, fionnuala o'donnell wrote:
>from one parent object i have created four identical
>child objects.
>the parent object has a drag and drop behaviour.
>after dropping each child to a specific location i
>want the user to be able to interact with each of
>these children.
>For example one could click on a child object and
>change it's picture.
>(this I have not been able to do)
>any suggestions?
>Fi
>
--
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/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!]