Macromedia flex 2 Manual
About tween effects
237
You can now pass the URL of an MP3 to the effect, as the following example shows:
<?xml version="1.0"?>
<!-- effects/MainSoundEffectParam.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:MyComps="myEffects.*">
<!-- effects/MainSoundEffectParam.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:MyComps="myEffects.*">
<MyComps:MySoundParam id="mySoundEffect"
soundMP3="http://localhost:8100/flex/assets/sample.mp3"/>
soundMP3="http://localhost:8100/flex/assets/sample.mp3"/>
<!-- Use the SoundEffect effect with a mouseOver trigger. -->
<mx:Label text="play MP3" rollOverEffect="mySoundEffect"/>
</mx:Application>
<mx:Label text="play MP3" rollOverEffect="mySoundEffect"/>
</mx:Application>
About tween effects
Most Flex effects are implemented by using the tweening mechanism, where a tween defines a
transition performed on a target object over a period of time. That transition could be a
change in size, such as the
transition performed on a target object over a period of time. That transition could be a
change in size, such as the
Zoom
or
Resize
effects perform; a change in visibility, as the Fade
or Dissolve effects perform; or other types of transition.
You use the following classes to implement a tween effect:
mx.effects.Tween
A class used to implement tween effects. A Tween object accepts a start
value, an end value, and an optional easing function. When you define tween effect classes,
you create an instance of the Tween class in your override of the
you create an instance of the Tween class in your override of the
Effect.play()
method.
The Tween object invokes the
mx.effects.TweenEffect.onTweenUpdate()
callback
method on a regular interval, passing the callback method an interpolated value between the
start and end values. Typically, the callback method updates some property of the target
component, causing that component’s property to animate over time. For example, the Move
effect modifies the
start and end values. Typically, the callback method updates some property of the target
component, causing that component’s property to animate over time. For example, the Move
effect modifies the
x
and
y
properties of the target component for the duration of the effect to
show an animated movement.
When the effect ends, the Tween object invokes the
mx.effects.TweenEffect.onTweenEnd()
callback method. This method performs any final
processing before the effect terminates. You must call
super.onTweenEnd()
from your
override.
mx.effects.TweenEffect
The base factory class for all tween effects. This class encapsulates
methods and properties that are common among all Tween-based effects.
mx.effects.effectClasses.TweenEffectInstance
The instance class for all tween effects.