Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Moving an object diagonally

Explorer ,
Jul 20, 2008 Jul 20, 2008
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
TOPICS
ActionScript
7.1K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jul 20, 2008 Jul 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
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 20, 2008 Jul 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.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jul 20, 2008 Jul 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
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 20, 2008 Jul 20, 2008
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jul 20, 2008 Jul 20, 2008
You don't have your diagonal line at 50º as Flash would transform it. How did you calculate the angle of the movie clip? If you draw a line that's perfectly horizontal, then in the Transform window of Flash set its rotation to 50º, you'll see it's a different angle than yours. Here's the FLA with the adjusted angle.

TS
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 20, 2008 Jul 20, 2008
Thanks for all your help, that looks great. I brought over some artwork from illustrator..... and I think that was rotated originally starting at 90º..... hence the 10º or so difference. have a good day
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jul 20, 2008 Jul 20, 2008
LATEST
No problem.

TS
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines