Adobe FLEX 2 - CREATING AND EXTENDING COMPONENTS Manual page 33

Creating and extending flex 2 components
Hide thumbs Also See for FLEX 2 - CREATING AND EXTENDING COMPONENTS:
Table of Contents

Advertisement

Flex creates an Array called
the number of arguments passed to the method by using
arguments by using
rest[i]
Using the super keyword in a method override
You use the
keyword in a method override to invoke the corresponding method of the
super
superclass. The
super
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.
Although Flex automatically calls the
superclass's constructor, you must call
Otherwise, the superclass's version of the method does not execute.
Whether you call
super.myMethod()
requirement, as follows:
Typically, you extend the existing functionality of the superclass method, so the most
common pattern is to call
your logic.
You might need to change something before the superclass method does its work. In this
case, you might call
In some method overrides, you might not want to invoke the superclass method at all.
Only call
super.myMethod()
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()
some functionality. For more information, see the documentation on each Flex class.
for the optional arguments. Therefore, you can determine
rest
.
keyword has the following syntax:
super()
within a method override depends on your application
super.myMethod()
super.myMethod()
if and when you want the superclass to do its work.
because in a future version of Flex, that method might implement
rest.length
method in a constructor to execute the
in a method override.
super.methodName()
first in your method override, and then add
in the override after your logic.
, and access the
Using ActionScript
33

Advertisement

Table of Contents
loading

Table of Contents