I did some tests here with one rectangle and I think it is related to the mc origin point

When one tween scales it, it grows from its left upper corner but the another tween "doesn´t know" about the changes and make the movement based on the original position.

So you have to use onMotionChanged to get each ._width after each scale and then center at the same time

João Carlos

function moveAndScaling (activeState:MovieClip)
{
// move it to the center of the stage.
var myTweenX:Tween = new Tween (activeState, "_xscale", Regular.easeOut, activeState._xscale, 200, 2, true); var myTweenY:Tween = new Tween (activeState, "_yscale", Regular.easeOut, activeState._yscale, 200, 2, true);
//

myTweenX.onMotionChanged = function ()
{

 var nX:Number = (Stage.width / 2) - activeState._width / 2;
 var nY:Number = (Stage.height / 2) - activeState._height / 2;

 activeState._x = nX;
 activeState._y = nY;
};
}


----- Original Message ----- From: "Merrill, Jason" <[EMAIL PROTECTED]>
To: "Flashcoders mailing list" <flashcoders@chattyfig.figleaf.com>
Sent: Wednesday, August 02, 2006 12:09 PM
Subject: RE: [Flashcoders] tweening multiple properties simultaneously


Haven't followed the thread close, but maybe wrap it up in a static
class like this - call your custom function which has all the tweens
combined.  This is what I do, works for me.  Something like this:

//file Animate.as in actionscriptclasspath/com/boa/effects/

import mx.transitions.Tween;
import mx.transitions.easing.*;

class com.boa.effects.Animate{
  public static function myFade(clip:MovieClip, time:Number,
xscale:Number, yscale:Number):Array{
     var a:Object = new Tween(clip, "_alpha", Regular.easeIn, 0, 100,
time, true);
     var b:Object = new Tween(clip, "_xscale", Regular.easeIn, xscale,
100, time, true);
     var c:Object = new Tween(clip, "_yscale", Regular.easeIn, yscale,
100, time, true);
     //returnArray is just an array of the tweens
     //so you can check to see if they are done:
     var returnArray:Array = new Array(a,b,c)
     return returnArray;
     }
}


//.fla and/or other class usage:

import.com.boa.effects.Animate;
Animate.myFade(myClip, .5, 50, 50)


Jason Merrill
Bank of America
Learning & Organization Effectiveness - Technology Solutions




_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to