# Stop rotation

**URL:** https://forum.kirupa.com/t/stop-rotation/183969
**Category:** Uncategorized
**Created:** [March 31, 2006, 3:58pm UTC](https://forum.kirupa.com/t/stop-rotation/183969 "2006-03-31T15:58:05Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![jillymo](https://avatars.discourse-cdn.com/v4/letter/j/5f9b8f/32.png) [@jillymo](https://forum.kirupa.com/u/jillymo)
#### Post date: [March 31, 2006, 3:58pm UTC](https://forum.kirupa.com/t/stop-rotation/183969/1 "2006-03-31T15:58:05Z")

</div>

I am having a problem that I swear I was not experiencing when working with this same file the other day. But that is another issue for me to puzzle over.

Anyway in this bit of code, I want this mc (called fall) to move down the screen to a certain y position, which it does and then rotate 90 and move to a certain x position. Problem is I cannot get the rotation += 90 to stop. I know it is just a simple matter but I am more frustrated because it was stopping the other day (I don’t have that file I had added more code and moved on and now I am backtracking) Anyway here is the code: I think it is probably that the delete onEnterFrame is not applying to the rotation, but I’m not sure.

```auto
function move() {
	clearInterval(moveInterval);
	_root.fall.onEnterFrame = function() {
		_root.fall._y += 10;
		if (_root.fall._y>= 755) {
			_root.fall._y = 755;
			if(_root.fall._y = 755){
				_ **root.fall._rotation += 90;**
				_root.fall._x = 530;
			}
			delete this.onEnterFrame;
		}
	};
}
moveinterval = setInterval(move, 1000);

```

---

<div class="post-metadata">

### Author: ![jillymo](https://avatars.discourse-cdn.com/v4/letter/j/5f9b8f/32.png) [@jillymo](https://forum.kirupa.com/u/jillymo)
#### Post date: [March 31, 2006, 7:08pm UTC](https://forum.kirupa.com/t/stop-rotation/183969/2 "2006-03-31T19:08:16Z")

</div>

I suppose I could try setting it up in a loop. I will post if it works.

---

<div class="post-metadata">

### Author: ![jillymo](https://avatars.discourse-cdn.com/v4/letter/j/5f9b8f/32.png) [@jillymo](https://forum.kirupa.com/u/jillymo)
#### Post date: [March 31, 2006, 7:31pm UTC](https://forum.kirupa.com/t/stop-rotation/183969/3 "2006-03-31T19:31:00Z")

</div>

Well I think I am getting warmer…it now just stops and does not rotate, but I am sure there is a better way of doing this…for now here is what I have and will continue to try and figure out (isn’t nice that I am talking to myself…lol)

```auto
function move() {
	clearInterval(moveInterval);
	_root.fall.onEnterFrame = function() {
		_root.fall._y += 10;
		if (_root.fall._y>= 755) {
			_root.fall._y = 755;
			if(_root.fall._y = 755){
				for (i=1; i<3; i++) {
				_root["fall"+i]._rotation += 90;
				_root.fall._x = 530;
				}
			}
			delete this.onEnterFrame;
		}
	};
}
moveinterval = setInterval(move, 1000);

```

---

<div class="post-metadata">

### Author: ![stringy](https://avatars.discourse-cdn.com/v4/letter/s/919ad9/32.png) [@stringy](https://forum.kirupa.com/u/stringy)
#### Post date: [March 31, 2006, 9:05pm UTC](https://forum.kirupa.com/t/stop-rotation/183969/4 "2006-03-31T21:05:48Z")

</div>

> [@jillymo](#):
>
> Well I think I am getting warmer…it now just stops and does not rotate, but I am sure there is a better way of doing this…for now here is what I have and will continue to try and figure out (isn’t nice that I am talking to myself…lol)
> 
> ```auto
> function move() {
> clearInterval(moveInterval);
> _root.fall.onEnterFrame = function() {
> _root.fall._y += 10;
> if (_root.fall._y>= 755) {
> _root.fall._y = 755;
> if(_root.fall._y = 755){
> for (i=1; i<3; i++) {
> _root["fall"+i]._rotation += 90;
> _root.fall._x = 530;
> }
> }
> delete this.onEnterFrame;
> }
> };
> }
> moveinterval = setInterval(move, 1000);
> 
> ```

see if this works better

```auto
function move() {
	clearInterval(moveInterval);
	_root.fall.onEnterFrame = function() {
		_root.fall._y += 10;
		if (_root.fall._y>=755) {
			_root.fall._y = 755;
			for (i=1; i<3; i++) {
				_root["fall"+i]._rotation += 90;
				_root.fall._x = 530;
				delete this.onEnterFrame;
			}
		}
	};
}
moveInterval = setInterval(move, 1000);

```

---

<div class="post-metadata">

### Author: ![jillymo](https://avatars.discourse-cdn.com/v4/letter/j/5f9b8f/32.png) [@jillymo](https://forum.kirupa.com/u/jillymo)
#### Post date: [March 31, 2006, 9:26pm UTC](https://forum.kirupa.com/t/stop-rotation/183969/5 "2006-03-31T21:26:39Z")

</div>

First of all thank you, and second of all I tried this code myself earlier:

```auto
//function move() {
	//clearInterval(moveInterval);
	//_root.fall.onEnterFrame = function() {
		//_root.fall._y += 10;
		//if (_root.fall._y>= 755) {
			//_root.fall._y = 755;
			//if(_root.fall._y = 755){
				//for (i=1; i<3; i++) {
				// mc = "fall" + i;
				//_root.mc._rotation += 90;
				//_root.fall._x = 530;
				//}
			//}
			//delete this.onEnterFrame;
		//}
	//};
//}
//moveinterval = setInterval(move, 1000);

```

(commented out as I was trying your code) and your code is giving me the same results as this was…the objects gets to y position of 755 then shifts to x of 530 without the 90 degree rotation. The biggest frustration I have is that I had this going fine a couple days ago but I messed with other code too much and did not save my working version and now am having problems. I am sure I must have changed something at some point, but I know better than to not save my works in progress.

Thanks for your input =)

---

<div class="post-metadata">

### Author: ![stringy](https://avatars.discourse-cdn.com/v4/letter/s/919ad9/32.png) [@stringy](https://forum.kirupa.com/u/stringy)
#### Post date: [March 31, 2006, 9:33pm UTC](https://forum.kirupa.com/t/stop-rotation/183969/6 "2006-03-31T21:33:31Z")

</div>

> [@jillymo](#):
>
> First of all thank you, and second of all I tried this code myself earlier:
> 
> ```auto
> //function move() {
> //clearInterval(moveInterval);
> //_root.fall.onEnterFrame = function() {
> //_root.fall._y += 10;
> //if (_root.fall._y>= 755) {
> //_root.fall._y = 755;
> //if(_root.fall._y = 755){
> //for (i=1; i<3; i++) {
> // mc = "fall" + i;
> //_root.mc._rotation += 90;
> //_root.fall._x = 530;
> //}
> //}
> //delete this.onEnterFrame;
> //}
> //};
> //}
> //moveinterval = setInterval(move, 1000);
> 
> ```
> 
> (commented out as I was trying your code) and your code is giving me the same results as this was…the objects gets to y position of 755 then shifts to x of 530 without the 90 degree rotation. The biggest frustration I have is that I had this going fine a couple days ago but I messed with other code too much and did not save my working version and now am having problems. I am sure I must have changed something at some point, but I know better than to not save my works in progress.
> 
> Thanks for your input =)

i`ve just tried, and “fall” reaches \_y=755 and then moves to \_x=530 and “fall1” and “fall2” both rotate 90 degrees.Is this not what you want?  
You have not told \_root.fall to rotate.

---

<div class="post-metadata">

### Author: ![jillymo](https://avatars.discourse-cdn.com/v4/letter/j/5f9b8f/32.png) [@jillymo](https://forum.kirupa.com/u/jillymo)
#### Post date: [March 31, 2006, 9:36pm UTC](https://forum.kirupa.com/t/stop-rotation/183969/7 "2006-03-31T21:36:41Z")

</div>

No…I am trying to tell \_root.fall to rotate. 😊

---

<div class="post-metadata">

### Author: ![stringy](https://avatars.discourse-cdn.com/v4/letter/s/919ad9/32.png) [@stringy](https://forum.kirupa.com/u/stringy)
#### Post date: [March 31, 2006, 9:41pm UTC](https://forum.kirupa.com/t/stop-rotation/183969/8 "2006-03-31T21:41:06Z")

</div>

> [@jillymo](#):
>
> No…I am trying to tell \_root.fall to rotate. 😊

```auto
function move() {
	clearInterval(moveInterval);
	_root.fall.onEnterFrame = function() {
		this._y += 10;
		if (this._y&gt;=755) {
			this._y = 755;
			this._x = 530;
			this._rotation += 90;
			delete this.onEnterFrame;
		}
	};
}
moveInterval = setInterval(move, 1000);

what is the "for" loop for?
```

---

<div class="post-metadata">

### Author: ![jillymo](https://avatars.discourse-cdn.com/v4/letter/j/5f9b8f/32.png) [@jillymo](https://forum.kirupa.com/u/jillymo)
#### Post date: [March 31, 2006, 9:53pm UTC](https://forum.kirupa.com/t/stop-rotation/183969/9 "2006-03-31T21:53:44Z")

</div>

Because I could not get it working the way you just did and was just trying to think of anything I could. I thought maybe if I only told it to rotate once it would work and the only way I could think of was a loop. (my problem was the rotation was not stopping) And I know setting it to 3 was not the solution but it did not work with 1 & 2 so I just kept going and was going to go back and try some other things when I had a chance. But instead you came in and once again rescued me from my lack of knowledge. 😃  
Thank you!

---

<div class="post-metadata">

### Author: ![stringy](https://avatars.discourse-cdn.com/v4/letter/s/919ad9/32.png) [@stringy](https://forum.kirupa.com/u/stringy)
#### Post date: [March 31, 2006, 9:57pm UTC](https://forum.kirupa.com/t/stop-rotation/183969/10 "2006-03-31T21:57:00Z")

</div>

> [@jillymo](#):
>
> Because I could not get it working the way you just did and was just trying to think of anything I could. I thought maybe if I only told it to rotate once it would work and the only way I could think of was a loop. (my problem was the rotation was not stopping) And I know setting it to 3 was not the solution but it did not work with 1 & 2 so I just kept going and was going to go back and try some other things when I had a chance. But instead you came in and once again rescued me from my lack of knowledge. 😃  
> Thank you!

welcome  
main probs -you had “=” instead of “==” and wrong case for moveinterval

---

<div class="post-metadata">

### Author: ![jillymo](https://avatars.discourse-cdn.com/v4/letter/j/5f9b8f/32.png) [@jillymo](https://forum.kirupa.com/u/jillymo)
#### Post date: [March 31, 2006, 10:02pm UTC](https://forum.kirupa.com/t/stop-rotation/183969/11 "2006-03-31T22:02:41Z")

</div>

appreciate the explanation as well - I try to remember these things for future reference
