User Guide

Using ActionScript 33
Flex creates an Array called rest for the optional arguments. Therefore, you can determine
the number of arguments passed to the method by using
rest.length, and access the
arguments by using
rest[i].
Using the super keyword in a method override
You use the super keyword in a method override to invoke the corresponding method of the
superclass. The
super keyword has the following syntax:
super.methodName([arg1, ..., argN])
This technique is useful when you create a subclass method that adds behavior to a superclass
method but also invokes the superclass method to perform its original behavior.
Whether you call
super.myMethod() within a method override depends on your application
requirement, as follows:
Typically, you extend the existing functionality of the superclass method, so the most
common pattern is to call
super.myMethod() first in your method override, and then add
your logic.
You might need to change something before the superclass method does its work. In this
case, you might call
super.myMethod() in the override after your logic.
In some method overrides, you might not want to invoke the superclass method at all.
Only call
super.myMethod() if and when you want the superclass to do its work.
Sometimes the superclass has an empty method that does nothing, which requires you to
implement the functionality in the method. In this case, you should still call
super.myMethod() because in a future version of Flex, that method might implement
some functionality. For more information, see the documentation on each Flex class.
NOTE
Although Flex automatically calls the super() method in a constructor to execute the
superclass’s constructor, you must call
super.methodName() in a method override.
Otherwise, the superclass’s version of the method does not execute.