PDA

View Full Version : Possible ways to manipulate dynamically drag Proxy


luigi.freguglia
06-13-2009, 02:50 PM
Hello,
i'm trying to use drag&drop manually over a custom Image class: i can drag it's position or drag to resize, handling form the corner.
I'm even using a custom proxy, deep copying the same image. It works fine for dragging the image around, but i can't see how to
resize the proxy while i drag to resize.
Is there something i don't do in my updateDisplayList?


override protected function updateDisplayList(w:Number, h:Number):void {
super.updateDisplayList(w, h);
square.graphics.clear();
square.graphics.lineStyle(2, 0x00ff00);
square.graphics.drawRect(0, 0, this.width, this.height);
}


or should I write something to access the proxy while occours dragOver? but how can i access the proxy?


private function dragOverHandler(event:DragEvent):void {
if (event.dragSource.hasFormat("drag"))
trace("coordinates: " + event.dragInitiator.x + "," + event.dragInitiator.y + " " + event.currentTarget.mouseX + "," + event.currentTarget.mouseY);
if (event.dragSource.hasFormat("resize"))
trace("size: " + (event.currentTarget.mouseX - event.dragInitiator.x) + "x" + (event.currentTarget.mouseY - event.dragInitiator.y));
}


I googled around but i couldn't find anything useful