# \_rotation Help needed

**URL:** <https://forum.kirupa.com/t/-rotation-help-needed/197489>\
**Category:** flash\
**Created:** [August 16, 2006, 7:55pm UTC](https://forum.kirupa.com/t/-rotation-help-needed/197489 "2006-08-16T19:55:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cosizzle](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/cosizzle/32/2718_2.png) [@Cosizzle](https://forum.kirupa.com/u/Cosizzle)\
**Post date:** [August 16, 2006, 7:55pm UTC](https://forum.kirupa.com/t/-rotation-help-needed/197489/1 "2006-08-16T19:55:28Z")

</div>

Hey, I’ve been having this problem, and I cant come up with a resonable answer and I was wondering If I could pick at your guys brains.

Im trying to make a cradle effect where I have an object rotate from 0 degrees to 90 degrees and back again. Once I roll over, I want it to go from its current position weather is 27 degrees, 78 degrees or 90, and have it come back down to 0 and sit there, until the mouse leaves. I’ve attached my current code - I also linked a demo file to my webspace if you wish to download and take a look. Thank you to whom ever can help!

```php

function globeSpin() {
	var halfSpin = 1;
	globe.onEnterFrame = function() {
		if (this._rotation == 90) {
			halfSpin = -1;
		}
		if (this._rotation == 0) {
			halfSpin = 1;
		}
		this._rotation = this._rotation+halfSpin;
	};
}
function btnName() {
	var resetSpin = -10;
	btn.onRollOver = function() {
		globe.onEnterFrame = function() {
			if (this._rotation == 90) {
				resetSpin = -10;
				//this._rotation == 0;
			}
			if (this._rotation == 0) {
				//I think this is where it may be messing up
                      resetSpin = stop();
			}
			this._rotation = this._rotation+resetSpin;
		};
	};
}
globeSpin();
btnName();

```
