Statements
187
Example
In the following example, the expression A does not equal the expressions B or D, so the
statement following the
default
keyword is run and the
trace()
statement is sent to the
Output panel.
var dayOfWeek:Number = new Date().getDay();
switch (dayOfWeek) {
case 1 :
trace("Monday");
break;
case 2 :
trace("Tuesday");
break;
case 3 :
trace("Wednesday");
break;
case 4 :
trace("Thursday");
break;
case 5 :
trace("Friday");
break;
default :
trace("Weekend");
}
See also
switch statement
delete statement
delete
reference
Destroys the object reference specified by the
reference
parameter, and returns
true
if the
reference is successfully deleted;
false
otherwise. This operator is useful for freeing memory
used by scripts. You can use the
delete
operator to remove references to objects. After all
references to an object are removed, Flash Player takes care of removing the object and freeing
the memory used by that object.
Although
delete
is an operator, it is typically used as a statement, as shown in the following
example:
delete x;
Содержание Flash Lite 2
Страница 1: ...Flash Lite 2 x ActionScript Language Reference...
Страница 22: ...22 Contents...
Страница 244: ...244 ActionScript language elements...
Страница 760: ...760 ActionScript classes...