User Guide
182 ActionScript language elements
Parameters
expression:String - Any expression.
Example
The following example defines conditions for the switch statement thisMonth. If thisMonth
equals the expression in the case statement, the statement executes.
var thisMonth:Number = new Date().getMonth();
switch (thisMonth) {
case 0 :
trace("January");
break;
case 1 :
trace("February");
break;
case 5 :
case 6 :
case 7 :
trace("Some summer month");
break;
case 8 :
trace("September");
break;
default :
trace("some other month");
}
See also
break statement
class statement
[dynamic] class className [ extends superClass ] [ implements
interfaceName[, interfaceName... ] ] { // class definition here}
Defines a custom class, which lets you instantiate objects that share methods and properties
that you define. For example, if you are developing an invoice-tracking system, you could
create an invoice class that defines all the methods and properties that each invoice should
have. You would then use the
new invoice() command to create invoice objects.