Macromedia flex 2-migrating applications to flex 2 Manuel D’Utilisation

Page de 184
134
Behaviors
New events for effect classes
You can now associate event listeners with effects, rather than with effect targets. All effect 
classes now support the following event types:
effectStart
Dispatched when the effect starts playing. The 
type
 property of the event 
object for this event is set to 
EffectEvent.EFFECT_START
.
effectEnd
Dispatched after the effect stops playing, either when the effect finishes playing 
or when the effect has been interrupted by a call to the 
endEffect()
 method. The 
type
 
property of the event object for this event is set to 
EffectEvent.EFFECT_END
.
Every effect class that is a subclass of the TweenEffect class, such as the Fade and Move effects, 
supports the following events:
tweenStart
 Dispatched when the tween effect starts. The type property of the event object 
for this event is set to TweenEvent.TWEEN_START. 
tweenEnd
Dispatched when the tween effect ends. The 
type
 property of the event object 
for this event is set to 
TweenEvent.TWEEN_END
.
tweenUpdate
Dispatched every time a TweenEffect class calculates a new value. The 
type
 
property of the event object for this event is set to 
TweenEvent.TWEEN_UPDATE
.
Change to overriding the endEffect() method
You no longer have to call 
listener.onEffectEnd()
 in an override of the 
endEffect()
 
method. Now, the 
EffectInstance.endEffect()
 method calls the instance class’s 
endEffect()
 method, which calls the 
EffectInstance.finishEffect()
 method to 
dispatch the 
EffectEvent.END_EFFECT
 event and call 
listener.onEffectEnd()