TextField
675
Parameters
beginIndex
:
Number
- The start index value for the replacement range.
endIndex
:
Number
- The end index value for the replacement range.
newText
:
String
- The text to use to replace the specified range of characters.
Example
The following example creates a text field called
my_txt
and assigns the text
to the field. The
indexOf()
method is used to find the first occurrence of the specified
symbol (
@
). If the symbol is found, the specified text (between the index of 0 and the symbol)
replaces with the string
bird
. If the symbol is not found, an error message is displayed in the
Output panel.If the symbol is not found, an error message writes to the log file.
this.createTextField("my_txt", this.getNextHighestDepth(), 10, 10, 320,
22);
my_txt.autoSize = true;
my_txt.text = "[email protected]";
var symbol:String = "@";
var symbolPos:Number = my_txt.text.indexOf(symbol);
if (symbolPos>-1) {
my_txt.replaceText(0, symbolPos, "bird");
} else {
trace("symbol '"+"' not found.");
}
_rotation (TextField._rotation property)
public _rotation :
Number
The rotation of the text field, in degrees, from its original orientation. Values from 0 to 180
represent clockwise rotation; values from 0 to -180 represent counterclockwise rotation.
Values outside this range are added to or subtracted from 360 to obtain a value within the
range. For example, the statement
my_txt._rotation = 450
is the same as
my_txt._rotation = 90
.
Rotation values are not supported for text fields that use device fonts. You must use embedded
fonts to use
_rotation
with a text field.
Note:
This property is not supported for Arabic, Hebrew, and Thai.
Availability:
ActionScript 1.0; Flash Lite 2.0
Содержание Flash Lite 2
Страница 1: ...Flash Lite 2 x ActionScript Language Reference...
Страница 22: ...22 Contents...
Страница 244: ...244 ActionScript language elements...
Страница 760: ...760 ActionScript classes...