call function
Top  Previous  Next


SWiSH Player Support
SWF5 or later - Supported Internally

Syntax
object.function([parameter1, [parameter2, [parameter3, [parameter4]]]])

Arguments
object: Name of the Object / Sprite containing the function.
function: Name of the function being called.
parameter1: Optional input parameter.
parameter2: Optional input parameter.
parameter3: Optional input parameter.
parameter4: Optional input parameter.

Returns
Value defined by return Action.

Description
Allows you to call a user-defined function. Functions are useful when the same processing needs to be applied to different variables or Objects.

Sample
onLoad () {
    a = 0;
    r = 3;
    a = _root.area(r);
    trace(a);
}


function area(p) {
    return Math.PI * p * p;
}


// On completion, a contains the area for a radius of 3 (pi * r^2), 28.2743346691132


See Also
function