Skip to main content
Participating Frequently
June 10, 2010
Question

Rotate dynamically added movieclip from origin (0,0) and not center ?

  • June 10, 2010
  • 1 reply
  • 829 views

I've got this simple code here:

          this["recipe"+i] = new recipelistname();
     this["recipe"+i].buttonMode = true;
     this["recipe"+i].recipeid = i;
     this["recipe"+i].recipename_txt.text = XMLRecept["title"];
     this["recipe"+i].x = startposX;
     this["recipe"+i].y = startposY+(30*counter);
     this["recipe"+i].rotation = -5;

        addChild(this["recipe"+i]);

The problem is that the movieclip rotates around the center. The textfield inside the movieclip is starting at 0,0. But it still rotates around the center, how can I make it rotate at 0,0?

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
June 10, 2010

your movieclip's registration point is its center, correct?  and that movieclip contains a textfield that's positioned with its upper left corner at the movieclip's registartion point, correct?

and you want the textfield to do what when the movieclip rotates?

Urme39Author
Participating Frequently
June 10, 2010

Yeah, and I want my movieclip that contains the textfield to rotate from the upper left corner, and not from the center of the movieclip as it is now.

My textfield is positioned at 0,0 inside the movieclip.

I've solved it in another way for now, I added a movieclip container that I put on the stage and added the childs to that container, which I could rotate as I wanted.

kglad
Community Expert
Community Expert
June 10, 2010

then go to your movieclip's timeline and align all the assets so nothing is to the left or above the movieclip's reg point (0,0).