I'm trying to shape tween a movie clip of a rocket blasting off. I want it to "squash" before liftoff, and then "stretch" as it lifts off.
When I tween this on the timeline with the transform tool, I can "squash" the rocket, and the base of the rocket stays on the "ground". This is what I want. However, for reasons I won't go into, I need to do this in AS3, as opposed to on the timeline. When I use a "height" tween, though, the movieclip height changes, but it shrinks/stretches at the bottom (locked at the top).
Is it possible to do what I want with the tween class? Do I need to use something besides "height"?
Should I use a transform matrix, instead? If I use a transform matrix, can I tween it? (I don't have very much experience with transform matricies.)
Here's the tween I'm using for the stretch:
var tweenPlayer1:Tween = new Tween(mc_player, "height", Strong.easeOut, mc_player.height, mc_player.height+100, 2, true);
There probably is a better way to handle startingYandHeight but this will work for you
import fl.transitions.Tween;
import fl.transitions.easing.*;
import fl.transitions.TweenEvent;
var startingYandHeight:Number = mc_player.y + mc_player.height;
var myTween:Tween = new Tween(mc_player, "height", Strong.easeOut, mc_player.height, mc_player.height + 100, 2, true);
myTween.addEventListener( TweenEvent.MOTION_CHANGE, onChange);
function onChange( e:TweenEvent ):void{
mc_player.y = startingYandHeight - mc_player.height;
}