Flash Lite 2.x ActionScript
Language Reference
Trademarks
1 Step RoboPDF, ActiveEdit, ActiveTest, Authorware, Blue Sky Software, Blue Sky, Breeze, Breezo, Captivate, Central,
ColdFusion, Contribute, Database Explorer, Director, Dreamweaver, Fireworks, Flash, FlashCast, FlashHelp, Flash Lite,
FlashPaper, Flash Video Endocer, Flex, Flex Builder, Fontographer, FreeHand, Generator, HomeSite, JRun, MacRecorder,
Macromedia, MXML, RoboEngine, RoboHelp, RoboInfo, RoboPDF, Roundtrip, Roundtrip HTML, Shockwave, SoundEdit,
Studio MX, UltraDev, and WebHelp are either registered trademarks or trademarks of Macromedia, Inc. and may be registered in
the United States or in other jurisdictions including internationally. Other product names, logos, designs, titles, words, or phrases
mentioned within this publication may be trademarks, service marks, or trade names of Macromedia, Inc. or other entities and
may be registered in certain jurisdictions including internationally.
Third-Party Information
This guide contains links to third-party websites that are not under the control of Macromedia, and Macromedia is not
responsible for the content on any linked site. If you access a third-party website mentioned in this guide, then you do so at your
own risk. Macromedia provides these links only as a convenience, and the inclusion of the link does not imply that Macromedia
endorses or accepts any responsibility for the content on those third-party sites.
Sorenson™ Spark™ video compression and decompression technology licensed from Sorenson Media, Inc.
Fraunhofer-IIS/Thomson Multimedia: MPEG Layer-3 audio compression technology licensed by Fraunhofer IIS and Thomson
Multimedia (http://www.iis.fhg.de/amm/)
Independent JPEG Group: This software is based in part on the work of the Independent JPEG Group.
Nellymoser, Inc.: Speech compression and decompression technology licensed by Nellymoser, Inc. (http:www.nellymoser.com).
Opera ® browser Copyright © 1995-2002 Opera Software ASA and its suppliers. All rights reserved.
Macromedia Flash 8 video is powered by On2 TrueMotion video technology. © 1992-2005 On2 Technologies, Inc. All Rights
Reserved. http://www.on2.com .
Visual SourceSafe is a registered trademark or trademark of Microsoft Corporation in the United States and/or other countries.
Copyright © 2006 Macromedia, Inc. All rights reserved. This manual may not be copied, photocopied, reproduced,
translated, or converted to any electronic or machine-readable form in whole or in part without written approval from
Macromedia, Inc. Notwithstanding the foregoing, the owner or authorized user of a valid copy of the software with which
this manual was provided may print out one copy of this manual from an electronic version of this manual for the sole
purpose of such owner or authorized user learning to use such software, provided that no part of this manual may be
printed out, reproduced, distributed, resold, or transmitted for any other purposes, including, without limitation,
commercial purposes, such as selling copies of this documentation or providing paid-for support services.
Acknowledgments
Project Management: Mary Leigh Burke
Writing: Denise Green
Managing Editor: Rosana Francescato
Editing: Linda Adler, Evelyn Eldridge, Mark Nigara, Lisa Stanziano, Anne Szabla, Jessie Wood
Production Management: Adam Barnett, Kristin Conradi
Media Design and Production: Yuriko Ando, Aaron Begley, Paul Benkman. John Francis, Geeta Karmarkar, Masayo Noda,
Paul Rangel, Arena Reed, Mario Reynoso
Special thanks to Lisa Friendly, Luciano Arruda, Erick Vera, the beta testers, and the entire Flash Lite engineering and QA teams.
First Edition: January 2006
Macromedia, Inc.
601 Townsend St.
San Francisco, CA 94103
Contents
Chapter 1: ActionScript language elements. . . . . . . . . . . . . . . . . 23
Compiler Directives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
#endinitclip directive . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
#include directive. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
#initclip directive . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .27
false constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .27
Infinity constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
-Infinity constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
NaN constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
newline constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
null constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
true constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
undefined constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Global Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Array function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Boolean function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
call function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
chr function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
clearInterval function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
duplicateMovieClip function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
escape function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
eval function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
fscommand function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
fscommand2 function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .47
getProperty function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
getTimer function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
getURL function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
getVersion function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
gotoAndPlay function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
gotoAndStop function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
ifFrameLoaded function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
int function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
isFinite function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
isNaN function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
length function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
loadMovie function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .57
3
loadMovieNum function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
loadVariables function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
loadVariablesNum function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
mbchr function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
mblength function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
mbord function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
mbsubstring function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
nextFrame function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
nextScene function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
Number function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
Object function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
on handler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .69
onClipEvent handler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .71
ord function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
parseFloat function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
parseInt function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
play function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
prevFrame function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
prevScene function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
random function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
removeMovieClip function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
setInterval function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
setProperty function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
startDrag function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
stop function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
stopAllSounds function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
stopDrag function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
String function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
substring function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
targetPath function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
tellTarget function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
toggleHighQuality function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
trace function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
unescape function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
unloadMovie function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
unloadMovieNum function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
Global Properties. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
$version property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .95
_cap4WayKeyAS property. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
_capCompoundSound property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
_capEmail property. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
_capLoadData property. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
_capMFi property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
_capMIDI property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
_capMMS property. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
4C o n t e n t s
_capSMAF property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
_capSMS property. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
_capStreamSound property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .102
_focusrect property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .102
_forceframerate property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .103
_global property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .104
_highquality property. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .105
_level property. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .105
maxscroll property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .106
_parent property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .106
_quality property. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
_root property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .108
scroll property. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .108
_soundbuftime property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .109
this property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
+ addition operator. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
+= addition assignment operator. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
[] array access operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .120
= assignment operator. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .123
& bitwise AND operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .124
&= bitwise AND assignment operator . . . . . . . . . . . . . . . . . . . . . . . . .126
<< bitwise left shift operator. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .126
<<= bitwise left shift and assignment operator. . . . . . . . . . . . . . . . . . .128
~ bitwise NOT operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .128
| bitwise OR operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .130
|= bitwise OR assignment operator . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
>> bitwise right shift operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .132
>>= bitwise right shift and assignment operator . . . . . . . . . . . . . . . . .133
>>> bitwise unsigned right shift operator . . . . . . . . . . . . . . . . . . . . . . . .134
>>>= bitwise unsigned right shift and assignment operator . . . . . . . .135
^ bitwise XOR operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .136
^= bitwise XOR assignment operator. . . . . . . . . . . . . . . . . . . . . . . . . . 137
/* block comment delimiter operator. . . . . . . . . . . . . . . . . . . . . . . . . . 137
, comma operator. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .138
add concatenation (strings) operator . . . . . . . . . . . . . . . . . . . . . . . . .140
?: conditional operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
-- decrement operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .142
/ division operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .142
/= division assignment operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .143
. dot operator. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .144
== equality operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .145
eq equality (strings) operator. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .146
> greater than operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
gt greater than (strings) operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . .148
Contents 5
>= greater than or equal to operator. . . . . . . . . . . . . . . . . . . . . . . . . . . 148
ge greater than or equal to (strings) operator . . . . . . . . . . . . . . . . . . 149
++ increment operator. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
!= inequality operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
<> inequality operator. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
instanceof operator. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
< less than operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
lt less than (strings) operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
<= less than or equal to operator. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
le less than or equal to (strings) operator. . . . . . . . . . . . . . . . . . . . . . 157
// line comment delimiter operator . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
&& logical AND operator. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
and logical AND operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
! logical NOT operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
not logical NOT operator. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .161
|| logical OR operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
or logical OR operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
% modulo operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
%= modulo assignment operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
* multiplication operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
*= multiplication assignment operator . . . . . . . . . . . . . . . . . . . . . . . . 166
new operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
ne not equal (strings) operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
{} object initializer operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
() parentheses operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
=== strict equality operator. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
!== strict inequality operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
" string delimiter operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
- subtraction operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
-= subtraction assignment operator . . . . . . . . . . . . . . . . . . . . . . . . . . 175
: type operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
typeof operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
void operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
break statement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
case statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .181
class statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
continue statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
default statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
delete statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
do..while statement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
dynamic statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
else statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
else if statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
extends statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
6C o n t e n t s
for statement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .196
for..in statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
function statement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .198
get statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
if statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .201
implements statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202
import statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
interface statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
intrinsic statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
private statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
public statement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
return statement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
set statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .210
set variable statement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
static statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .213
super statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .214
switch statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .215
throw statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .216
try..catch..finally statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
var statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .221
while statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222
with statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
fscommand2 Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
ExtendBacklightDuration fscommand2 Command. . . . . . . . . . . . 227
FullScreen fscommand2 Command . . . . . . . . . . . . . . . . . . . . . . . . . 227
GetBatteryLevel fscommand2 Command. . . . . . . . . . . . . . . . . . . . 228
GetDevice fscommand2 Command . . . . . . . . . . . . . . . . . . . . . . . . . 228
GetDeviceID fscommand2 Command . . . . . . . . . . . . . . . . . . . . . . . 229
GetFreePlayerMemory fscommand2 Command . . . . . . . . . . . . . . 229
GetMaxBatteryLevel fscommand2 Command. . . . . . . . . . . . . . . . 230
GetMaxSignalLevel fscommand2 Command . . . . . . . . . . . . . . . . . 230
GetMaxVolumeLevel fscommand2 Command. . . . . . . . . . . . . . . . .231
GetNetworkConnectionName fscommand2 Command. . . . . . . . .231
GetNetworkConnectStatus fscommand2 Command . . . . . . . . . . 232
GetNetworkGeneration fscommand2 Command. . . . . . . . . . . . . . 233
GetNetworkName fscommand2 Command . . . . . . . . . . . . . . . . . . 233
GetNetworkRequestStatus fscommand2 Command . . . . . . . . . . 234
GetNetworkStatus fscommand2 Command . . . . . . . . . . . . . . . . . . 235
GetPlatform fscommand2 Command. . . . . . . . . . . . . . . . . . . . . . . . 236
GetPowerSource fscommand2 Command . . . . . . . . . . . . . . . . . . . 237
GetSignalLevel fscommand2 Command . . . . . . . . . . . . . . . . . . . . . 237
GetTotalPlayerMemory fscommand2 Command . . . . . . . . . . . . . 238
GetVolumeLevel fscommand2 Command. . . . . . . . . . . . . . . . . . . . 238
Quit fscommand2 Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239
ResetSoftKeys fscommand2 Command . . . . . . . . . . . . . . . . . . . . . 239
Contents 7
SetFocusRectColor fscommand2 Command . . . . . . . . . . . . . . . . 240
SetInputTextType fscommand2 Command . . . . . . . . . . . . . . . . . . 240
SetSoftKeys fscommand2 Command. . . . . . . . . . . . . . . . . . . . . . . . 241
StartVibrate fscommand2 Command . . . . . . . . . . . . . . . . . . . . . . . .243
StopVibrate fscommand2 Command . . . . . . . . . . . . . . . . . . . . . . . .243
Chapter 2: ActionScript classes . . . . . . . . . . . . . . . . . . . . . . . . . 245
arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
callee (arguments.callee property) . . . . . . . . . . . . . . . . . . . . . . . . . . .246
caller (arguments.caller property) . . . . . . . . . . . . . . . . . . . . . . . . . . . .246
length (arguments.length property) . . . . . . . . . . . . . . . . . . . . . . . . . .247
Array . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .247
Array constructor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
CASEINSENSITIVE (Array.CASEINSENSITIVE property) . . . . .252
concat (Array.concat method) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .252
DESCENDING (Array.DESCENDING property). . . . . . . . . . . . . . 254
join (Array.join method) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254
length (Array.length property) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .255
NUMERIC (Array.NUMERIC property) . . . . . . . . . . . . . . . . . . . . . . .256
pop (Array.pop method) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .256
push (Array.push method). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .257
RETURNINDEXEDARRAY
(Array.RETURNINDEXEDARRAY property) . . . . . . . . . . . . . . .257
reverse (Array.reverse method) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .258
shift (Array.shift method). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .258
slice (Array.slice method) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .258
sort (Array.sort method) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260
sortOn (Array.sortOn method) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .262
splice (Array.splice method) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .265
toString (Array.toString method). . . . . . . . . . . . . . . . . . . . . . . . . . . . .267
UNIQUESORT (Array.UNIQUESORT property) . . . . . . . . . . . . . . . 267
unshift (Array.unshift method) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .268
Boolean . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .268
Boolean constructor. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .269
toString (Boolean.toString method). . . . . . . . . . . . . . . . . . . . . . . . . .270
valueOf (Boolean.valueOf method) . . . . . . . . . . . . . . . . . . . . . . . . . .270
Button . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271
_alpha (Button._alpha property). . . . . . . . . . . . . . . . . . . . . . . . . . . . . .274
enabled (Button.enabled property). . . . . . . . . . . . . . . . . . . . . . . . . . .275
_focusrect (Button._focusrect property) . . . . . . . . . . . . . . . . . . . . . .276
getDepth (Button.getDepth method). . . . . . . . . . . . . . . . . . . . . . . . . 277
_height (Button._height property) . . . . . . . . . . . . . . . . . . . . . . . . . . . .278
_highquality (Button._highquality property). . . . . . . . . . . . . . . . . . . . 278
_name (Button._name property) . . . . . . . . . . . . . . . . . . . . . . . . . . . . .278
onDragOut (Button.onDragOut handler). . . . . . . . . . . . . . . . . . . . . .279
8C o n t e n t s
onDragOver (Button.onDragOver handler) . . . . . . . . . . . . . . . . . . . 280
onKeyDown (Button.onKeyDown handler). . . . . . . . . . . . . . . . . . . 280
onKeyUp (Button.onKeyUp handler) . . . . . . . . . . . . . . . . . . . . . . . . .281
onKillFocus (Button.onKillFocus handler) . . . . . . . . . . . . . . . . . . . . 282
onPress (Button.onPress handler). . . . . . . . . . . . . . . . . . . . . . . . . . . 283
onRelease (Button.onRelease handler) . . . . . . . . . . . . . . . . . . . . . . 283
onReleaseOutside (Button.onReleaseOutside handler). . . . . . . . 284
onRollOut (Button.onRollOut handler) . . . . . . . . . . . . . . . . . . . . . . . 284
onRollOver (Button.onRollOver handler) . . . . . . . . . . . . . . . . . . . . . 285
onSetFocus (Button.onSetFocus handler) . . . . . . . . . . . . . . . . . . . 285
_parent (Button._parent property) . . . . . . . . . . . . . . . . . . . . . . . . . . . 286
_quality (Button._quality property) . . . . . . . . . . . . . . . . . . . . . . . . . . . 287
_rotation (Button._rotation property) . . . . . . . . . . . . . . . . . . . . . . . . . 287
_soundbuftime (Button._soundbuftime property). . . . . . . . . . . . . . 288
tabEnabled (Button.tabEnabled property). . . . . . . . . . . . . . . . . . . . 289
tabIndex (Button.tabIndex property) . . . . . . . . . . . . . . . . . . . . . . . . . 289
_target (Button._target property) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290
trackAsMenu (Button.trackAsMenu property) . . . . . . . . . . . . . . . . .291
_url (Button._url property). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292
_visible (Button._visible property). . . . . . . . . . . . . . . . . . . . . . . . . . . . 293
_width (Button._width property) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293
_x (Button._x property) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294
_xmouse (Button._xmouse property). . . . . . . . . . . . . . . . . . . . . . . . . 294
_xscale (Button._xscale property) . . . . . . . . . . . . . . . . . . . . . . . . . . . 295
_y (Button._y property) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296
_ymouse (Button._ymouse property). . . . . . . . . . . . . . . . . . . . . . . . . 297
_yscale (Button._yscale property) . . . . . . . . . . . . . . . . . . . . . . . . . . . 298
capabilities (System.capabilities) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298
audioMIMETypes (capabilities.audioMIMETypes property) . . . . 304
avHardwareDisable
(capabilities.avHardwareDisable property) . . . . . . . . . . . . . . . . . 304
has4WayKeyAS (capabilities.has4WayKeyAS property) . . . . . . 305
hasAccessibility (capabilities.hasAccessibility property) . . . . . . . 305
hasAudio (capabilities.hasAudio property) . . . . . . . . . . . . . . . . . . . 305
hasAudioEncoder (capabilities.hasAudioEncoder property) . . . . 306
hasCMIDI (capabilities.hasCMIDI property). . . . . . . . . . . . . . . . . . . 306
hasCompoundSound
(capabilities.hasCompoundSound property) . . . . . . . . . . . . . . . 306
hasDataLoading (capabilities.hasDataLoading property) . . . . . . 307
hasEmail (capabilities.hasEmail property) . . . . . . . . . . . . . . . . . . . . 307
hasEmbeddedVideo
(capabilities.hasEmbeddedVideo property) . . . . . . . . . . . . . . . . 308
hasMappableSoftKeys
(capabilities.hasMappableSoftKeys property) . . . . . . . . . . . . . . 308
hasMFI (capabilities.hasMFI property) . . . . . . . . . . . . . . . . . . . . . . . 308
Contents 9
hasMIDI (capabilities.hasMIDI property) . . . . . . . . . . . . . . . . . . . . . 309
hasMMS (capabilities.hasMMS property). . . . . . . . . . . . . . . . . . . . 309
hasMouse (capabilities.hasMouse property) . . . . . . . . . . . . . . . . . 309
hasMP3 (capabilities.hasMP3 property). . . . . . . . . . . . . . . . . . . . . . 310
hasPrinting (capabilities.hasPrinting property) . . . . . . . . . . . . . . . . 310
hasQWERTYKeyboard
(capabilities.hasQWERTYKeyboard property) . . . . . . . . . . . . . . 310
hasScreenBroadcast
(capabilities.hasScreenBroadcast property) . . . . . . . . . . . . . . . . .311
hasScreenPlayback
(capabilities.hasScreenPlayback property) . . . . . . . . . . . . . . . . . .311
hasSharedObjects (capabilities.hasSharedObjects property) . . . .311
hasSMAF (capabilities.hasSMAF property). . . . . . . . . . . . . . . . . . . 312
hasSMS (capabilities.hasSMS property) . . . . . . . . . . . . . . . . . . . . . 312
hasStreamingAudio
(capabilities.hasStreamingAudio property) . . . . . . . . . . . . . . . . . 312
hasStreamingVideo
(capabilities.hasStreamingVideo property) . . . . . . . . . . . . . . . . . 313
hasStylus (capabilities.hasStylus property) . . . . . . . . . . . . . . . . . . . 313
hasVideoEncoder (capabilities.hasVideoEncoder property) . . . . 313
imageMIMETypes (capabilities.imageMIMETypes property). . . . 314
isDebugger (capabilities.isDebugger property) . . . . . . . . . . . . . . . . 314
language (capabilities.language property) . . . . . . . . . . . . . . . . . . . . 315
localFileReadDisable
(capabilities.localFileReadDisable property) . . . . . . . . . . . . . . . . 316
MIMETypes (capabilities.MIMETypes property) . . . . . . . . . . . . . . . 317
os (capabilities.os property) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317
screenOrientation (capabilities.screenOrientation property) . . . . 317
screenResolutionX (capabilities.screenResolutionX property) . . 318
screenResolutionY (capabilities.screenResolutionY property) . . 318
softKeyCount (capabilities.softKeyCount property) . . . . . . . . . . . . 318
version (capabilities.version property) . . . . . . . . . . . . . . . . . . . . . . . . 319
videoMIMETypes (capabilities.videoMIMETypes property) . . . . . 319
Color . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319
Color constructor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320
getRGB (Color.getRGB method) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321
getTransform (Color.getTransform method) . . . . . . . . . . . . . . . . . . 321
setRGB (Color.setRGB method). . . . . . . . . . . . . . . . . . . . . . . . . . . . .322
setTransform (Color.setTransform method) . . . . . . . . . . . . . . . . . . .323
Date . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .324
Date constructor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 330
getDate (Date.getDate method) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331
getDay (Date.getDay method). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .332
getFullYear (Date.getFullYear method). . . . . . . . . . . . . . . . . . . . . . .332
getHours (Date.getHours method) . . . . . . . . . . . . . . . . . . . . . . . . . . .333
10 Contents
getLocaleLongDate (Date.getLocaleLongDate method) . . . . . . 334
getLocaleShortDate (Date.getLocaleShortDate method). . . . . . 334
getLocaleTime (Date.getLocaleTime method). . . . . . . . . . . . . . . . 335
getMilliseconds (Date.getMilliseconds method). . . . . . . . . . . . . . . 335
getMinutes (Date.getMinutes method). . . . . . . . . . . . . . . . . . . . . . . 336
getMonth (Date.getMonth method) . . . . . . . . . . . . . . . . . . . . . . . . . 336
getSeconds (Date.getSeconds method) . . . . . . . . . . . . . . . . . . . . . 337
getTime (Date.getTime method) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 337
getTimezoneOffset (Date.getTimezoneOffset method). . . . . . . . 338
getUTCDate (Date.getUTCDate method) . . . . . . . . . . . . . . . . . . . . 338
getUTCDay (Date.getUTCDay method). . . . . . . . . . . . . . . . . . . . . . 339
getUTCFullYear (Date.getUTCFullYear method). . . . . . . . . . . . . . 340
getUTCHours (Date.getUTCHours method) . . . . . . . . . . . . . . . . . . 340
getUTCMilliseconds (Date.getUTCMilliseconds method) . . . . . . .341
getUTCMinutes (Date.getUTCMinutes method) . . . . . . . . . . . . . . .341
getUTCMonth (Date.getUTCMonth method) . . . . . . . . . . . . . . . . . 342
getUTCSeconds (Date.getUTCSeconds method) . . . . . . . . . . . . 342
getUTCYear (Date.getUTCYear method) . . . . . . . . . . . . . . . . . . . . 343
getYear (Date.getYear method) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343
setDate (Date.setDate method) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344
setFullYear (Date.setFullYear method) . . . . . . . . . . . . . . . . . . . . . . 345
setHours (Date.setHours method). . . . . . . . . . . . . . . . . . . . . . . . . . . 346
setMilliseconds (Date.setMilliseconds method) . . . . . . . . . . . . . . . 346
setMinutes (Date.setMinutes method) . . . . . . . . . . . . . . . . . . . . . . . 347
setMonth (Date.setMonth method) . . . . . . . . . . . . . . . . . . . . . . . . . . 347
setSeconds (Date.setSeconds method) . . . . . . . . . . . . . . . . . . . . . 348
setTime (Date.setTime method). . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349
setUTCDate (Date.setUTCDate method) . . . . . . . . . . . . . . . . . . . . 349
setUTCFullYear (Date.setUTCFullYear method) . . . . . . . . . . . . . . 350
setUTCHours (Date.setUTCHours method) . . . . . . . . . . . . . . . . . . .351
setUTCMilliseconds (Date.setUTCMilliseconds method) . . . . . . 352
setUTCMinutes (Date.setUTCMinutes method). . . . . . . . . . . . . . . 353
setUTCMonth (Date.setUTCMonth method) . . . . . . . . . . . . . . . . . 353
setUTCSeconds (Date.setUTCSeconds method) . . . . . . . . . . . . . 354
setYear (Date.setYear method) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355
toString (Date.toString method). . . . . . . . . . . . . . . . . . . . . . . . . . . . . 356
UTC (Date.UTC method) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 356
valueOf (Date.valueOf method) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 357
Error. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 357
Error constructor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 359
message (Error.message property) . . . . . . . . . . . . . . . . . . . . . . . . . . 359
name (Error.name property) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 360
toString (Error.toString method) . . . . . . . . . . . . . . . . . . . . . . . . . . . . .361
Contents 11
ExtendedKey . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .362
SOFT1 (ExtendedKey.SOFT1 property) . . . . . . . . . . . . . . . . . . . . . .364
SOFT10 (ExtendedKey.SOFT10 property). . . . . . . . . . . . . . . . . . . .364
SOFT11 (ExtendedKey.SOFT11 property). . . . . . . . . . . . . . . . . . . . .364
SOFT12 (ExtendedKey.SOFT12 property). . . . . . . . . . . . . . . . . . . .364
SOFT2 (ExtendedKey.SOFT2 property) . . . . . . . . . . . . . . . . . . . . .365
SOFT3 (ExtendedKey.SOFT3 property) . . . . . . . . . . . . . . . . . . . . .365
SOFT4 (ExtendedKey.SOFT4 property) . . . . . . . . . . . . . . . . . . . . .365
SOFT5 (ExtendedKey.SOFT5 property) . . . . . . . . . . . . . . . . . . . . .365
SOFT6 (ExtendedKey.SOFT6 property) . . . . . . . . . . . . . . . . . . . . .365
SOFT7 (ExtendedKey.SOFT7 property). . . . . . . . . . . . . . . . . . . . . .365
SOFT8 (ExtendedKey.SOFT8 property) . . . . . . . . . . . . . . . . . . . . .366
SOFT9 (ExtendedKey.SOFT9 property) . . . . . . . . . . . . . . . . . . . . .366
Function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .366
apply (Function.apply method) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .367
call (Function.call method) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .369
Key . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .370
addListener (Key.addListener method). . . . . . . . . . . . . . . . . . . . . . .372
BACKSPACE (Key.BACKSPACE property). . . . . . . . . . . . . . . . . .373
CAPSLOCK (Key.CAPSLOCK property). . . . . . . . . . . . . . . . . . . . .374
CONTROL (Key.CONTROL property) . . . . . . . . . . . . . . . . . . . . . . .374
DELETEKEY (Key.DELETEKEY property) . . . . . . . . . . . . . . . . . . .374
DOWN (Key.DOWN property) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .375
END (Key.END property) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .376
ENTER (Key.ENTER property) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .376
ESCAPE (Key.ESCAPE property) . . . . . . . . . . . . . . . . . . . . . . . . . . . 377
getAscii (Key.getAscii method) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 377
getCode (Key.getCode method) . . . . . . . . . . . . . . . . . . . . . . . . . . . . .378
HOME (Key.HOME property) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 380
INSERT (Key.INSERT property). . . . . . . . . . . . . . . . . . . . . . . . . . . . 380
isDown (Key.isDown method) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 381
LEFT (Key.LEFT property). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .382
_listeners (Key._listeners property) . . . . . . . . . . . . . . . . . . . . . . . . . . .383
onKeyDown (Key.onKeyDown event listener). . . . . . . . . . . . . . . . .383
onKeyUp (Key.onKeyUp event listener) . . . . . . . . . . . . . . . . . . . . . .384
PGDN (Key.PGDN property) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .384
PGUP (Key.PGUP property) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .385
removeListener (Key.removeListener method) . . . . . . . . . . . . . . . .385
RIGHT (Key.RIGHT property) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .386
SHIFT (Key.SHIFT property) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .387
SPACE (Key.SPACE property). . . . . . . . . . . . . . . . . . . . . . . . . . . . . .387
TAB (Key.TAB property). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .388
UP (Key.UP property) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .389
12 Contents
LoadVars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 390
addRequestHeader
(LoadVars.addRequestHeader method) . . . . . . . . . . . . . . . . . . . 392
contentType (LoadVars.contentType property) . . . . . . . . . . . . . . . 394
decode (LoadVars.decode method) . . . . . . . . . . . . . . . . . . . . . . . . . 394
getBytesLoaded (LoadVars.getBytesLoaded method) . . . . . . . . 395
getBytesTotal (LoadVars.getBytesTotal method). . . . . . . . . . . . . 396
load (LoadVars.load method) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397
loaded (LoadVars.loaded property). . . . . . . . . . . . . . . . . . . . . . . . . . 399
LoadVars constructor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 399
onData (LoadVars.onData handler) . . . . . . . . . . . . . . . . . . . . . . . . . 400
onLoad (LoadVars.onLoad handler) . . . . . . . . . . . . . . . . . . . . . . . . . .401
send (LoadVars.send method) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 402
sendAndLoad (LoadVars.sendAndLoad method). . . . . . . . . . . . . 404
toString (LoadVars.toString method) . . . . . . . . . . . . . . . . . . . . . . . . 405
Locale (mx.lang.Locale) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 406
addDelayedInstance (Locale.addDelayedInstance method). . . . 408
addXMLPath (Locale.addXMLPath method) . . . . . . . . . . . . . . . . . 408
checkXMLStatus (Locale.checkXMLStatus method) . . . . . . . . . 408
initialize (Locale.initialize method) . . . . . . . . . . . . . . . . . . . . . . . . . . . 409
loadLanguageXML (Locale.loadLanguageXML method) . . . . . . 409
loadString (Locale.loadString method) . . . . . . . . . . . . . . . . . . . . . . 409
setDefaultLang (Locale.setDefaultLang method) . . . . . . . . . . . . . 409
setLoadCallback (Locale.setLoadCallback method) . . . . . . . . . . .410
Math . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .410
abs (Math.abs method). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .413
acos (Math.acos method) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .414
asin (Math.asin method). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .414
atan (Math.atan method) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .415
atan2 (Math.atan2 method) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .416
ceil (Math.ceil method) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .416
cos (Math.cos method). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 417
E (Math.E property). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .418
exp (Math.exp method). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .418
floor (Math.floor method) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .419
LN10 (Math.LN10 property) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 420
LN2 (Math.LN2 property) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 420
log (Math.log method). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 420
LOG10E (Math.LOG10E property) . . . . . . . . . . . . . . . . . . . . . . . . . . .421
LOG2E (Math.LOG2E property) . . . . . . . . . . . . . . . . . . . . . . . . . . . . .421
max (Math.max method) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 422
min (Math.min method) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 422
PI (Math.PI property). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 423
pow (Math.pow method) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 424
random (Math.random method) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 425
Contents 13
round (Math.round method) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 425
sin (Math.sin method). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .426
sqrt (Math.sqrt method). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .427
SQRT1_2 (Math.SQRT1_2 property) . . . . . . . . . . . . . . . . . . . . . . . . .428
SQRT2 (Math.SQRT2 property). . . . . . . . . . . . . . . . . . . . . . . . . . . . 429
tan (Math.tan method) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 429
Mouse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 430
addListener (Mouse.addListener method) . . . . . . . . . . . . . . . . . . . .432
onMouseDown (Mouse.onMouseDown event listener). . . . . . . . .433
onMouseMove (Mouse.onMouseMove event listener) . . . . . . . . .435
onMouseUp (Mouse.onMouseUp event listener) . . . . . . . . . . . . . .436
removeListener (Mouse.removeListener method) . . . . . . . . . . . . .437
MovieClip. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 439
_alpha (MovieClip._alpha property). . . . . . . . . . . . . . . . . . . . . . . . . . .447
attachMovie (MovieClip.attachMovie method) . . . . . . . . . . . . . . . .448
beginFill (MovieClip.beginFill method). . . . . . . . . . . . . . . . . . . . . . . 449
beginGradientFill (MovieClip.beginGradientFill method). . . . . . . 450
clear (MovieClip.clear method) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .453
createEmptyMovieClip
(MovieClip.createEmptyMovieClip method) . . . . . . . . . . . . . . . 454
createTextField (MovieClip.createTextField method) . . . . . . . . . 455
_currentframe (MovieClip._currentframe property) . . . . . . . . . . . . .457
curveTo (MovieClip.curveTo method) . . . . . . . . . . . . . . . . . . . . . . . .457
_droptarget (MovieClip._droptarget property) . . . . . . . . . . . . . . . . 460
duplicateMovieClip (MovieClip.duplicateMovieClip method) . . . . 461
enabled (MovieClip.enabled property) . . . . . . . . . . . . . . . . . . . . . . . .462
endFill (MovieClip.endFill method) . . . . . . . . . . . . . . . . . . . . . . . . . . .463
focusEnabled (MovieClip.focusEnabled property) . . . . . . . . . . . . 464
_focusrect (MovieClip._focusrect property) . . . . . . . . . . . . . . . . . . 464
_framesloaded (MovieClip._framesloaded property) . . . . . . . . . . .465
getBounds (MovieClip.getBounds method) . . . . . . . . . . . . . . . . . . .466
getBytesLoaded (MovieClip.getBytesLoaded method) . . . . . . . .467
getBytesTotal (MovieClip.getBytesTotal method) . . . . . . . . . . . . .468
getDepth (MovieClip.getDepth method) . . . . . . . . . . . . . . . . . . . . . 469
getInstanceAtDepth
(MovieClip.getInstanceAtDepth method). . . . . . . . . . . . . . . . . . .470
getNextHighestDepth
(MovieClip.getNextHighestDepth method) . . . . . . . . . . . . . . . . . 471
getSWFVersion (MovieClip.getSWFVersion method) . . . . . . . . .472
getURL (MovieClip.getURL method). . . . . . . . . . . . . . . . . . . . . . . . .473
globalToLocal (MovieClip.globalToLocal method). . . . . . . . . . . . .474
gotoAndPlay (MovieClip.gotoAndPlay method) . . . . . . . . . . . . . . . 477
gotoAndStop (MovieClip.gotoAndStop method) . . . . . . . . . . . . . .478
_height (MovieClip._height property) . . . . . . . . . . . . . . . . . . . . . . . . .478
_highquality (MovieClip._highquality property). . . . . . . . . . . . . . . . .479
14 Contents
hitArea (MovieClip.hitArea property). . . . . . . . . . . . . . . . . . . . . . . . . 480
hitTest (MovieClip.hitTest method) . . . . . . . . . . . . . . . . . . . . . . . . . . 480
lineStyle (MovieClip.lineStyle method). . . . . . . . . . . . . . . . . . . . . . . 482
lineTo (MovieClip.lineTo method) . . . . . . . . . . . . . . . . . . . . . . . . . . . 483
loadMovie (MovieClip.loadMovie method) . . . . . . . . . . . . . . . . . . . 484
loadVariables (MovieClip.loadVariables method). . . . . . . . . . . . . . 485
localToGlobal (MovieClip.localToGlobal method) . . . . . . . . . . . . . 487
_lockroot (MovieClip._lockroot property) . . . . . . . . . . . . . . . . . . . . . 489
moveTo (MovieClip.moveTo method). . . . . . . . . . . . . . . . . . . . . . . . 492
_name (MovieClip._name property) . . . . . . . . . . . . . . . . . . . . . . . . . . 493
nextFrame (MovieClip.nextFrame method). . . . . . . . . . . . . . . . . . . 493
onData (MovieClip.onData handler) . . . . . . . . . . . . . . . . . . . . . . . . . 494
onDragOut (MovieClip.onDragOut handler) . . . . . . . . . . . . . . . . . . 495
onDragOver (MovieClip.onDragOver handler) . . . . . . . . . . . . . . . . 496
onEnterFrame (MovieClip.onEnterFrame handler) . . . . . . . . . . . . 496
onKeyDown (MovieClip.onKeyDown handler) . . . . . . . . . . . . . . . . 497
onKeyUp (MovieClip.onKeyUp handler) . . . . . . . . . . . . . . . . . . . . . 498
onKillFocus (MovieClip.onKillFocus handler) . . . . . . . . . . . . . . . . . 499
onLoad (MovieClip.onLoad handler). . . . . . . . . . . . . . . . . . . . . . . . . 500
onMouseDown (MovieClip.onMouseDown handler). . . . . . . . . . . .501
onMouseMove (MovieClip.onMouseMove handler) . . . . . . . . . . . .501
onMouseUp (MovieClip.onMouseUp handler) . . . . . . . . . . . . . . . . 502
onPress (MovieClip.onPress handler). . . . . . . . . . . . . . . . . . . . . . . . 502
onRelease (MovieClip.onRelease handler) . . . . . . . . . . . . . . . . . . . 502
onReleaseOutside (MovieClip.onReleaseOutside handler). . . . . 503
onRollOut (MovieClip.onRollOut handler) . . . . . . . . . . . . . . . . . . . . 503
onRollOver (MovieClip.onRollOver handler) . . . . . . . . . . . . . . . . . . 504
onSetFocus (MovieClip.onSetFocus handler) . . . . . . . . . . . . . . . . 504
onUnload (MovieClip.onUnload handler) . . . . . . . . . . . . . . . . . . . . . 505
_parent (MovieClip._parent property) . . . . . . . . . . . . . . . . . . . . . . . . 505
play (MovieClip.play method) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 506
prevFrame (MovieClip.prevFrame method). . . . . . . . . . . . . . . . . . . 507
_quality (MovieClip._quality property) . . . . . . . . . . . . . . . . . . . . . . . . 508
removeMovieClip (MovieClip.removeMovieClip method) . . . . . . 509
_rotation (MovieClip._rotation property) . . . . . . . . . . . . . . . . . . . . . . .510
setMask (MovieClip.setMask method) . . . . . . . . . . . . . . . . . . . . . . . . 511
_soundbuftime (MovieClip._soundbuftime property) . . . . . . . . . . . .512
startDrag (MovieClip.startDrag method) . . . . . . . . . . . . . . . . . . . . . .512
stop (MovieClip.stop method). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .513
stopDrag (MovieClip.stopDrag method) . . . . . . . . . . . . . . . . . . . . . .514
swapDepths (MovieClip.swapDepths method) . . . . . . . . . . . . . . . .515
tabChildren (MovieClip.tabChildren property). . . . . . . . . . . . . . . . . .516
tabEnabled (MovieClip.tabEnabled property) . . . . . . . . . . . . . . . . . . 517
tabIndex (MovieClip.tabIndex property) . . . . . . . . . . . . . . . . . . . . . . . 517
_target (MovieClip._target property) . . . . . . . . . . . . . . . . . . . . . . . . . .518
_totalframes (MovieClip._totalframes property) . . . . . . . . . . . . . . . .519
Contents 15
trackAsMenu (MovieClip.trackAsMenu property). . . . . . . . . . . . . . 519
unloadMovie (MovieClip.unloadMovie method) . . . . . . . . . . . . . . 520
_url (MovieClip._url property) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 521
_visible (MovieClip._visible property) . . . . . . . . . . . . . . . . . . . . . . . . .522
_width (MovieClip._width property). . . . . . . . . . . . . . . . . . . . . . . . . . .523
_x (MovieClip._x property). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .523
_xmouse (MovieClip._xmouse property) . . . . . . . . . . . . . . . . . . . . . 524
_xscale (MovieClip._xscale property) . . . . . . . . . . . . . . . . . . . . . . . . 524
_y (MovieClip._y property). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .526
_ymouse (MovieClip._ymouse property) . . . . . . . . . . . . . . . . . . . . . .526
_yscale (MovieClip._yscale property) . . . . . . . . . . . . . . . . . . . . . . . . .527
MovieClipLoader . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .528
addListener (MovieClipLoader.addListener method) . . . . . . . . . 530
getProgress (MovieClipLoader.getProgress method) . . . . . . . . . .532
loadClip (MovieClipLoader.loadClip method) . . . . . . . . . . . . . . . . .533
MovieClipLoader constructor. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .535
onLoadComplete
(MovieClipLoader.onLoadComplete event listener) . . . . . . . . .535
onLoadError (MovieClipLoader.onLoadError event listener). . . .537
onLoadInit (MovieClipLoader.onLoadInit event listener) . . . . . . .538
onLoadProgress
(MovieClipLoader.onLoadProgress event listener) . . . . . . . . . 539
onLoadStart (MovieClipLoader.onLoadStart event listener) . . . . 541
removeListener (MovieClipLoader.removeListener method). . . 542
unloadClip (MovieClipLoader.unloadClip method) . . . . . . . . . . . . .543
Number . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 544
MAX_VALUE (Number.MAX_VALUE property) . . . . . . . . . . . . . . .546
MIN_VALUE (Number.MIN_VALUE property). . . . . . . . . . . . . . . . .546
NaN (Number.NaN property) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .547
NEGATIVE_INFINITY
(Number.NEGATIVE_INFINITY property) . . . . . . . . . . . . . . . . . .547
Number constructor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .548
POSITIVE_INFINITY
(Number.POSITIVE_INFINITY property) . . . . . . . . . . . . . . . . . . .548
toString (Number.toString method) . . . . . . . . . . . . . . . . . . . . . . . . . 549
valueOf (Number.valueOf method) . . . . . . . . . . . . . . . . . . . . . . . . . . 549
Object. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 550
addProperty (Object.addProperty method) . . . . . . . . . . . . . . . . . . . 551
constructor (Object.constructor property) . . . . . . . . . . . . . . . . . . . 554
hasOwnProperty (Object.hasOwnProperty method) . . . . . . . . . . 555
isPropertyEnumerable (Object.isPropertyEnumerable method) 555
isPrototypeOf (Object.isPrototypeOf method) . . . . . . . . . . . . . . . .556
Object constructor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .557
__proto__ (Object.__proto__ property). . . . . . . . . . . . . . . . . . . . . . . . .557
prototype (Object.prototype property). . . . . . . . . . . . . . . . . . . . . . . .558
16 Contents
registerClass (Object.registerClass method). . . . . . . . . . . . . . . . . . 559
__resolve (Object.__resolve property) . . . . . . . . . . . . . . . . . . . . . . . . 560
toString (Object.toString method) . . . . . . . . . . . . . . . . . . . . . . . . . . . 563
unwatch (Object.unwatch method) . . . . . . . . . . . . . . . . . . . . . . . . . . 565
valueOf (Object.valueOf method). . . . . . . . . . . . . . . . . . . . . . . . . . . . 565
watch (Object.watch method). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 566
security (System.security) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 569
allowDomain (security.allowDomain method). . . . . . . . . . . . . . . . . 570
allowInsecureDomain
(security.allowInsecureDomain method) . . . . . . . . . . . . . . . . . . . 572
loadPolicyFile (security.loadPolicyFile method) . . . . . . . . . . . . . . . 573
Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 575
addListener (Selection.addListener method) . . . . . . . . . . . . . . . . . 576
getFocus (Selection.getFocus method) . . . . . . . . . . . . . . . . . . . . . . 577
onSetFocus (Selection.onSetFocus event listener) . . . . . . . . . . . 578
removeListener (Selection.removeListener method) . . . . . . . . . . 580
setFocus (Selection.setFocus method) . . . . . . . . . . . . . . . . . . . . . . .581
SharedObject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 582
addListener (SharedObject.addListener method) . . . . . . . . . . . . . 586
clear (SharedObject.clear method) . . . . . . . . . . . . . . . . . . . . . . . . . . 587
data (SharedObject.data property) . . . . . . . . . . . . . . . . . . . . . . . . . . 587
flush (SharedObject.flush method) . . . . . . . . . . . . . . . . . . . . . . . . . . 589
getLocal (SharedObject.getLocal method). . . . . . . . . . . . . . . . . . . .591
getMaxSize (SharedObject.getMaxSize method) . . . . . . . . . . . . . 592
getSize (SharedObject.getSize method) . . . . . . . . . . . . . . . . . . . . . 592
onStatus (SharedObject.onStatus handler) . . . . . . . . . . . . . . . . . . 593
removeListener (SharedObject.removeListener method) . . . . . . 595
Sound . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 595
attachSound (Sound.attachSound method) . . . . . . . . . . . . . . . . . . 598
duration (Sound.duration property) . . . . . . . . . . . . . . . . . . . . . . . . . . 598
getBytesLoaded (Sound.getBytesLoaded method). . . . . . . . . . . 600
getBytesTotal (Sound.getBytesTotal method). . . . . . . . . . . . . . . . 602
getPan (Sound.getPan method) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 602
getTransform (Sound.getTransform method). . . . . . . . . . . . . . . . . 603
getVolume (Sound.getVolume method). . . . . . . . . . . . . . . . . . . . . . 605
id3 (Sound.id3 property) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 607
loadSound (Sound.loadSound method). . . . . . . . . . . . . . . . . . . . . . 609
onID3 (Sound.onID3 handler) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .610
onLoad (Sound.onLoad handler). . . . . . . . . . . . . . . . . . . . . . . . . . . . . 611
onSoundComplete (Sound.onSoundComplete handler) . . . . . . . .612
position (Sound.position property) . . . . . . . . . . . . . . . . . . . . . . . . . . .612
setPan (Sound.setPan method) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .613
setTransform (Sound.setTransform method) . . . . . . . . . . . . . . . . . .613
setVolume (Sound.setVolume method) . . . . . . . . . . . . . . . . . . . . . . .615
Sound constructor. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .616
Contents 17
start (Sound.start method) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 616
stop (Sound.stop method) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 617
Stage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 618
addListener (Stage.addListener method) . . . . . . . . . . . . . . . . . . . . 620
align (Stage.align property) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 620
height (Stage.height property). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 621
onResize (Stage.onResize event listener) . . . . . . . . . . . . . . . . . . . .622
removeListener (Stage.removeListener method) . . . . . . . . . . . . . .623
scaleMode (Stage.scaleMode property) . . . . . . . . . . . . . . . . . . . . . .624
width (Stage.width property) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .625
String . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .626
charAt (String.charAt method). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .628
charCodeAt (String.charCodeAt method). . . . . . . . . . . . . . . . . . . . .629
concat (String.concat method) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 630
fromCharCode (String.fromCharCode method) . . . . . . . . . . . . . . 630
indexOf (String.indexOf method) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 631
lastIndexOf (String.lastIndexOf method) . . . . . . . . . . . . . . . . . . . . . .632
length (String.length property). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .633
slice (String.slice method). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .634
split (String.split method) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .635
String constructor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .637
substr (String.substr method). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .637
substring (String.substring method) . . . . . . . . . . . . . . . . . . . . . . . . . .638
toLowerCase (String.toLowerCase method) . . . . . . . . . . . . . . . . . .639
toString (String.toString method) . . . . . . . . . . . . . . . . . . . . . . . . . . . 640
toUpperCase (String.toUpperCase method) . . . . . . . . . . . . . . . . . . 641
valueOf (String.valueOf method). . . . . . . . . . . . . . . . . . . . . . . . . . . . . 641
System. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .642
onStatus (System.onStatus handler) . . . . . . . . . . . . . . . . . . . . . . . . .643
useCodepage (System.useCodepage property) . . . . . . . . . . . . . . 644
TextField . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .645
addListener (TextField.addListener method). . . . . . . . . . . . . . . . . 650
_alpha (TextField._alpha property) . . . . . . . . . . . . . . . . . . . . . . . . . . . 651
autoSize (TextField.autoSize property) . . . . . . . . . . . . . . . . . . . . . . .652
background (TextField.background property) . . . . . . . . . . . . . . . . .654
backgroundColor (TextField.backgroundColor property) . . . . . . .654
border (TextField.border property) . . . . . . . . . . . . . . . . . . . . . . . . . . .655
borderColor (TextField.borderColor property) . . . . . . . . . . . . . . . . .655
bottomScroll (TextField.bottomScroll property) . . . . . . . . . . . . . . .655
condenseWhite (TextField.condenseWhite property) . . . . . . . . . .656
embedFonts (TextField.embedFonts property). . . . . . . . . . . . . . . .657
getDepth (TextField.getDepth method) . . . . . . . . . . . . . . . . . . . . . .658
getNewTextFormat (TextField.getNewTextFormat method). . . 659
getTextFormat (TextField.getTextFormat method) . . . . . . . . . . . 659
_height (TextField._height property) . . . . . . . . . . . . . . . . . . . . . . . . . . 661
18 Contents
_highquality (TextField._highquality property). . . . . . . . . . . . . . . . . .661
hscroll (TextField.hscroll property) . . . . . . . . . . . . . . . . . . . . . . . . . . .661
html (TextField.html property). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 662
htmlText (TextField.htmlText property) . . . . . . . . . . . . . . . . . . . . . . 663
length (TextField.length property) . . . . . . . . . . . . . . . . . . . . . . . . . . . 663
maxChars (TextField.maxChars property) . . . . . . . . . . . . . . . . . . . . 664
maxhscroll (TextField.maxhscroll property). . . . . . . . . . . . . . . . . . . 664
maxscroll (TextField.maxscroll property) . . . . . . . . . . . . . . . . . . . . . 665
multiline (TextField.multiline property) . . . . . . . . . . . . . . . . . . . . . . . 665
_name (TextField._name property) . . . . . . . . . . . . . . . . . . . . . . . . . . 666
onChanged (TextField.onChanged handler) . . . . . . . . . . . . . . . . . . 666
onKillFocus (TextField.onKillFocus handler). . . . . . . . . . . . . . . . . . 667
onScroller (TextField.onScroller handler) . . . . . . . . . . . . . . . . . . . . 668
onSetFocus (TextField.onSetFocus handler). . . . . . . . . . . . . . . . . 670
_parent (TextField._parent property) . . . . . . . . . . . . . . . . . . . . . . . . . 670
password (TextField.password property). . . . . . . . . . . . . . . . . . . . . . 671
_quality (TextField._quality property). . . . . . . . . . . . . . . . . . . . . . . . . 672
removeListener (TextField.removeListener method) . . . . . . . . . . 673
removeTextField (TextField.removeTextField method) . . . . . . . . 674
replaceText (TextField.replaceText method) . . . . . . . . . . . . . . . . . 674
_rotation (TextField._rotation property). . . . . . . . . . . . . . . . . . . . . . . 675
scroll (TextField.scroll property). . . . . . . . . . . . . . . . . . . . . . . . . . . . . 676
selectable (TextField.selectable property) . . . . . . . . . . . . . . . . . . . . 677
setNewTextFormat (TextField.setNewTextFormat method). . . . 678
setTextFormat (TextField.setTextFormat method) . . . . . . . . . . . . 679
_soundbuftime (TextField._soundbuftime property) . . . . . . . . . . . .681
styleSheet (TextField.styleSheet property) . . . . . . . . . . . . . . . . . . . .681
tabEnabled (TextField.tabEnabled property) . . . . . . . . . . . . . . . . . 683
tabIndex (TextField.tabIndex property). . . . . . . . . . . . . . . . . . . . . . . 684
_target (TextField._target property) . . . . . . . . . . . . . . . . . . . . . . . . . . 685
text (TextField.text property). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 686
textColor (TextField.textColor property). . . . . . . . . . . . . . . . . . . . . . 687
textHeight (TextField.textHeight property) . . . . . . . . . . . . . . . . . . . 687
textWidth (TextField.textWidth property) . . . . . . . . . . . . . . . . . . . . 688
type (TextField.type property). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 688
_url (TextField._url property) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 689
variable (TextField.variable property) . . . . . . . . . . . . . . . . . . . . . . . . 689
_visible (TextField._visible property) . . . . . . . . . . . . . . . . . . . . . . . . . 690
_width (TextField._width property). . . . . . . . . . . . . . . . . . . . . . . . . . . 690
wordWrap (TextField.wordWrap property) . . . . . . . . . . . . . . . . . . . .691
_x (TextField._x property). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 692
_xmouse (TextField._xmouse property) . . . . . . . . . . . . . . . . . . . . . . 692
_xscale (TextField._xscale property) . . . . . . . . . . . . . . . . . . . . . . . . . 693
_y (TextField._y property). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 694
_ymouse (TextField._ymouse property) . . . . . . . . . . . . . . . . . . . . . . 694
_yscale (TextField._yscale property) . . . . . . . . . . . . . . . . . . . . . . . . . 695
Contents 19
TextFormat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 695
align (TextFormat.align property) . . . . . . . . . . . . . . . . . . . . . . . . . . . .697
blockIndent (TextFormat.blockIndent property) . . . . . . . . . . . . . . .698
bold (TextFormat.bold property) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 699
bullet (TextFormat.bullet property) . . . . . . . . . . . . . . . . . . . . . . . . . . 699
color (TextFormat.color property). . . . . . . . . . . . . . . . . . . . . . . . . . . .700
font (TextFormat.font property). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 701
getTextExtent (TextFormat.getTextExtent method). . . . . . . . . . . . 701
indent (TextFormat.indent property) . . . . . . . . . . . . . . . . . . . . . . . . .704
italic (TextFormat.italic property) . . . . . . . . . . . . . . . . . . . . . . . . . . . .704
leading (TextFormat.leading property). . . . . . . . . . . . . . . . . . . . . . . .705
leftMargin (TextFormat.leftMargin property) . . . . . . . . . . . . . . . . . .705
rightMargin (TextFormat.rightMargin property). . . . . . . . . . . . . . . .706
size (TextFormat.size property). . . . . . . . . . . . . . . . . . . . . . . . . . . . . .706
tabStops (TextFormat.tabStops property) . . . . . . . . . . . . . . . . . . . .707
target (TextFormat.target property) . . . . . . . . . . . . . . . . . . . . . . . . . . 707
TextFormat constructor. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .708
underline (TextFormat.underline property) . . . . . . . . . . . . . . . . . . . . 710
url (TextFormat.url property) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 710
Video . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .711
close (Video.close method) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 713
onStatus (Video.onStatus handler). . . . . . . . . . . . . . . . . . . . . . . . . . . 713
pause (Video.pause method) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 714
play (Video.play method). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 714
resume (Video.resume method) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 715
stop (Video.stop method) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 715
XML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 716
addRequestHeader (XML.addRequestHeader method). . . . . . . . 719
contentType (XML.contentType property) . . . . . . . . . . . . . . . . . . . .720
createElement (XML.createElement method) . . . . . . . . . . . . . . . . . 721
createTextNode (XML.createTextNode method) . . . . . . . . . . . . . .722
docTypeDecl (XML.docTypeDecl property) . . . . . . . . . . . . . . . . . .723
getBytesLoaded (XML.getBytesLoaded method) . . . . . . . . . . . . .724
getBytesTotal (XML.getBytesTotal method) . . . . . . . . . . . . . . . . . . 725
ignoreWhite (XML.ignoreWhite property) . . . . . . . . . . . . . . . . . . . .725
load (XML.load method) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 727
loaded (XML.loaded property). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .729
onData (XML.onData handler). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .729
onLoad (XML.onLoad handler) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .730
parseXML (XML.parseXML method). . . . . . . . . . . . . . . . . . . . . . . . . 731
send (XML.send method) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .732
sendAndLoad (XML.sendAndLoad method). . . . . . . . . . . . . . . . . .733
status (XML.status property) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 735
XML constructor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .736
xmlDecl (XML.xmlDecl property) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 737
20 Contents
XMLNode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 738
appendChild (XMLNode.appendChild method) . . . . . . . . . . . . . . . 740
attributes (XMLNode.attributes property) . . . . . . . . . . . . . . . . . . . . 742
childNodes (XMLNode.childNodes property). . . . . . . . . . . . . . . . . 742
cloneNode (XMLNode.cloneNode method) . . . . . . . . . . . . . . . . . . 744
firstChild (XMLNode.firstChild property) . . . . . . . . . . . . . . . . . . . . . 745
hasChildNodes (XMLNode.hasChildNodes method) . . . . . . . . . . 747
insertBefore (XMLNode.insertBefore method) . . . . . . . . . . . . . . . 747
lastChild (XMLNode.lastChild property). . . . . . . . . . . . . . . . . . . . . . 748
nextSibling (XMLNode.nextSibling property) . . . . . . . . . . . . . . . . . 750
nodeName (XMLNode.nodeName property) . . . . . . . . . . . . . . . . . 750
nodeType (XMLNode.nodeType property) . . . . . . . . . . . . . . . . . . . 752
nodeValue (XMLNode.nodeValue property) . . . . . . . . . . . . . . . . . . 753
parentNode (XMLNode.parentNode property). . . . . . . . . . . . . . . . 754
previousSibling (XMLNode.previousSibling property) . . . . . . . . . 755
removeNode (XMLNode.removeNode method) . . . . . . . . . . . . . . 756
toString (XMLNode.toString method) . . . . . . . . . . . . . . . . . . . . . . . 756
XMLUI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 757
accept (XMLUI.accept method) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 759
cancel (XMLUI.cancel method) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 759
get (XMLUI.get method) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 759
set (XMLUI.set method) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 759
Chapter 3: Deprecated ActionScript . . . . . . . . . . . . . . . . . . . . . . 761
Deprecated Function summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 761
Deprecated Property summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 763
Deprecated Operator summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 763
Chapter 4: Unsupported ActionScript . . . . . . . . . . . . . . . . . . . . 765
Unsupported Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 765
Unsupported Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 765
Unsupported Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 765
Unsupported Global Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 766
Unsupported Event Handlers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 766
Unsupported fscommands. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 766
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .767
Contents 21
22 Contents
CHAPTER 1
ActionScript language
elements
This section provides syntax, usage information, and code samples for global functions and
properties (those elements that do not belong to an ActionScript class); compiler directives;
and for the constants, operators, statements, and keywords used in ActionScript and defined
in the ECMAScript (ECMA-262) edition 4 draft language specification.
Compiler Directives
This section contains the directives to include in your ActionScript file to direct the compiler
to preprocess certain instructions.
Compiler Directives summary
Directive Description
#endinitclip Compiler directive; indicates the end of a block of initialization
actions.
#include Compiler directive: includes the contents of the specified file, as if the
commands in the file are part of the calling script.
#initclip Compiler directive; indicates the beginning of a block of initialization
actions.
1
#endinitclip directive
#endinitclip
Compiler directive; indicates the end of a block of initialization actions.
Availability: ActionScript 1.0; Flash Lite 2.0
Example
#initclip
...initialization actions go here...
#endinitclip
23
#include directive
#include "[path]filename.as" — Do not place a semicolon (;) at the end of the line that
contains the #include statement.
Compiler directive: includes the contents of the specified file, as if the commands in the file
are part of the calling script. The
you make any changes to an external file, you must save the file and recompile any FLA files
that use it.
If you use the Check Syntax button for a script that contains
of the included files is also checked.
You can use
#include in FLA files and in external script files, but not in ActionScript 2.0
class files.
You can specify no path, a relative path, or an absolute path for the file to be included. If you
don't specify a path, the AS file must be in one of the following locations:
■ The same directory as the FLA file. The same directory as the script containing the
#include statement
■ The global Include directory, which is one of the following:
--Windows 2000 or Windows XP: C:\Documents and Settings\user \Local Settings\
Application Data\Macromedia\Flash 8\language\Configuration\Include
--Macintosh OS X: Hard Drive/Users/Library/Application Support/Macromedia/Flash 8/
language /Configuration/Include
■ The Flash 8 program \language \First Run\Include directory; if you save a file here, it is
copied to the global Include directory the next time you start Flash.
To specify a relative path for the AS file, use a single dot (.) to indicate the current directory,
two dots (
..) to indicate a parent directory, and forward slashes (/) to indicate subdirectories.
See the following example section.
To specify an absolute path for the AS file, use the format supported by your platform
(Macintosh or Windows). See the following example section. (This usage is not
recommended because it requires the directory structure to be the same on any computer that
you use to compile the script.)
If you place files in the First Run/Include directory or in the global Include directory, back up these
files. If you ever need to uninstall and reinstall Flash, these directories might be deleted and
overwritten.
Availability: ActionScript 1.0; Flash Lite 2.0
#include directive is invoked at compile time. Therefore, if
#include statements, the syntax
24 ActionScript language elements
Parameters
[path]filename.as - filename.asThe filename and optional path for the script to add to
the Actions panel or to the current script; .as is the recommended filename extension.
Example
The following examples show various ways of specifying a path for a file to be included in
your script:
// Note that #include statements do not end with a semicolon (;)
// AS file is in same directory as FLA file or script
// or is in the global Include directory or the First Run/Include directory
#include "init_script.as"
// AS file is in a subdirectory of one of the above directories
// The subdirectory is named "FLA_includes"
#include "FLA_includes/init_script.as"
// AS file is in a subdirectory of the script file directory
// The subdirectory is named "SCRIPT_includes"
#include "SCRIPT_includes/init_script.as"
// AS file is in a directory at the same level as one of the above
directories
// AS file is in a directory at the same level as the directory
// that contains the script file
// The directory is named "ALL_includes"
#include "../ALL_includes/init_script.as"
// AS file is specified by an absolute path in Windows
// Note use of forward slashes, not backslashes
#include "C:/Flash_scripts/init_script.as"
// AS file is specified by an absolute path on Macintosh
#include "Mac HD:Flash_scripts:init_script.as"
#initclip directive
#initclip order — Do not place a semicolon (;) at the end of the line that contains the
#initclip statement.
Compiler directive; indicates the beginning of a block of initialization actions. When multiple
clips are initialized at the same time, you can use the
initialization occurs first. Initialization actions execute when a movie clip symbol is defined. If
the movie clip is an exported symbol, the initialization actions execute before the actions on
Frame 1 of the SWF file. Otherwise, they execute immediately before the frame actions of the
frame that contains the first instance of the associated movie clip symbol.
order parameter to specify which
Compiler Directives 25
Initialization actions execute only once when a SWF file plays; use them for one-time
initializations, such as class definition and registration.
Availability: ActionScript 1.0; Flash Lite 2.0
Parameters
order - A non-negative integer that specifies the execution order of blocks of #initclip
code. This is an optional parameter. You must specify the value by using an integer literal
(only decimal—not hexidecimal—values are allowed), and not by using a variable. If you
include multiple
last
order value specified in that movie clip symbol for all #initclip blocks in that symbol.
#initclip blocks in a single movie clip symbol, then the compiler uses the
Example
In the following example, ActionScript is placed on Frame 1 inside a movie clip instance. A
variables.txt text file is placed in the same directory.
#initclip
trace("initializing app");
var variables:LoadVars = new LoadVars();
variables.load("variables.txt");
variables.onLoad = function(success:Boolean) {
trace("variables loaded:"+success);
if (success) {
for (i in variables) {
trace("variables."+i+" = "+variables[i]);
}
}
};
#endinitclip
26 ActionScript language elements
Constants
A constant is a variable used to represent a property whose value never changes. This section
describes global constants that are available to every script.
Constants summary
Modifiers Constant Description
false A unique Boolean value that represents the
opposite of true.
Infinity Specifies the IEEE-754 value representing
positive infinity.
-Infinity Specifies the IEEE-754 value representing
negative infinity.
NaN A predefined variable with the IEEE-754 value for
NaN (not a number).
newline Inserts a carriage return character (\r) that
generates a blank line in text output generated by
your code.
null A special value that can be assigned to variables or
returned by a function if no data was provided.
true A unique Boolean value that represents the
opposite of false.
undefined A special value, usually used to indicate that a
variable has not yet been assigned a value.
false constant
A unique Boolean value that represents the opposite of true .
When automatic data typing converts
false to a string, it becomes "false".
Availability: ActionScript 1.0; Flash Lite 1.1
false to a number, it becomes 0; when it converts
Constants 27
Example
This example shows how automatic data typing converts false to a number and to a string:
var bool1:Boolean = Boolean(false);
// converts it to the number 0
trace(1 + bool1); // outputs 1
// converts it to a string
trace("String: " + bool1); // outputs String: false
Infinity constant
Specifies the IEEE-754 value representing positive infinity. The value of this constant is the
same as
Number.POSITIVE_INFINITY.
Availability: ActionScript 1.0; Flash Lite 2.0
See also
POSITIVE_INFINITY (Number.POSITIVE_INFINITY property)
-Infinity constant
Specifies the IEEE-754 value representing negative infinity. The value of this constant is the
same as
Availability: ActionScript 1.0; Flash Lite 2.0
Number.NEGATIVE_INFINITY.
See also
NEGATIVE_INFINITY (Number.NEGATIVE_INFINITY property)
NaN constant
A predefined variable with the IEEE-754 value for NaN (not a number). To determine if a
number is NaN, use
Availability: ActionScript 1.0; Flash Lite 1.1
See also
isNaN function, NaN (Number.NaN property)
28 ActionScript language elements
isNaN().
newline constant
Inserts a carriage return character (\r ) that generates a blank line in text output generated by
your code. Use
newline to make space for information that is retrieved by a function or
statement in your code.
Availability: ActionScript 1.0; Flash Lite 1.1
Example
The following example shows how newline displays output from the trace() statement on
multiple lines.
var myName:String = "Lisa", myAge:Number = 30;
trace(myName+myAge);
trace("-----");
trace(myName+newline+myAge);
// output:
Lisa30
----Lisa
30
See also
trace function
null constant
A special value that can be assigned to variables or returned by a function if no data was
provided. You can use
null to represent values that are missing or that do not have a defined
data type.
Availability: ActionScript 1.0; Flash Lite 1.1
Example
In a numeric context, null evaluates to 0. Equality tests can be performed with null . In this
statement, a binary tree node has no left child, so the field for its left child could be set to
null.
if (tree.left == null) {
tree.left = new TreeNode();
}
Constants 29
true constant
A unique Boolean value that represents the opposite of false . When automatic data typing
converts
"true".
Availability: ActionScript 1.0; Flash Lite 1.1
Example
The following example shows the use of true in an if statement:
var shouldExecute:Boolean;
// ...
// code that sets shouldExecute to either true or false goes here
// shouldExecute is set to true for this example:
shouldExecute = true;
if (shouldExecute == true) {
trace("your statements here");
}
// true is also implied, so the if statement could also be written:
// if (shouldExecute) {
// trace("your statements here");
// }
The following example shows how automatic data typing converts true to the number 1:
var myNum:Number;
myNum = 1 + true;
trace(myNum); // output: 2
true to a number, it becomes 1; when it converts true to a string, it becomes
See also
false constant, Boolean
undefined constant
A special value, usually used to indicate that a variable has not yet been assigned a value. A
reference to an undefined value returns the special value
typeof(undefined) returns the string "undefined". The only value of type undefined is
undefined.
In files published for Flash Player 6 or earlier, the value of
empty string). In files published for Flash Player 7 or later, the value of
is
"undefined" (undefined is converted to a string).
30 ActionScript language elements
undefined. The ActionScript code
String(undefined) is "" (an
String(undefined)