2 Replies Latest reply on Sep 2, 2006 4:51 AM by Typhoon 101

    Random Flying Image

    Typhoon 101
      Hi. I am trying to build something that hopefully is relatively simple. I need an object to fly across the screen at regular intervals. The object must have a random start and finish point, but can travel in a straight line. The idea is to simulate a bird flying across the page.

      Is anyone able to help?

      Thanks
        • 1. Re: Random Flying Image
          2m Level 2
          I'm not Einstein, but as far as I understand him everyting is relatively simple ;-)

          here are the steps I would use:

          find a random star and end point (using math:random()) (dont forget to make sure you generate useful values)

          then you need to get the difference between start x and end x (=DeltaX) and also DeltaY;

          devide these values through the number of steps you want to animate (equals speed)

          and ad DeltaX/steps and DeltaY/steps onEnterFrame for step times.

          That's it.

          More or less at least.
          • 2. Re: Random Flying Image
            Typhoon 101 Level 1
            Thanks for the advice 2m. However, one thing i failed to mention is i am a bit of a newbie with AS. The logics sound great, but i have no idea how to put it into practice. Can you help?