# Rotation problem SOLVED baby! Details inside!

**URL:** <https://forum.kirupa.com/t/rotation-problem-solved-baby-details-inside/180885>\
**Category:** Uncategorized\
**Created:** [March 4, 2006, 8:03am UTC](https://forum.kirupa.com/t/rotation-problem-solved-baby-details-inside/180885 "2006-03-04T08:03:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dayglowdave](https://avatars.discourse-cdn.com/v4/letter/d/dc4da7/32.png) [@dayglowdave](https://forum.kirupa.com/u/dayglowdave)\
**Post date:** [March 4, 2006, 8:03am UTC](https://forum.kirupa.com/t/rotation-problem-solved-baby-details-inside/180885/1 "2006-03-04T08:03:50Z")

</div>

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,

```auto
 myButton 

```

then I created a movieclip w/ instance name

```auto
 myRectangle 

```

.

On myButton I place the following:

```auto

 
 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:

```auto

 
 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
