PDA

View Full Version : MX Actionscript rotation and scaling



Clown Staples
February 16th, 2003, 04:56 PM
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!

pom
February 16th, 2003, 06:20 PM
I learned here: http://www.geocities.com/~dr_ericlin/flash/indexgeo.html
Pretty clever technique :)

And that guy obviously knows his Flash :o

pom :cowboy:

Clown Staples
February 16th, 2003, 11:39 PM
Thanks.. you're right. This guy is amazing.

senocular
February 17th, 2003, 12:06 AM
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