# Rotating mc with actionscript

**URL:** <https://forum.kirupa.com/t/rotating-mc-with-actionscript/13808>\
**Category:** Uncategorized\
**Created:** [February 18, 2003, 3:04pm UTC](https://forum.kirupa.com/t/rotating-mc-with-actionscript/13808 "2003-02-18T15:04:14Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![denismatt](https://avatars.discourse-cdn.com/v4/letter/d/439d5e/32.png) [@denismatt](https://forum.kirupa.com/u/denismatt)\
**Post date:** [February 18, 2003, 3:04pm UTC](https://forum.kirupa.com/t/rotating-mc-with-actionscript/13808/1 "2003-02-18T15:04:14Z")

</div>

Hi,  
my problem is that even if the registration point of the MC I want to rotate is in its center it keeps rotating in its upper left corn.  
The MC is a jpg I load dynamically.  
The syntax I use is :

\_root.photo.\_rotation += 90;

Any idea?  
TY.

---

<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:** [February 18, 2003, 3:06pm UTC](https://forum.kirupa.com/t/rotating-mc-with-actionscript/13808/2 "2003-02-18T15:06:52Z")

</div>

post your fla here so we can take a look at it…

---

<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:** [February 18, 2003, 3:07pm UTC](https://forum.kirupa.com/t/rotating-mc-with-actionscript/13808/3 "2003-02-18T15:07:52Z")

</div>

jpgs dont load in the center. They load from the upperleft corner down like in reading a page. What you can do is put the movieclip you load the image into inside another movieclip and position the jpg clip accordingly so you can rotate that new movieclip which holds it and have the image rotate from the center (which would be up and to the left from 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:** [February 18, 2003, 3:56pm UTC](https://forum.kirupa.com/t/rotating-mc-with-actionscript/13808/4 "2003-02-18T15:56:37Z")

</div>

good to hear that…

---

<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:** [February 18, 2003, 4:03pm UTC](https://forum.kirupa.com/t/rotating-mc-with-actionscript/13808/5 "2003-02-18T16:03:11Z")

</div>

I mean…

if I do the following:

\_root.createEmptyMovieClip(“container”,1);  
container.loadMovie(“flower.jpg”);  
\_root.container.\_rotation +=90;

I know that the mc rotates in the upper left corner but  
if I draw a rectangle , I convert it into a mc and I set the registration point in its center and only than I load the jpg I believed that the rotation was in its center…  
Why am I wrong?

---

<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:** [February 18, 2003, 4:10pm UTC](https://forum.kirupa.com/t/rotating-mc-with-actionscript/13808/6 "2003-02-18T16:10:09Z")

</div>

Well you were wrong, that’s all 🙂 jpgs (and swfs) don’t load in the center. But you can make a little script that will move your jpg when it’s loaded :phil:

---

<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:** [February 18, 2003, 4:14pm UTC](https://forum.kirupa.com/t/rotating-mc-with-actionscript/13808/7 "2003-02-18T16:14:34Z")

</div>

it doesnt matter what you draw in the movieclip, like I said, loaded images always load from the upperleft corner down (and to the right). This is from the centerpoint of the movieclip they’re loaded into.

```auto

+-------
| |
| image | 
| | 
 -------

```

also, as I said before, what you’ll have to do is have another movieclip to put it into so you can rotate that instead, positioning the loaded image within accordingly.

if the image is 240x480 then youd position container to be -120, -240 within the new rotating clip

\_root.createEmptyMovieClip(“rotater”,1);  
\_root.rotater.createEmptyMovieClip(“container”,1);  
\_root.rotater.container.\_x = -120;  
\_root.rotater.container.\_y = -240;  
\_root.rotater.container.loadMovie(“flower.jpg”);  
\_root.rotater.\_rotation +=90;

---

<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:** [February 18, 2003, 4:29pm UTC](https://forum.kirupa.com/t/rotating-mc-with-actionscript/13808/8 "2003-02-18T16:29:39Z")

</div>

Stop repeating what I say, Sen :bad: [SIZE=1]especially when I’m repeating what you’ve already said…[/SIZE]

---

<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:** [February 18, 2003, 4:47pm UTC](https://forum.kirupa.com/t/rotating-mc-with-actionscript/13808/9 "2003-02-18T16:47:58Z")

</div>

stop writing such short replies so you dont post them faster than I can write mine 😉

---

<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:** [February 18, 2003, 5:09pm UTC](https://forum.kirupa.com/t/rotating-mc-with-actionscript/13808/10 "2003-02-18T17:09:33Z")

</div>

do like me, always post something usefull 😉

---

<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:** [February 18, 2003, 7:05pm UTC](https://forum.kirupa.com/t/rotating-mc-with-actionscript/13808/11 "2003-02-18T19:05:04Z")

</div>

ok

---

<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:** [February 18, 2003, 7:10pm UTC](https://forum.kirupa.com/t/rotating-mc-with-actionscript/13808/12 "2003-02-18T19:10:34Z")

</div>

see?

another useful post 😛

---

<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:** [February 18, 2003, 7:14pm UTC](https://forum.kirupa.com/t/rotating-mc-with-actionscript/13808/13 "2003-02-18T19:14:48Z")

</div>

you always have to have the last post dont you

😉

---

<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:** [February 18, 2003, 7:26pm UTC](https://forum.kirupa.com/t/rotating-mc-with-actionscript/13808/14 "2003-02-18T19:26:56Z")

</div>

😛

---

<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:** [February 18, 2003, 8:06pm UTC](https://forum.kirupa.com/t/rotating-mc-with-actionscript/13808/15 "2003-02-18T20:06:10Z")

</div>

told you :beam:

---

<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:** [February 18, 2003, 8:09pm UTC](https://forum.kirupa.com/t/rotating-mc-with-actionscript/13808/16 "2003-02-18T20:09:13Z")

</div>

let me have the last word! :bad:

---

<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:** [February 18, 2003, 8:15pm UTC](https://forum.kirupa.com/t/rotating-mc-with-actionscript/13808/17 "2003-02-18T20:15:48Z")

</div>

ok

---

<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:** [February 20, 2003, 8:53am UTC](https://forum.kirupa.com/t/rotating-mc-with-actionscript/13808/18 "2003-02-20T08:53:06Z")

</div>

I appreciated your suggestions…it works fine now.  
I need to work on it anyway.  
Bye
