Effects
by jlagunas on Dec.17, 2008, under Actionscript
Using the Fade effect class via Actionscript. The same thing can be done with the other effects such as Move.
import mx.effects.Fade;
import mx.effects.Move;
import mx.effects.easing.Cubic;
public function FadeEffect(target:Object, duration:Number, delay:Number, alphaFrom:Number, alphaTo:Number):void
{
var fadeEffect:Fade = new Fade();
fadeEffect.end();
fadeEffect.target = target;
fadeEffect.duration = duration;
fadeEffect.startDelay = delay;
fadeEffect.easingFunction = Cubic.easeInOut;
fadeEffect.alphaFrom = alphaFrom;
fadeEffect.alphaTo = alphaTo;
fadeEffect.play();
}
public function MoveEffect(target:Object, duration:Number, delay:Number, xStart:Number, xEnd:Number, yStart:Number, yEnd:Number):void
{
var moveEffect:Move = new Move();
moveEffect.end();
moveEffect.target = target;
moveEffect.duration = duration;
moveEffect.startDelay = delay;
moveEffect.easingFunction = Cubic.easeInOut;
moveEffect.xFrom = xStart;
moveEffect.xTo = xEnd;
moveEffect.yFrom = yStart;
moveEffect.yTo = yEnd;
moveEffect.play();
}
1 comment for this entry:

December 18th, 2008 on 6:42 pm
[...] jlagunas on Dec.18, 2008, under Actionscript Here’s an example of the effects code from a previous post. It moves the flex icon from the top left to the bottom right and then [...]