Adobe FLEX 2 - CREATING AND EXTENDING COMPONENTS Manual page 250

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

Advertisement

Overriding the initEffect() method
The EffectInstance class defines the
custom effect. This method has the following signature:
public initEffect(event:Event):void
where
is the
Event
event
For example, a user might create an instance of an effect, but not provide all of the
configuration information that is required to play the effect. Although you might be able to
assign default values to all properties within the definition of the effect class, in some cases you
might have to determine the default values at run time.
In this method, you can examine the
run time. For more information on how to create a custom event and an effect trigger, see
"Defining a custom effect trigger" on page
properties to the
vent object passed to the
E
that
vent object, and its additional properties, from the
E
By overriding the
initEffect()
Event object to reference the target component of the effect. For example, if you must
determine the current x and y coordinates of the component, or its current height and width,
you can access them from your override of the
250
Creating Effects
initEffect()
object dispatched by the event that triggered the effect.
vent object and the effect target to calculate values at
E
247. As part of that example, you can add
dispatchEvent()
method, you can also access the
method that you can override in your
method. You can then access
initEffect()
target
method.
initEffect()
method.
property of the

Advertisement

Table of Contents
loading

Table of Contents