|
classdragdrop .mxml
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" backgroundAlpha="0" xmlns="*" creationComplete="initApp()"> <mx:Script> import mx.core.*; [Bindable] private function initApp() : void { private function doDragEnter(event:DragEvent):void private function doDragDrop(event:DragEvent):void </mx:Script> <mx:Label text="Drag the product thumbnail and drop it in the datagrid"/> <mx:HBox horizontalGap="30" height="100%"> <Thumbnail id="thumbnail"/> <mx:Panel title="Shopping Cart" width="300" height="100%" borderAlpha="1" paddingTop="20"> </mx:HBox> </mx:Application> |
thumnail.xml |
<?xml version="1.0" encoding="utf-8"?> <mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml" <mx:Script> import mx.core.*; [Bindable] public function beginDrag(event:MouseEvent) : void </mx:Script> <mx:Image id="img" source="../{product.image}" width="50" height="100"/> </mx:HBox> |