Copy link to clipboard
Copied
Hi,
I need help solving this. I have a symbol that i want to move 1920 pixels to the right when i click a button. I can do this using "Move horizontally". but this will send the symbol directly. I want it to move as an animation.
Using the "animate horizontally" snipet, moves the symbol but using a speed, not distance.
any help would be appreciated.
thanks!
Thanks.
For this case, you can use a Tween.
Just replace the code that you have in your file:
import fl.motion.easing.*;
import fl.transitions.Tween;
var tween:Tween;
go.addEventListener(MouseEvent.CLICK, fl_ClickToPosition);
function fl_ClickToPosition(event:MouseEvent):void
{
tween = new Tween(movedor, "x", Back.easeInOut, movedor.x, 655.4, 1, true);
}
back.addEventListener(MouseEvent.CLICK, fl_ClickToPosition2);
function fl_ClickToPosition2(event:MouseEvent):void
{
tween = new Twee
...
Copy link to clipboard
Copied
Hi.
You can use a tween to animate the symbol instance and then set a button to play this timeline on click.
Or can't you use timelines?
Please let us know.
Regards,
JC
Copy link to clipboard
Copied
Hi Joao, I prefer not to use timeline,
here an example of what i want to do, here i have atwo button that nmove a symbol right and left. I would like to object to animate to te next possition, not to jump the 600 pixels...
Copy link to clipboard
Copied
OK. No problem.
Did you try to attach some file? There isn't any in your comment.
If it's an FLA, you're gonna have to upload it to a file sharing service (e.g.: Creative Cloud, Google Drive, Dropbox, WeTransfer...) and paste the link to the file here.
Copy link to clipboard
Copied
yes didnt allow me to upload the .fla file.
here via wt:
Copy link to clipboard
Copied
Thanks.
For this case, you can use a Tween.
Just replace the code that you have in your file:
import fl.motion.easing.*;
import fl.transitions.Tween;
var tween:Tween;
go.addEventListener(MouseEvent.CLICK, fl_ClickToPosition);
function fl_ClickToPosition(event:MouseEvent):void
{
tween = new Tween(movedor, "x", Back.easeInOut, movedor.x, 655.4, 1, true);
}
back.addEventListener(MouseEvent.CLICK, fl_ClickToPosition2);
function fl_ClickToPosition2(event:MouseEvent):void
{
tween = new Tween(movedor, "x", Back.easeInOut, movedor.x, 55.4, 1, true);
}
Regards,
JC
Copy link to clipboard
Copied
Thanks Joao, this is perfect.!
Copy link to clipboard
Copied
Awesome! You're welcome!