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.

Use the elseif statement to create branching logic in your scripts. If there are multiple<br />

branches, you should consider using a switch statement.<br />

Parameters<br />

condition:Boolean - An expression that evaluates to true or false.<br />

Example<br />

The following example uses else if statements to compare score_txtto a specified value:<br />

if (score_txt.text>90) { trace("A"); } else if (score_txt.text>75) {<br />

trace("B"); } else if (score_txt.text>60) { trace("C"); } else {<br />

trace("F"); }<br />

See also<br />

ifFrameLoaded function<br />

extends statement<br />

Usage 1:<br />

class className extends otherClassName {}<br />

Usage 2:<br />

interface interfaceName extends otherInterfaceName {}<br />

Note: To use this keyword, you must specify ActionScript 2.0 <strong>and</strong> Flash Player 6 or later in<br />

the Flash tab of your FLA file's Publish Settings dialog box. This keyword is supported only<br />

when used in external script files, not in scripts written in the Actions panel.<br />

Defines a class that is a subclass of another class; the latter is the superclass. The subclass<br />

inherits all the methods, properties, functions, <strong>and</strong> so on that are defined in the superclass.<br />

Interfaces can also be extended using the extends keyword. An interface that extends another<br />

interface includes all the original interface's method declarations.<br />

Parameters<br />

className:String - The name of the class you are defining.<br />

Example<br />

In the following example, the Car class extends the Vehicle class so that all its methods,<br />

properties, <strong>and</strong> functions are inherited. If your script instantiates a Car object, methods from<br />

both the Car class <strong>and</strong> the Vehicle class can be used.<br />

The following example shows the contents of a file called Vehicle.as, which defines the Vehicle<br />

class:<br />

Statements 179

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

Saved successfully!

Ooh no, something went wrong!