MX Actionscript rotation and scaling

Hey everyone,

I’m interested in distorting movie clips at runtime based on user input. I know how to rotate - thats easy : clip._rotation is a number from 0 to 360. I know how to scale - thats easy too : clip._xscale and clip._yscale are conveniently independent. But how do you *SKEW * a movie clip at runtime??

The best I can come up with is really complicated. If you put a symbol within a symbol and name both ( something like shell and core ), you can squish and rotate them independently, making it possible to distort the clip twice as many ways.

shell.core._yscale = 160;
shell.core._xscale = 100;
shell.core._rotation = 45;

shell._yscale = 40;
shell._xscale = 100;
shell._rotation = -22.5;

this gives me somewhat the effect i want, but it is not precise, and i want to be able to skew at any angle, not just 45 degrees.

What is the trigonometry behind this? Any math wizzes want to give me a hand?

Thanks!

I learned here: http://www.geocities.com/~dr_ericlin/flash/indexgeo.html
Pretty clever technique :slight_smile:

And that guy obviously knows his Flash :o

pom :cowboy:

Thanks… you’re right. This guy is amazing.

Ive done this which you’re welcome to use
http://proto.layer51.com/d.aspx?f=636

theres also one on skewing
http://proto.layer51.com/d.aspx?f=487