0 Replies Latest reply on Aug 13, 2006 5:26 PM by microes

    in rotation

    microes

      i.m trying to create a 3d rotation much like the widely used carousel only the rotation i desire consist of four upright( at 90 degrees) movieclips resting on a slanted, 30 degree plane which rotate (following a tween or way to bring the rotation on stage) on a oval like path - then pause for a given number of seconds(4 to 8 secs) at the same point in the rotation (the lower left corner or the rotation)
      i.m also attempting to bring easing into the rotation with the tween class that will eventually surround a graphic element
      i.m aiming to use four DIFFERENT looking movieclips (maybe with an looping array or ?) instead of the approach i.m using now (attaching mcs).

      var count:Number = 0;
      function around() {
      count++;
      if (count<180) {
      this._x = Math.cos(this.angle) * radiusX + centerX;
      this._y = Math.sin(this.angle) * radiusY + centerY;
      var s = (this._y - perspective) /(centerY+radiusY- perspective);
      this._y -= (this._x-(centerX-radiusX))/Math.sqrt(12);
      this._xscale = this._yscale = s*100;
      this.angle += this._parent.speed;
      this.swapDepths(Math.round(this._xscale) + 100);
      }
      else if(count == 270){
      count = 0;
      }
      }

      var numOfBalls:Number = 4;
      var radiusX:Number = 250;
      var radiusY:Number = 75;
      var centerX:Number = Stage.width / 2;
      var centerY:Number = Stage.height / 2;
      var speed:Number = 0.02;
      var perspective:Number = 160;

      for(var i=0;i<numOfBalls;i++) {
      var t = this.attachMovie("ball","b"+i,i+1);
      t.angle = i * ((Math.PI*2)/numOfBalls);
      t.onEnterFrame = around;
      }