Skip to main content
Inspiring
July 20, 2008
Question

Moving an object diagonally

  • July 20, 2008
  • 1 reply
  • 6962 views
I'm trying to move an object diagnally (using x and y increments).
I know it would be easy to do this with an object traveling in a straight path on a 45 degree angle, but I am using another angle. The angle i need the object to move is 50 degrees.

Here is a graphic of what i'm looking to achieve
This topic has been closed for replies.

1 reply

Inspiring
July 20, 2008
This code will move an object continuously between the bounds of the stage at the angle you specified (50 degrees from top of stage).

TS
_Vee_Author
Inspiring
July 20, 2008
Thanks. Thats almost right. They x and the y are not moving proportionately. You can see the diag. line move up and down too much in the y direction. Im looking for the line to travel only at that 50º angle/as though its stuck on a traintrack, if that makes sense.

FYI: my movieclip (diagLine_mc) is already at the 50º angle in my library.
Inspiring
July 20, 2008
Post your code or the FLA. I just ran a test and that code should work just fine, meaning making the line appear that it's running on a track at the same angle as the line.

TS