[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

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

Posted on 2009-02-12
2
Medium Priority
?
265 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

0
Comment
Question by:worked
2 Comments
 
LVL 11

Accepted Solution

by:
Eaddy Barnes earned 1000 total points
ID: 23620849
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

0
 

Author Closing Comment

by:worked
ID: 31545981
Excellent! Thanks!
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I come across a lot of question about how to access things in the document class from a movieclip, or accessing something from a movieclip in the document class. It took me a while to figure this out but once I did it makes life so much easier. …
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
The goal of the tutorial is to teach the user how to how to record live broadcast.
Suggested Courses
Course of the Month19 days, 3 hours left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question