i've just started actionscript-ing and I encountered problems about tween... Basically, i want my object to fade out in 5 seconds...
here's my code :
import flash.display.Sprite;
import fl.transitions.Tween;
import fl.transitions.easing.*;
import fl.transitions.TweenEvent;
import flash.text.TextField;
import flash.events.MouseEvent;
var object:Sprite = new Sprite();
object.graphics.beginFill(0xff00ff);
object.graphics.drawRoundRect(200, 200, 100, 75, 10, 10);
var button:TextField = new TextField();
button.x = 10;
button.y = 10;
button.width = 125;
button.height = 25;
button.text = "Click here to Animate";
button.border = true;
addChild (button);
addChild (object);
button.addEventListener(MouseEvent.CLICK, animate);
function animate (e : MouseEvent)
{
var myTween:Tween = new Tween(object, "alpha", None.easeIn, 1, 0, 5, true);
}
When i started the movie clip and clicked the textfield, it somehow won't animate... can anyone point out the mistake??? THX b4...