User Guide

TextField 693
Example
The following example creates three text fields on the Stage. The mouse_txt instance displays
the current position of the mouse in relation to the Stage. The
textfield_txt instance
displays the current position of the mouse pointer in relation to the
my_txt instance. Add the
following ActionScript to a FLA or ActionScript file:
this.createTextField("mouse_txt", this.getNextHighestDepth(), 10, 10, 200,
22);
mouse_txt.border = true;
this.createTextField("textfield_txt", this.getNextHighestDepth(), 220, 10,
200, 22);
textfield_txt.border = true;
this.createTextField("my_txt", this.getNextHighestDepth(), 100, 100, 160,
120);
my_txt.border = true;
var mouseListener:Object = new Object();
mouseListener.onMouseMove = function() {
mouse_txt.text = "MOUSE ... X:" + Math.round(_xmouse) + ",\tY:" +
Math.round(_ymouse);
textfield_txt.text = "TEXTFIELD ... X:" + Math.round(my_txt._xmouse) +
",\tY:" +
Math.round(my_txt._ymouse);
}
Mouse.addListener(mouseListener);
See also
_ymouse (TextField._ymouse property)
_xscale (TextField._xscale property)
public _xscale : Number
Determines the horizontal scale of the text field as applied from the registration point of the
text field, expressed as a percentage. The default registration point is (0,0).
Availability: ActionScript 1.0; Flash Lite 2.0
Example
The following example scales the my_txt instance when you click the scaleUp_btn and
scaleDown_btn instances.
this.createTextField("my_txt", 99, 10, 40, 100, 22);
my_txt.autoSize = true;
my_txt.border = true;
my_txt.selectable = false;