Adobe FLEX 2 - CREATING AND EXTENDING COMPONENTS Manual page 244

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

Advertisement

RotationTransInstance(inst).angleTo = angleTo;
}
}
}
In the RotationTransInstance.as class, you modify the
values for the
angleFrom
actions:
Determines whether the user set values for the
1.
If not, determines whether the
2.
initialized with start and end values. If so, the method uses those values to configure the
effect.
If not, sets the
3.
angleFrom
property, and 360 for the
angleFrom
The following example shows the RotationTransInstance.as class:
package myEffects
{
// myEffects/RotationTransInstance.as
import mx.effects.effectClasses.TweenEffectInstance;
import mx.effects.Tween;
public class RotationTransInstance extends TweenEffectInstance
{
// Define parameters for the effect.
public var angleFrom:Number;
public var angleTo:Number;
public function RotationTransInstance(targetObj:Object) {
super(targetObj);
}
// Override play() method class.
override public function play():void {
// All classes must call super.play().
super.play();
// Check whether angleFrom is set.
if (isNaN(angleFrom))
{
// If not, look in propertyChanges.start for a value.
// Otherwise, set it to 0.
angleFrom = (propertyChanges.start["rotation"] != undefined) ?
}
244
Creating Effects
and
properties. This method performs the following
angleTo
Effectinstance.propertyChanges
and
properties to the default values of 0 for the
angleTo
angleTo
propertyChanges.start["rotation"] : 0;
method to calculate the default
play()
and
angleFrom
angleTo
property.
properties.
property was

Advertisement

Table of Contents
loading

Table of Contents