# Rotation in AS

**URL:** <https://forum.kirupa.com/t/rotation-in-as/19433>\
**Category:** Uncategorized\
**Created:** [April 28, 2003, 4:12am UTC](https://forum.kirupa.com/t/rotation-in-as/19433 "2003-04-28T04:12:11Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![spin3](https://avatars.discourse-cdn.com/v4/letter/s/22d042/32.png) [@spin3](https://forum.kirupa.com/u/spin3)\
**Post date:** [April 28, 2003, 4:12am UTC](https://forum.kirupa.com/t/rotation-in-as/19433/1 "2003-04-28T04:12:11Z")

</div>

hey, I am a newbe and am wondering how to rotate shape in action script, so that it may be continious.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 28, 2003, 4:16am UTC](https://forum.kirupa.com/t/rotation-in-as/19433/2 "2003-04-28T04:16:50Z")

</div>

have your shape in a movieclip and place this script on the timeline:

```auto
speed = 5
mymovieclip.onEnterFrame = function() {
this._rotation += speed
}

```

try different values for speed and see which fits best 🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 28, 2003, 4:38am UTC](https://forum.kirupa.com/t/rotation-in-as/19433/3 "2003-04-28T04:38:38Z")

</div>

I’m a newbe so where in the timeline?, and under the movie, or in the layer for the movie? I’ve tried a lot of things I think it could be, but they don’t work. Also, as long as I am asking questions, how do I get my site in the middle of the web page, like in dreamweaver where it is always in the center?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 28, 2003, 5:35am UTC](https://forum.kirupa.com/t/rotation-in-as/19433/4 "2003-04-28T05:35:35Z")

</div>

spin -

you’ll need to put that code on the root ( main ) timeline. then, be sure to give your movie clip an instance name in the proporties panel. then, change the “mymovieclip” in this code:

[AS]speed = 5  
mymovieclip.onEnterFrame = function() {  
this.\_rotation += speed  
}  
[/AS]

to reflect the new instance name. in case you don’t know where to put the instance name in, here is a screenshot:

![](http://www.vmkdsn.com/images/instance.gif)

* * *

for your next question, to center something in dreamweaver ( i’m using mx ), just select it and press ctrl+alt+shift+c and you should be done as a nun. pardon the pun.

k wtf that rhymed…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 28, 2003, 5:39am UTC](https://forum.kirupa.com/t/rotation-in-as/19433/5 "2003-04-28T05:39:50Z")

</div>

wow, it worked. thanks a lot.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 28, 2003, 5:56am UTC](https://forum.kirupa.com/t/rotation-in-as/19433/6 "2003-04-28T05:56:28Z")

</div>

glad i could help!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 28, 2003, 6:25am UTC](https://forum.kirupa.com/t/rotation-in-as/19433/7 "2003-04-28T06:25:30Z")

</div>

nice shortcut liam. (ie dreamweaver) I didn’t know about that one.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 28, 2003, 9:35pm UTC](https://forum.kirupa.com/t/rotation-in-as/19433/8 "2003-04-28T21:35:44Z")

</div>

worked great, thx again
