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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Returns<br />

String - The evaluated expression parameter, if provided.<br />

Parameters<br />

expression - A string, number, Boolean, array, or object to evaluate <strong>and</strong> return as a value of<br />

the function. This parameter is optional.<br />

Example<br />

The following example uses the return statement inside the body of the sum() function to<br />

return the added value of the three parameters. The next line of code calls sum() <strong>and</strong> assigns<br />

the returned value to the variable newValue.<br />

function sum(a:Number, b:Number, c:Number):Number {<br />

return (a + b + c);<br />

}<br />

var newValue:Number = sum(4, 32, 78);<br />

trace(newValue); // output: 114<br />

See also<br />

Array function<br />

set statement<br />

function set property(varName) {<br />

// your statements here<br />

}<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 />

Permits implicit setting of properties associated with objects based on classes you have defined<br />

in external class files. Using implicit set methods lets you modify the value of an object's<br />

property without accessing the property directly. Implicit get/set methods are syntactic<br />

shorth<strong>and</strong> for the Object.addProperty() method in ActionScript 1.<br />

Parameters<br />

property:String - Word that refers to the property that set will access; this value must be<br />

the same as the value used in the corresponding get comm<strong>and</strong>.<br />

Statements 195

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

Saved successfully!

Ooh no, something went wrong!