Designer Trying To Code, Deadline by tomorrow HELP - Easy Problem
I've placed this code on the root time line and it works great, however i need to print multiple MovieClips and I can't do that unless I place all of the MovieClips into one MovieClip and that's where this code stops working.
This code keeps two seperate MovieClips on different layers "physically" connected while dragging one.
But as soon as I place the two MovieClips into a new MovieClip "MainClip" - blaaahhhhhhhh.
Thank you for helping!
----------------------------------------time line cod--------------
_global.dragging = 0;
someListener = new Object();
someListener.onMouseMove = function () {
if (_global.dragging == 1) {
diffx = _global.oriX_MC1 - _root.MC1._x;
diffy = _global.oriY_MC1 - _root.MC1._y;
_root.MC2._x = _global.oriX_MC2-diffx;
_root.MC2._y = _global.oriY_MC2-diffy;
}
};
Mouse.addListener(someListener);
-----------------Code for Dragable MC---------------------
on(press){
this.startDrag();
_global.oriX_MC1 = this._x;
_global.oriY_MC1 = this._y;
_global.oriX_MC2 = _root.MC2._x;
_global.oriY_MC2 = _root.MC2._y;
_global.dragging = 1;
}
on(release) {
diffx = _global.oriX_MC1 - _root.MC1._x;
diffy = _global.oriY_MC1 - _root.MC1._y;
_root.MC2._x = _global.oriX_MC2-diffx;
_root.MC2._y = _global.oriY_MC2-diffy;
_global.dragging = 0;
this.stopDrag();
}
-------------------------------------------