all groups > flash actionscript > august 2006 >
You're in the

flash actionscript

group:

Dragable movie clip


Re: Dragable movie clip pirateandy NO[at]SPAM gmail.com
8/31/2006 6:21:18 PM
flash actionscript:
instead of this.startDrag, try startDrag(mc);
[quoted text, click to view]
Dragable movie clip Matt-R
8/31/2006 6:30:54 PM
I have a movie clip (mc) I want to be able to drag around the screen with the
mouse. The problem is within the mc I have some buttons, and these buttons stop
working when I use the standard drag code for the mc.

Below is the code I am using to drag the mc:

mc.onPress = function() :Void {
this.startDrag();
};
mc.onRelease = function() :Void {
this.stopDrag();
};

Anythoughts on what I can do to this code so the buttons inside the mc will
work and still have the mc dragable?

Re: Dragable movie clip varun.ks
9/1/2006 1:22:53 PM
Hi

I think this will do: (suppose btn is the instance name of the button inside
the mc MovieClip)

mc.onPress = function() :Void {
if(this.hitTest(this.btn))
{
trace("U hav pressed the button with instance name btn ")
}

this.startDrag();

};
mc.onRelease = function() :Void {
this.stopDrag();
};
AddThis Social Bookmark Button