Rotation problem SOLVED baby! Details inside!

I dug and found a thread where someone had asked how to get their menu to stop when they rolled over it. That was pretty much the exact opposite of what I was trying to do. A little reverse engineering and voila! Works great even starts and stops at it’s current position. I was thinking I was going to have to write something like totalDegrees = or currDegreeRotated = but nope it is easier than that. I would be remiss if I did not share this information so here goes:

First I created a movie clip w/ instance name,

 myButton 

then I created a movieclip w/ instance name

 myRectangle 

.

On myButton I place the following:


 
 on(release){
     
 rotate = function(){
     _root.myRectangle._rotation += 5; // can be set to desired speed
                                                   // negative number produce counter
                                                   // clockwise motion as does ' -= '
 }
 _root.myRectangle.onEnterFrame = rotate; //onEnterFrame is needed for
                                                          // continuous motion 
                                                          // good call sbarton22
     
 }
 
 

Then on the movie clip, myRectangle I place the following:


 
 onClipEvent(enterFrame){
     this.onMouseDown = function(){
         this.onEnterFrame = null; //stops the refresh
     }
 }
 
 

That is it. Test the movie and myRectangle should rotate when myButton is pressed and stop rotating when you press on myRectangle.

THANKS STIAKOOO