Rotate while dragging and dropping

  • Adde
  • Beginner
  • Beginner
  • Adde
  • Posts: 47

Post 3+ Months Ago

Hi... Now it was some time since i was here... i mean in sweden and in this forum(was in spain), whatever... i (of course) know a script that drags and drops that all kinda do... i think... However anyone knows a script that drags,drops AND rotates.. :?:
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13503
  • Loc: Florida

Post 3+ Months Ago

:scratchhead:
Is this what your looking for ?
Code: [ Select ]
MovieClip.prototype.dDR = function(constant, amount){
    this.sets = {c:constant, a:amount}
    this.onPress = function(){
        startDrag(this,false);
    }
    this.onRelease = function(){
        stopDrag();
        if(this.sets.c){
            this.onEnterFrame = function(){
                this._rotation += this.sets.a;
            }
        }else{
            this._rotation += this.sets.a;
        }
    }
}

mC.dDR(false,10); /* rotates clockwise 10 degrees onRelease */

mC.dDR(true,10); /* rotates clockwise FPS times per second on release*/

mC.dDR(true, -10); /* rotates counter-clockwise FPS times per second onRelease*/
  1. MovieClip.prototype.dDR = function(constant, amount){
  2.     this.sets = {c:constant, a:amount}
  3.     this.onPress = function(){
  4.         startDrag(this,false);
  5.     }
  6.     this.onRelease = function(){
  7.         stopDrag();
  8.         if(this.sets.c){
  9.             this.onEnterFrame = function(){
  10.                 this._rotation += this.sets.a;
  11.             }
  12.         }else{
  13.             this._rotation += this.sets.a;
  14.         }
  15.     }
  16. }
  17. mC.dDR(false,10); /* rotates clockwise 10 degrees onRelease */
  18. mC.dDR(true,10); /* rotates clockwise FPS times per second on release*/
  19. mC.dDR(true, -10); /* rotates counter-clockwise FPS times per second onRelease*/

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 9 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.