Skip to main content
Participant
October 15, 2009
Answered

How do I get an attached movie to drag with its parent & not move independently.

  • October 15, 2009
  • 2 replies
  • 812 views

Hi there, I was hoping someone can help me.

I would like to attach (using A3) a movie clip to a draggable movie clip. I has set up a movie clip using startDrag() – all works fine. But I would like to be able to dynamically place a movie clip inside it so that it too drags. I’ve got it to partly work – you can drag the original movie clip around and the attached movie clip (using aadChild) moves too. But if I grab the attached movie clip instead of the original clip it moves independently.

Is there a way of getting a movie clip inside the draggable movie clip and have it fixed in place and not move if you happen to attempt to drag it.

Cheers

This topic has been closed for replies.
Correct answer Ned Murphy

Show the code you are using for assigning the drag activity as well as that for adding the child to the object that has the drag activity assigned to it.  It sounds like you might be assigning the startDrag to the event.target rather than the event.currentTarget.

2 replies

October 15, 2009

You could also disable mouse events for the children by using:

parent_mc.mouseChildren = false;

This will ensure that all mouse events are captured by the parent and don't get intercepted by the children.

Ned Murphy
Legend
October 15, 2009

Does the movieclip you add have its own drag code assigned to it?

ecirAuthor
Participant
October 15, 2009

Hi Ned, no it doesn't have any code assigned to it.

I'm just trying to dynamically place a movie clip inside a draggable movie clip and have the original and attached movie clip move in unison.

Ned Murphy
Ned MurphyCorrect answer
Legend
October 15, 2009

Show the code you are using for assigning the drag activity as well as that for adding the child to the object that has the drag activity assigned to it.  It sounds like you might be assigning the startDrag to the event.target rather than the event.currentTarget.