Zooming In&Out - Aspect Ratio

Hi,

I am scalling a vector shape using ._width & ._height… how do I work out its aspect ratio for scaling up (zooming in) and scaling down (zooming out) is? I have written code for scaling up and it works fine, I am having problems working out how to do it in reverse!

Here is the code I have written for scaling up :

  • speed is worked out earlier.

var xaspectRatio = ((mcWidth+speed)/mcWidth);
var wSpeed = speed;
var hHeight = (mcHeight*xaspectRatio);
mcName._height = hHeight;
mcName._width += wSpeed;

Any help would be great…

Thanks

Dev*

You can read this: http://www.kirupa.com/developer/mx/perspective.htm or Sen’s excellent tutorial (it’s somewhere in the tute).

thanks for that,

but that tutorial uses x_scale and y_scale I want something thats uses _width & _height!