UIObject.move()

Availability

Flash Player 6 (6.0.79.0).

Edition

Flash MX 2004.

Usage

componentInstance.move(x, y, noEvent)

Parameters

x A number that indicates the position of the object's upper left corner, relative to its parent.

y A number that indicates the position of the object's upper left corner, relative to its parent.

noEvent A Boolean value that indicates whether the move event should be dispatched.

Returns

Nothing.

Description

Method; moves the object to the requested position. Pass only integer values to UIObject.move(), or the component may appear fuzzy.

Example

The following example moves the check box 10 pixels to the right:

myCheckbox.move(myCheckbox.x + 10, myCheckbox.y);

The following example calls the move() method to reposition a Button component, my_button, from its current position to the upper-left corner (10,10) of the Stage:

var my_button:mx.controls.Button;
my_button.addEventListener("move", doMove);
function doMove(evt_obj:Object):Void {
    trace(evt_obj.target + " moved from {oldX:" + evt_obj.oldX + ", oldY:" + evt_obj.oldY + "} to {x:" + evt_obj.target.x + ", y:" + evt_obj.target.y + "}");
}
my_button.move(10, 10);

Flash CS3