2 Replies Latest reply on May 4, 2006 4:41 AM by Newsgroup_User

    move a circle from one place to other with a desired speed

    Level 7
      My motive is to move a circle from one place to other with a desired speed.
      For that what should I do.

      Thanks
      rajakvk


        • 1. Re: move a circle from one place to other with a desired speed
          sneakyimp Level 2
          suppose that you have put your circle into a movie all by itself. suppose further that the circle is perfectly centered in the movie it lives in and that movie is on your stage with instance name myCircle and its xposition is 5.

          put this actionscript in your main movie

          var circleSpeed:Number = 10;
          var destX:Number = 400;
          this.onEnterFrame = function() {
          myCircle._x += circleSpeed;
          if (myCircle._x >= destX ) {
          delete this.onEnterFrame;
          }
          }
          • 2. Re: move a circle from one place to other with a desired speed
            Level 7
            Thanks for that post.

            I am new to actionscript & actually I am developing my first simple game in
            flash. For that I need a function like pauseMovie(seconds). I am planning to
            call this function within another function. Also I expect this function
            pauseMovie(seconds) should use system clock to calculate the time delay.

            thanks
            rajakvk

            "sneakyimp" <webforumsuser@macromedia.com> wrote in message
            news:e3c92l$1ni$1@forums.macromedia.com...
            > suppose that you have put your circle into a movie all by itself. suppose
            > further that the circle is perfectly centered in the movie it lives in and
            > that
            > movie is on your stage with instance name myCircle and its xposition is 5.
            >
            > put this actionscript in your main movie
            >
            > var circleSpeed:Number = 10;
            > var destX:Number = 400;
            > this.onEnterFrame = function() {
            > myCircle._x += circleSpeed;
            > if (myCircle._x >= destX ) {
            > delete this.onEnterFrame;
            > }
            > }
            >
            >