Thứ Năm, 24 tháng 12, 2009

sniplet

_gradientColor1 = uint(input);
r1 = (_gradientColor1 >>16) & 0xFF;
g1 = (_gradientColor1 >>8) & 0xFF;
b1 = _gradientColor1 & 0xFF;

filtersCo=r1<<16|g1<<8|b1

Have you tried “Math.atan2″ method to detect angle between the points?
This returns in radians but you can multiply by “180 / Math.PI” for degree rotation.
function angleOfPoints(a:Point, b:Point):Number
{
var dx:Number = a.x-b.x;
var dy:Number = a.y-b.y;
var rad:Number = Math.atan2(dy, dx);
return rad;
}
stage.scaleMode = StageScaleMode.NO_SCALE;