To create a comment block, place
For example, when the following script runs, none of the code in the comment block is executed:
// The code below runs
var x:Number = 15;
var y:Number = 20;
// The code below doesn't run
/*
on(release) {
// create new Date object
myDate = new Date();
currentMonth = myDate.getMonth();
// convert month number to month name
monthName = calcMonth(currentMonth);
year = myDate.getFullYear();
currentDate = myDate.getDate();
}
*/
// The code below runs
var name:String = "My name is";
var age:Number = 20;
Keywords
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
default
extends
if
instanceof
private
static
var
Constants
A constant is a property whose value never changes.
For example, the constants
the Key object and refer to keyboard keys. To test whether the user is pressing the Enter key, you
could use the following statement:
if(Key.getCode() == Key.ENTER) {
alert = "Are you ready to play?";
controlMC.gotoAndStop(5);
}
at the beginning of the commented lines and
/*
case
delete
for
implements
interface
public
switch
void
,
,
BACKSPACE
ENTER
class
dynamic
function
import
intrinsic
return
this
while
,
,
QUOTE
RETURN
SPACE
at the end.
*/
continue
else
get
in
new
set
typeof
with
, and
are properties of
TAB
Syntax
33
Need help?
Do you have a question about the FLASH MX 2004 - ACTIONSCRIPT and is the answer not in the manual?
Questions and answers