Link to home
Start Free TrialLog in
Avatar of worked
workedFlag for United States of America

asked on

Using fl.transitions.tween while updating begin and finish locations?

Hey there- How do I use the tween class and at the same time update the "begin" and "finish" properties so that motion continues each time a button is pressed. For example if I replaced the "begin" and "finish" properties with the following:
var containerObj:Sprite = new Sprite();
containerObj.x = 0;
containerObj.y = 0
 
var btn:Sprite = new Sprite();
btn.x = 0;
btn.y = 10;
 
btn.addEventListener(MouseEvent.CLICK, clickBtn);
 
var begin:Number = containerObj.x;
var finish:Number;
 
private function clickBtn(evt:MouseEvent):void {
    var myTween:Tween = new Tween(containerObj,"x",Strong.easeOut,begin,finish,1,true);
}

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Eaddy Barnes
Eaddy Barnes
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of worked

ASKER

Excellent! Thanks!