I am trying to get a movie clip - nested inside another movie clip on the stage - to match the x, y coordinates of the mouse. Attached is an example file both in Flash 8 and MX2004 formats.
I can get the drag to occur, but the problem is that the dragged mc’s coordinates are relative to it’s parent movie clip and not the stage. I have been messing around with localToGlobal with not much luck. I think I may be using it wrong, though. I have left it out of the example file. Here is the relevant code:
var dragging = false;
this.onMouseMove = function() {
if (dragging == true) {
this.container.drag._x = _xmouse;
this.container.drag._y = _ymouse;
}
};
this.container.drag.onPress = function() {
dragging = true;
};
this.container.drag.onRelease = function() {
dragging = false;
};
this.container.drag.onReleaseOutside = function() {
dragging = false;
};
Thanks so much for any help.