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.

continue;<br />

}<br />

trace(i);<br />

}<br />

See also<br />

do..while statement<br />

default statement<br />

default: statements<br />

Defines the default case for a switch statement. The statements execute if the expression<br />

parameter of the switch statement doesn't equal (using the strict equality [===] operation)<br />

any of the expression parameters that follow the case keywords for a given switch<br />

statement.<br />

A switch is not required to have a default case statement. A default case statement does<br />

not have to be last in the list. If you use a default statement outside a switch statement, it<br />

produces an error <strong>and</strong> the script doesn't compile.<br />

Parameters<br />

statements:String - Any statements.<br />

Example<br />

In the following example, the expression A does not equal the expressions B or D, so the<br />

statement following the default keyword is run <strong>and</strong> the trace() statement is sent to the<br />

Output panel.<br />

var dayOfWeek:Number = new Date().getDay();<br />

switch (dayOfWeek) {<br />

case 1 :<br />

trace("Monday");<br />

break;<br />

case 2 :<br />

trace("Tuesday");<br />

break;<br />

case 3 :<br />

trace("Wednesday");<br />

break;<br />

case 4 :<br />

trace("Thursday");<br />

break;<br />

case 5 :<br />

trace("Friday");<br />

break;<br />

Statements 173

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

Saved successfully!

Ooh no, something went wrong!