Syntax
17
Comments can be any length without affecting the size of the exported file, and they do not need
to follow rules for ActionScript syntax or keywords.
To create a comment block, place
/*
at the beginning of the commented lines and
*/
at the end.
This technique lets you create lengthy comments without adding // at the beginning of each line.
By placing large chunks of script in a comment block, called
commenting out
a portion of your
script, you can test specific parts of a script. For example, when the following script runs, none of
the code in the comment block is executed:
// The following code runs
var x:Number = 15;
var y:Number = 20;
// The following code doesn’t run
/*
// create new Date object
var myDate:Date = new Date();
var currentMonth:Number = myDate.getMonth();
// convert month number to month name
var monthName:String = calcMonth(currentMonth);
var year:Number = myDate.getFullYear();
var currentDate:Number = myDate.getDate();}
*/
// The code below runs
var name:String = "My name is";
var age:Number = 20;
Keywords and reserved words
ActionScript reserves words for specific use within the language, so you can’t use them
as identifiers, such as variable, function, or label names. The following table lists all
ActionScript keywords:
break
case
class
continue
default
delete
dynamic
else
extends
for
function
get
if
implements
import
in
instanceof
interface
intrinsic
new
private
public
return
set
static
switch
this
typeof
var
void
while
with
Содержание FLEX
Страница 1: ...Flex ActionScript Language Reference ...
Страница 8: ......
Страница 66: ...66 Chapter 2 Creating Custom Classes with ActionScript 2 0 ...
Страница 76: ......
Страница 133: ...break 133 See also for for in do while while switch case continue throw try catch finally ...
Страница 135: ...case 135 See also break default strict equality switch ...
Страница 146: ...146 Chapter 5 ActionScript Core Language Elements See also break continue while ...
Страница 229: ...while 229 i 3 The following result is written to the log file 0 3 6 9 12 15 18 See also do while continue for for in ...
Страница 808: ...808 Chapter 7 ActionScript for Flash ...
Страница 810: ...810 Appendix A Deprecated Flash 4 operators ...
Страница 815: ...Other keys 815 Num Lock 144 186 187 _ 189 191 192 219 220 221 222 Key Key code ...
Страница 816: ...816 Appendix B Keyboard Keys and Key Code Values ...
Страница 822: ...822 Index ...