Flex Drag and Drop with dynamic image
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

This work, unless otherwise expressly stated, is licensed under a Creative Commons Attribution 2.5 Bulgaria License.
Both comments and pings are currently closed.
