Hey I was searching in internet how to do a drag that create a exact copy of the image without loading it. All the examples were with Embed images so i needed some example that Image load bitmap and then do drag without having to load bitmap twice. So take a look:
1 2 3 4 5 6 7 8 9 10 11
| // fire from MouseEvent.MOUSE_DOWN event
private function doDrag(e:MouseEvent):void {
var dragInitiator:Image = e.currentTarget as Image;
var dragSource:DragSource = new DragSource();
dragSource.addData(_core, "core");
var dragProxy:Image = new Image ();
dragProxy.source = new Bitmap((dragInitiator.content as Bitmap).bitmapData);
DragManager.doDrag(dragInitiator, dragSource, e, dragProxy);
} |
Spinets used:
Simple Flex Drag and Drop