We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you a podcast all about Citrix Workspace, moving to the cloud, and analytics & intelligence. Episode 2 coming soon!Listen Now

x

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

worked
worked asked
on
Medium Priority
275 Views
Last Modified: 2013-11-11
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

Comment
Watch Question

try it with these edits and let me know if hats what you meant.
if not please add a few details do your question

GE

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 = 0;
 
private function clickBtn(evt:MouseEvent):void {
	begin = containerObj.x;
	finish = (containerObj.x + 30);
    var myTween:Tween = new Tween(containerObj,"x",Strong.easeOut,begin,finish,1,true);
}

Open in new window

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Author

Commented:
Excellent! Thanks!
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.