Hi guys.
I have been using the mx.effects tween a bit lately, its handy for tweening multiple properties. Say you mant a mc to fly in from off stage on an angle, fading in at the same time. You would need 3 Tween instances if using mx.transitions.Tween
Example using mx.transitions.Tween:
ActionScript Code:
import mx.transitions.easing.*;;
import mx.transitions.Tween;
new Tween(myMC, '_x', Strong.easeOut, 0, 600, 30);
new Tween(myMC, '_y', Strong.easeOut, 0, 300, 30);
new Tween(myMC, '_alpha', Strong.easeOut, 0, 100, 30);
This does the same thing but uses mx.effects.Tween:
ActionScript Code:
import mx.transitions.easing.*;;
import mx.effects.Tween;
var tw = new Tween(myMC, [0, 0, 0], [600, 300, 100], 1000);
tw.easingEquation = mx.transitions.easing.Strong.easeOut;
myMC.onTweenUpdate = function(p_arg){
_x = p_arg[0];
_y = p_arg[1];
_alpha = p_arg[2];
}
Not any less code, but it only executes the easing equation once per update cycle.
Anyway, I find that with the effects tween it often falters when it starts, ie: the movieclip is drawn before the tween gets to it. and so a fade in begins with the mc flashing in at 100% alpha, followed by a fade in. Perhaps it is because this Tween class is time based rather than frame based. I notice the Transition subclasses ( Wipe, Fly, Fade etc) have the same issue when used with movieclips, havn't tried them with screens, which is what they are designed for though.
Anyone else encountered this?
Is it a general issue with time based animation?
Anyone got the effects.Tween class workin with frames instead?
might have to look into it, I don't really like using time based animation.
< :