Change your angle to the "amount.value * 100 / 50", and you should be
good ...
private function doSlide( event:Event ):void {
var distance:Number = amount.value * 100;
var angle:Number = distance / 50;
var rightMatrix:Matrix = new Matrix( 1, 0, 0, 1, 0, distance );
rightImage.transform.matrix = rightMatrix;
var leftMatrix:Matrix = new Matrix( 1, angle, 0, 1, 0, 0 );
leftImage.transform.matrix = leftMatrix;
}
--- In [email protected], "tddclare" <[EMAIL PROTECTED]> wrote:
>
> I'm trying to skew an Image object to a varying amount, right down the
> center. I'm using the example math that I found in the help and in
> examples online, but for some reason the math doesn't seem to be
working
> out. A cookie for anyone who can help me figure it out.
>
> I published the sample of my problem here
> <http://www.pattyandtodd.com/files/flexexamples/matrixskew/Test.html>
> and the source is here
> <http://www.pattyandtodd.com/files/flexexamples/matrixskew/srcview/>
> ...
>
> The general gist is that I have the blue canvas (100x100), and am
> rendering both halves of it ( A and B ) (each 50x100) on the right:
>
> ----------- -----------
> | | | A | B |
> | | | | |
> ----------- -----------
>
> The slider sets how far the right half (B) is translated down (or up)
> -- as a percentage of the height of B. So a setting of 1 moves B down
> 100% of it's height. The left half (A) should stay at its original
> position (working!), but it's right half should skew (down or up)
> (working!) to match the left edge of B.
>
> But the edges are not matching up. My suspicions are that I'm messing
> up with radians, PI or something else I slept through in
Trigonometry...
>
> Could anyone shed some light as to what's missing?
>