934
Chapter 2: ActionScript Language Reference
TextField._width
Availability
Flash Player 6.
Usage
my_txt
._width
:Number
Description
Property; the width of the text field, in pixels.
Example
The following example creates two text fields that you can use to change the width and height of
a third text field on the Stage. Add the following ActionScript to a FLA or AS file.
this.createTextField("my_txt", this.getNextHighestDepth(), 10, 40, 160, 120);
my_txt.background = true;
my_txt.backgroundColor = 0xFF0000;
my_txt.border = true;
my_txt.multiline = true;
my_txt.type = "input";
my_txt.wordWrap = true;
this.createTextField("width_txt", this.getNextHighestDepth(), 10, 10, 30, 20);
width_txt.border = true;
width_txt.maxChars = 3;
width_txt.restrict = "0-9";
width_txt.type = "input";
width_txt.text = my_txt._width;
width_txt.onChanged = function() {
my_txt._width = this.text;
}
this.createTextField("height_txt", this.getNextHighestDepth(), 70, 10, 30,
20);
height_txt.border = true;
height_txt.maxChars = 3;
height_txt.restrict = "0-9";
height_txt.type = "input";
height_txt.text = my_txt._height;
height_txt.onChanged = function() {
my_txt._height = this.text;
}
When you test the example, try entering new values into
width_txt
and
height_txt
to change
the dimensions of
my_txt
.
See also
TextField._height
Summary of Contents for FLASH MX
Page 1: ...ActionScript Language Reference ...
Page 20: ...20 Contents ...
Page 24: ...24 Chapter 1 Introduction ...
Page 145: ...Button onKeyDown 145 See also Button onKeyUp ...
Page 202: ...202 Chapter 2 ActionScript Language Reference See also break default strict equality switch ...
Page 282: ...282 Chapter 2 ActionScript Language Reference See also break continue while ...
Page 383: ...LoadVars addRequestHeader 383 See also XML addRequestHeader ...
Page 388: ...388 Chapter 2 my_lv load place a valid URL pointing to a text file here ...
Page 463: ...Microphone setRate 463 See also Microphone rate ...
Page 469: ...Microphone silenceLevel 469 See also Microphone gain Microphone setSilenceLevel ...
Page 480: ...480 Chapter 2 ActionScript Language Reference See also Mouse addListener ...
Page 529: ...MovieClip globalToLocal 529 See also MovieClip getBounds MovieClip localToGlobal ...
Page 612: ...612 Chapter 2 ActionScript Language Reference See also MovieClipLoader onLoadStart ...
Page 623: ...NetConnection class 623 See also NetStream class Video attachVideo ...
Page 649: ...Number 649 See also NaN Number class ...
Page 679: ...on 679 on release trace X this _x trace Y this _y stopDrag See also onClipEvent ...
Page 683: ...onUpdate 683 buttonLabel textColor my_mc labelColor ...
Page 788: ...788 Chapter 2 ActionScript Language Reference See also private public ...
Page 1001: ...Video height 1001 my_mc _height my_mc my_video height See also MovieClip _height Video width ...
Page 1022: ...1022 Chapter 2 ActionScript Language Reference See also XML createElement ...
Page 1057: ...XML xmlDecl 1057 See also XML docTypeDecl XML toString ...
Page 1070: ...1070 Chapter 2 ActionScript Language Reference ...
Page 1104: ...1104 Appendix Deprecated Language Elements ...