2 Replies Latest reply on Aug 22, 2007 6:42 AM by fanglinyong

    the move proplem

    fanglinyong
      hello, when i see the 《Flash8 actionscrtip bible》, some code i din't understand, like this , how can i use the as to move a mc(a ball,instance name is "circle") round a circle, the circlel's radius is 100, when i run the code, the code :degree ++, but the degree value not change, it's always displayed 1,
      the code like this, thanks very much!
        • 1. Re: the move proplem
          GOPAL_GAUTAM
          hi fanglinyong,

          Please variable should be write in 3 rd line.Code should be....................
          ..............................
          circle._x = 275;
          circle._y = 200;
          var degree:Number = 0;
          function moveToCircle()
          {
          //this.attachMovie("circle", "ball_mc", 0);
          var radius:Number = 100;

          var angle = degree*Math.PI/180;
          var cx:Number = radius*Math.sin(angle);
          var cy:Number = radius*Math.cos(angle);
          circle._x = cx;
          circle._y = cy;
          degree += 1;
          updateAfterEvent();
          trace(angle);
          // when i run this code, the degree din't change, its value is always 1;
          }
          setInterval(moveToCircle, 10);
          • 2. Re: the move proplem
            fanglinyong Level 1
            ye, thanks very much!
            studying......