PDA

View Full Version : two draggable objects at the same time?


Christine
04-19-2004, 03:51 PM
I tried to see if you could have a custom mouse pointer using

onClipEvent (load) {
startDrag (this,true);
Mouse.hide();
}

and then also have a simple draggable movie clip on the same movie.

on (press) {
startDrag (this, true);
}
on (release) {
stopDrag ();
}

It didn't work; the moment the MC was dragged, the custom pointer stopped being dragged. How can I modify the code to make it work? Using MX.

myopic_society
04-19-2004, 04:23 PM
don't use a drag event for the custom mouse

instead use


mouse_mc.onEnterFrame = function(){
this._x = _xmouse; //(might need to change targeting, _root._xmouse)
this._y = _ymouse
}

Christine
04-19-2004, 08:33 PM
I will do this tonight; if I have problems I will come back crying.... :p

Thanks for the code!

senocular
04-19-2004, 08:47 PM
you can also try this
http://proto.layer51.com/d.aspx?f=845

Paste that code in the first frame of your movie to define the new actions and use beginDrag and endDrag instead of startDrag and stopDrag and you'll be able to drag two objects at once (read the rest of that page for more info as well)