简体   繁体   中英

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 . You'll want to make sure that your image is placed in a container with a 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});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM