I am embarrassed to post this but have looked high and low and can't find an answer.
I simple want a sprite to grow from a small size to a large size while staying in the same place. Even in the simplest code, the sprite changes position through the tween. The different position seems to depend on whether scale is under 1, (e.g.: 0.4) or over 1. The sprite then moves to the final position. But the trace statements say the position is the same.
Also, the sprite won't scale up if the number is over 1; it will only scale down for number less than one. I must be doing something very basically wrong. Please help.
Flex Builder 4 code:
package
{
import com.greensock.*;
import com.greensock.data.*;
import com.greensock.easing.*;
import flash.display.MovieClip;
import flash.display.Sprite;
import flash.events.Event;
public class testtween extends Sprite
{
private var mySprite:Sprite;
public function testtween()
{
mySprite = new MovieClip();
mySprite.graphics.beginFill(0x0000ff);
mySprite.graphics.drawRect(200,200,30,30);
mySprite.graphics.endFill();
mySprite.addEventListener(Event.ADDED_TO_STAGE, doTween);
addChild(mySprite);
trace(mySprite.x + "beforeX");
trace(mySprite.width + "beforewidth");
}
public function doTween(e:Event):void
{
TweenLite.to(mySprite,1,{x:200,y:200,scaleX:.9, scaleY:.9});
//TweenLite.to(mySprite,5,new TweenLiteVars().prop("height",70,true).prop("x",0).onComplete(finish).ease(Linear.easeout));
}
public function finish():void
{
trace(mySprite.x + "afterX");
trace(mySprite.width + "afterwidth");
}
}
}