MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE Reference page 1223

Actionscript 2.0 language reference
Table of Contents

Advertisement

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
change the dimensions of
The
MovieClip.getNextHighestDepth()
7 or later. If your SWF file includes a version 2 component, use the version 2 components
DepthManager class instead of the
See also
_height (TextField._height property)
.
my_txt
method used in this example requires Flash Player
MovieClip.getNextHighestDepth()
and
width_txt
height_txt
method.
to
TextField
1223

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flash 8

Table of Contents