EasyManua.ls Logo

MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE - X (Textfield._X Property); Xmouse (Textfield._Xmouse Property)

MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE
780 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
692 ActionScript classes
_x (TextField._x property)
public _x : Number
An integer that sets the x coordinate of a text field relative to the local coordinates of the
parent movie clip. If a text field is on the main Timeline, then its coordinate system refers to
the upper left corner of the Stage as (0, 0). If the text field is inside a movie clip that has
transformations, the text field is in the local coordinate system of the enclosing movie clip.
Thus, for a movie clip rotated 90 degrees counterclockwise, the enclosed text field inherits a
coordinate system that is rotated 90 degrees counterclockwise. The text field's coordinates
refer to the registration point position.
Availability: ActionScript 1.0; Flash Lite 2.0
Example
The following example creates a text field wherever you click the mouse. When it creates a
text field, that field displays the current x and y coordinates of the text field.
this.createTextField("coords_txt", this.getNextHighestDepth(), 0, 0, 60,
22);
coords_txt.autoSize = true;
coords_txt.selectable = false;
coords_txt.border = true;
var mouseListener:Object = new Object();
mouseListener.onMouseDown = function() {
coords_txt.text = "X:"+Math.round(_xmouse)+", Y:"+Math.round(_ymouse);
coords_txt._x = _xmouse;
coords_txt._y = _ymouse;
};
Mouse.addListener(mouseListener);
See also
_xscale (TextField._xscale property), _y (TextField._y property), _yscale
(TextField._yscale property)
_xmouse (TextField._xmouse property)
public _xmouse : Number [read-only]
Returns the x coordinate of the mouse position relative to the text field.
Note: This property is supported in Flash Lite only if System.capabilities.hasMouse is
true or System.capabilities.hasStylus is true.
Availability: ActionScript 1.0; Flash Lite 2.0

Table of Contents

Related product manuals