[英]Flex Mobile Animation Using left property
I need helping in creating a simple animation for my app that moves an image left from where it's current position is, for a given distance, say a user decided to move it a given distance through a textfield or something similar. 我需要为我的应用程序创建一个简单的动画,该动画可以将图像从当前位置向左移动给定距离,例如,用户决定通过文本框或类似内容将图像移动给定距离。 Simply put, I have no way of telling where the image will be placed when it needs to be moved but it needs to move left for a distance that I guess I'll be able to define once I get it moving left. 简而言之,我无法确定何时需要移动图像,但它需要向左移动一段距离,我猜一旦它可以向左移动就可以定义该距离。
Any assitance you can offer will be greatly appreciated. 您可以提供的任何协助将不胜感激。
Take a look at GreenSock Animation Platform . 看一下GreenSock动画平台 。 You'll want to make sure that your image is placed in a container with a BasicLayout
. 您需要确保将图像放置在具有BasicLayout
的容器中。
Then all you have to do is: 然后,您要做的就是:
var newX:int = myObject.x - parseInt(myTextArea.text);
var duration:int = 1; //1 second
TweenLite.to(myObject, duration, {x:newX});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.