MACROMEDIA FLEX-FLEX ACTIONSCRIPT LANGUAGE Reference page 163

Actionscript language reference
Table of Contents

Advertisement

function
Availability
Flash Player 5.
Usage
function functionname ([parameter0, parameter1,...parameterN]){
statement(s)
}
function ([parameter0, parameter1,...parameterN]){
statement(s)
}
Parameters
functionname
An identifier that represents a parameter to pass to the function. This parameter is
parameter
optional.
statement(s)
Returns
Usage 1: Nothing.
Usage 2: A reference to the anonymous function.
Description
Statement; comprises a set of statements that you define to perform a certain task. You can define
a function in one location and invoke, or call, it from different scripts in a SWF file. When you
define a function, you can also specify parameters for the function. Parameters are placeholders
for values on which the function operates. You can pass different parameters to a function each
time you call it so you can reuse a function in different situations.
Use the
statement in a function's
return
a value.
You can use this statement to define a
and
statement(s)
executed. Forward referencing is permitted; within the same script, a function may be declared
after it is called. A function definition replaces any prior definition of the same function. You can
use this syntax wherever a statement is permitted.
You can also use this statement to create an anonymous function and return a reference to it. This
syntax is used in expressions and is particularly useful for installing methods in objects.
For additional functionality, you can use the
Some common uses of the
number of parameters and creating a recursive anonymous function.
ActionScript Core Language Elements
The name of the new function. This parameter is optional.
Any ActionScript instruction you have defined for the body of the
function
. When a script calls a function, the statements in the function's definition are
arguments object
to cause a function to generate, or return,
statement(s)
with the specified
arguments object
are creating a function that accepts a variable
CHAPTER 5
function
,
functionname
parameters
in your function definition.
function
.
,
163

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLEX-FLEX ACTIONSCRIPT LANGUAGE and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flex

Table of Contents