I want to be able to drag and drop the movieclip and dynamically skew based on the mouse position but. When I click the movie clip it jumps to top left corner, and I can’t drag and drop the mc… Why is this?
import flash.geom.Matrix;
import flash.events.MouseEvent;
import flash.sampler.NewObjectSample;
//shadow matrix
circ.addEventListener(MouseEvent.MOUSE_DOWN, drag)
circ.addEventListener(MouseEvent.MOUSE_UP, drop)
function drop(event:MouseEvent):void{
circ.stopDrag();
stage.removeEventListener(Event.ENTER_FRAME, skewer)
}
function drag(event:MouseEvent):void{
circ.startDrag();
stage.addEventListener(Event.ENTER_FRAME, skewer)
//circ.transform.matrix = sm;
}
function skewer(e:Event):void{
circ.scaleX = 1 + Math.abs((550 - mouseX)/550);
var sm:Matrix = new Matrix();
//a = x scale / b = y skew / c = x skew / d = y scale / tx = x translation ty = y
sm.b = 1 + Math.abs((550 - mouseX)/550);
circ.transform.matrix = sm;
}
Thanks