
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
142
|
Chapter 5: Operators
where methodName is some method of the superclass and arg1,...argn is a list of
arguments passed to that method. Within the method, the
this keyword points to
the object whose class or method invoked the superclass method. Used in this man-
ner, the super operator is functionally equivalent to the following rather unwieldy
statement:
this.constructor.prototype.__proto__.constructor.apply(this, arguments);
For practical examples showing super in use, see “Making a Class” and “Accessing
overridden methods” in Chapter 12.
Note that super is not technically an operator. Rather, it is an identifier made avail-
able only during function execution, much like the
arguments object. ActionScript’s
super is not an implementation of ECMAScript v4’s super operator. Nevertheless, for
the sake of discussion, both Macromedia’s ActionScript Dictionary and this book cat-
egorize super with other operators.
The Function Call Operator
As we’ve seen with the trace() function and the string-manipulation functions, we
use the function call operator,
(), to invoke a function. A function call takes the gen-
eral form:
function_name(argument_list)
The first operand, function_name, is the name of some function and must be an iden-
tifier, not an expression. If the function does not exist, the ...