carmenMiranda
Programmer
Flash MX: Dragging, Tracking and Input
I have a draggable MC (called square1) with some code attached to an onClipEvent(mouseUp) handler that tracks the x and y positions of the MC when it is dragged to a new position.
These will later be passed to a sharedObject in order to save these positions for later reuse.
This all works OK, but I need to also allow the user to enter 2 values for x and y (into 2 boxes named xPosition and yPosition) and then have the MC move accordingly. Here is the current code:
onClipEvent (load) {
this._x = _root.xPosition;
this._y = _root.yPosition;
}
onClipEvent (mouseUp) {
xPosition = Math.round (_root.square1._x);
yPosition = Math.round (_root.square1._y);
}
Changing the values in the input boxes does not move the MC and if I change the onClipEvent(load) to (enterFrame) then the dragging functionality fails to work.
What am I doing wrong?
I have a draggable MC (called square1) with some code attached to an onClipEvent(mouseUp) handler that tracks the x and y positions of the MC when it is dragged to a new position.
These will later be passed to a sharedObject in order to save these positions for later reuse.
This all works OK, but I need to also allow the user to enter 2 values for x and y (into 2 boxes named xPosition and yPosition) and then have the MC move accordingly. Here is the current code:
onClipEvent (load) {
this._x = _root.xPosition;
this._y = _root.yPosition;
}
onClipEvent (mouseUp) {
xPosition = Math.round (_root.square1._x);
yPosition = Math.round (_root.square1._y);
}
Changing the values in the input boxes does not move the MC and if I change the onClipEvent(load) to (enterFrame) then the dragging functionality fails to work.
What am I doing wrong?