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

flash actionscript

group:

Re: Flash 8: Code to make symbol follow dragged symbol?


Re: Flash 8: Code to make symbol follow dragged symbol? blemmo
3/15/2006 11:01:53 PM
flash actionscript:
Well, it's really quite simple... here it goes:
--
mc1.onMouseDown = function(){
startDrag(mc1);
mc1.onMouseMove = function(){
mc2._x = mc1._x + 200;
mc2._y = mc1._y + 50;
}
}

mc1.onMouseUp = function(){
stopDrag();
delete mc1.onMouseMove;
}
--
'mc1' is the dragable instance, 'mc2' the one that should follow.

cheers,
blemmo
Re: Flash 8: Code to make symbol follow dragged symbol? ghost zero
3/15/2006 11:21:51 PM
Thanks, but it's not working for me. What's the code that has to be on the
leading object? This is what I have on it right now...

on(press) {
startDrag(this,false);
}
on(release) {
stopDrag();
}
AddThis Social Bookmark Button