746
Chapter 7: ActionScript for Flash
The following example includes all characters, but excludes lowercase letters:
my_txt.restrict = "^a-z";
You can use a backslash to enter a ^ or - verbatim. The accepted backslash sequences are \-, \^ or
\\. The backslash must be an actual character in the string, so when specified in ActionScript, a
double backslash must be used. For example, the following code includes only the dash (-) and
caret (^):
my_txt.restrict = "\\-\\^";
The ^ may be used anywhere in the string to toggle between including characters and excluding
characters. The following code includes only uppercase letters, but excludes the uppercase
letter Q:
my_txt.restrict = "A-Z^Q";
You can use the
\u
escape sequence to construct
restrict
strings. The following code includes
only the characters from ASCII 32 (space) to ASCII 126 (tilde).
my_txt.restrict = "\u0020-\u007E";
TextField._rotation
Availability
Flash Player 6.
Usage
my_txt
._rotation
:Number
Description
Property; 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 files that use device fonts. You must use embedded
fonts to use
_rotation
with a text field.
Example
In this example, you need to create a dynamic text field called
my_txt
, and then use the following
ActionScript to embed fonts and rotate the text field. The reference to
my font
refers to a Font
symbol in the library, with linkage set to
my font
.
var my_fmt:TextFormat = new TextFormat();
my_fmt.font = "my font";
this.createTextField("my_txt", this.getNextHighestDepth(), 10, 10, 160, 120);
my_txt.wordWrap = true;
my_txt.embedFonts = true;
my_txt.text = "Hello world";
my_txt.setTextFormat(my_fmt);
my_txt._rotation = 45;
Summary of Contents for FLEX-FLEX ACTIONSCRIPT LANGUAGE
Page 1: ...Flex ActionScript Language Reference...
Page 8: ......
Page 66: ...66 Chapter 2 Creating Custom Classes with ActionScript 2 0...
Page 76: ......
Page 133: ...break 133 See also for for in do while while switch case continue throw try catch finally...
Page 135: ...case 135 See also break default strict equality switch...
Page 146: ...146 Chapter 5 ActionScript Core Language Elements See also break continue while...
Page 808: ...808 Chapter 7 ActionScript for Flash...
Page 810: ...810 Appendix A Deprecated Flash 4 operators...
Page 815: ...Other keys 815 Num Lock 144 186 187 _ 189 191 192 219 220 221 222 Key Key code...
Page 816: ...816 Appendix B Keyboard Keys and Key Code Values...
Page 822: ...822 Index...