Adobe InDesign CS5 (7.0) Object Model JS: Function

InDesign CS5

Class

Function

 Wraps a built-in or JavaScript function.

QuickLinks

Function, apply, call, toSource, toString

Properties

PropertyTypeAccessDescription
argumentsObject r/wThe function arguments, packed into an array.
This property is deprecated; use the arguments property within the function body.
aritynumber readonlyThe number of formal arguments.
This property is deprecated; use the length property instead.
lengthnumber readonlyThe number of formal arguments.
namestring readonlyThe function name.

Methods

Constructor

Function Function (arguments: string, body: string) The Function constructor parses the argument list and creates a Function object.

ParameterTypeDescription
argumentsstringThe list of formal arguments, separated by commas.
The formal arguments can also be supplied one by one; in this case, the last argument to the Function constructor is considered to be the function body.
bodystringThe body of the function to create.

Instances

any apply (thisObj: Object, args: Array)
Apply a this object and an argument list to a function.
This function is different from call(); here, the arguments are suppliedas an Array object.

ParameterTypeDescription
thisObjObject The object to be used as this.
argsArrayAn array of arguments.

any call (thisObj: Object, argument: any)
Apply a this object and arguments to a function.
This function is different from apply(); here, the arguments are supplied one by one.

ParameterTypeDescription
thisObjObject The object to be used as this.
argument any The first agument to the function. Add as many as needed.

string toSource ()
Creates a string representation of this object that can be fed back to eval() to re-create an object. Works only with JavaScript functions.

string toString ()
Returns the function definition as a string.

Element of

EventListener.handler

Object.constructor

Used in:

void Array.sort (userFunction: Function)

Boolean Button.addEventListener (eventName: String, handler: Function[, capturePhase: Boolean=false])

Boolean Button.removeEventListener (eventName: String, handler: Function[, capturePhase: Boolean=false])

Boolean Checkbox.addEventListener (eventName: String, handler: Function[, capturePhase: Boolean=false])

Boolean Checkbox.removeEventListener (eventName: String, handler: Function[, capturePhase: Boolean=false])

Boolean DropDownList.addEventListener (eventName: String, handler: Function[, capturePhase: Boolean=false])

Boolean DropDownList.removeEventListener (eventName: String, handler: Function[, capturePhase: Boolean=false])

Boolean EditText.addEventListener (eventName: String, handler: Function[, capturePhase: Boolean=false])

Boolean EditText.removeEventListener (eventName: String, handler: Function[, capturePhase: Boolean=false])

Boolean FlashPlayer.addEventListener (eventName: String, handler: Function[, capturePhase: Boolean=false])

Boolean FlashPlayer.removeEventListener (eventName: String, handler: Function[, capturePhase: Boolean=false])

Boolean Group.addEventListener (eventName: String, handler: Function[, capturePhase: Boolean=false])

Boolean Group.removeEventListener (eventName: String, handler: Function[, capturePhase: Boolean=false])

Boolean IconButton.addEventListener (eventName: String, handler: Function[, capturePhase: Boolean=false])

Boolean IconButton.removeEventListener (eventName: String, handler: Function[, capturePhase: Boolean=false])

Boolean ListBox.addEventListener (eventName: String, handler: Function[, capturePhase: Boolean=false])

Boolean ListBox.removeEventListener (eventName: String, handler: Function[, capturePhase: Boolean=false])

void Object.watch (name: string, func: Function)

Boolean Panel.addEventListener (eventName: String, handler: Function[, capturePhase: Boolean=false])

Boolean Panel.removeEventListener (eventName: String, handler: Function[, capturePhase: Boolean=false])

Boolean Progressbar.addEventListener (eventName: String, handler: Function[, capturePhase: Boolean=false])

Boolean Progressbar.removeEventListener (eventName: String, handler: Function[, capturePhase: Boolean=false])

Boolean RadioButton.addEventListener (eventName: String, handler: Function[, capturePhase: Boolean=false])

Boolean RadioButton.removeEventListener (eventName: String, handler: Function[, capturePhase: Boolean=false])

Boolean Scrollbar.addEventListener (eventName: String, handler: Function[, capturePhase: Boolean=false])

Boolean Scrollbar.removeEventListener (eventName: String, handler: Function[, capturePhase: Boolean=false])

Boolean Slider.addEventListener (eventName: String, handler: Function[, capturePhase: Boolean=false])

Boolean Slider.removeEventListener (eventName: String, handler: Function[, capturePhase: Boolean=false])

Boolean StaticText.addEventListener (eventName: String, handler: Function[, capturePhase: Boolean=false])

Boolean StaticText.removeEventListener (eventName: String, handler: Function[, capturePhase: Boolean=false])

Boolean TreeView.addEventListener (eventName: String, handler: Function[, capturePhase: Boolean=false])

Boolean TreeView.removeEventListener (eventName: String, handler: Function[, capturePhase: Boolean=false])

Boolean Window.addEventListener (eventName: String, handler: Function[, capturePhase: Boolean=false])

Boolean Window.removeEventListener (eventName: String, handler: Function[, capturePhase: Boolean=false])

Return

Function Function.Function (arguments: string, body: string)

Jongware, 20-Jun-2010 v3.0.3dContents :: Index