ScaleX and Y for stretching MovieClip

I'm developing a game, and the game has a shop. In that shop there is an option for a house expansion. This is a movieclip that I want the user to be able to spend their coins to increase their house in the following ways:

-> stretch house to right <- stretch house to left ^ stretch house upward v stretch house downward.

The thing is, I've been thinking of using ScaleX and ScaleY to accomplish this. The only problem: It stretches the left and right, I can't make it do one. I'm sure there is a way to do this, but I haven't yet figured it out. Any ideas?

• I figured it out, and I'd like to hear your thoughts on my answer!
– user25191
Jan 21, 2013 at 22:31

Change the registration point of movieclip from "center" to x=0 and y=0 . Keeping the registration point in the center, causes the movieclip to stretch on both the sides equally.

• +1 Thanks, but I figured it out, until I realized this is also a good method, if I were only trying to do one side.
– user25191
Jan 22, 2013 at 14:03

Set up the stage:

var num:Number = 10;


For up:

mc.height += num;
mc.y -= num/2;


For down:

mc.height += num;
mc.y += num/2;


For left:

mc.width+=num;
mc.x -= num/2;


For right:

mc.width+=num;
mc.x+=num/2;

• At least give "num" a proper name ;). Also changing scale depends on your center of origin in the coordinate space of your Movieclip. You should check your own answer so that this question isn't listed as not answered. Jan 21, 2013 at 22:37
• I have to wait 2 days for that, my friend ;)
– user25191
Jan 21, 2013 at 22:40