Skip navigation
designerbala2024
Currently Being Moderated

how to combine more than two movie clip and how to define tool

Feb 4, 2013 7:46 AM

Tags: #cs4 #a #actionscript

Hi,

 

below code, it will rotate globe by mouse control and rorate dynamic also.

 

my project screen shot link: http://board.flashkit.com/board/attachment.php?attachmentid=74073&d=13 59688599

 

CD.getMouseRotation = function(){

          var x = this._parent._xmouse-this._x;

          var y = this._parent._ymouse-this._y;

          return Math.atan2(y,x)*180/Math.PI;

};

CD.positionToMouse = function(){

          this._lastrotation = this._rotation;

          this._rotation = this.getMouseRotation() - this._clickrotation;

};

CD.spin = function(){

          this._rotation += this.spinSpeed;

          this.spinSpeed *= .9;

};

CD.onPress = function(){

          this._clickrotation = this.getMouseRotation() - this._rotation;

          this.onEnterFrame = this.positionToMouse;

};

CD.onRelease = CD.onReleaseOutside = function(){

          this.spinSpeed = this._rotation - this._lastrotation;

          if (this.spinSpeed > 180) this.spinSpeed -= 360;

          else if (this.spinSpeed < -180) this.spinSpeed += 360;

          this.onEnterFrame = this.spin;

};

 
Replies

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points