03.05.2013 Views

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Note: You should always end the statement(s) parameter with a break statement. If you<br />

omit the break statement from the statement(s) parameter, it continues executing with<br />

the next case statement instead of exiting the switch statement.<br />

Parameters<br />

expression:String - Any expression.<br />

Example<br />

The following example defines conditions for the switch statement thisMonth. If thisMonth<br />

equals the expression in the case statement, the statement executes.<br />

var thisMonth:Number = new Date().getMonth();<br />

switch (thisMonth) {<br />

case 0 :<br />

trace("January");<br />

break;<br />

case 1 :<br />

trace("February");<br />

break;<br />

case 5 :<br />

case 6 :<br />

case 7 :<br />

trace("Some summer month");<br />

break;<br />

case 8 :<br />

trace("September");<br />

break;<br />

default :<br />

trace("some other month");<br />

}<br />

See also<br />

break statement<br />

class statement<br />

[dynamic] class className [ extends superClass ] [ implements<br />

interfaceName[, interfaceName... ] ] { // class definition here}<br />

Defines a custom class, which lets you instantiate objects that share methods <strong>and</strong> properties<br />

that you define. For example, if you are developing an invoice-tracking system, you could<br />

create an invoice class that defines all the methods <strong>and</strong> properties that each invoice should<br />

have. You would then use the new invoice() comm<strong>and</strong> to create invoice objects.<br />

Statements 169

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!