In this example we must specify a size for the drag indicator.
In this example we must specify a size for the drag indicator.In this example we must specify a size for the drag
indicator. In this example we use a doDrag() method. The syntax of doDrag()
method is following:
doDrag(dragInitiator:IUIComponent, dragSource:DragSource, mouseEvent:MouseEvent,
dragImage:IFlexDisplayObject = null, xOffset:Number = 0, yOffset:Number = 0,
imageAlpha:Number = 0.5, allowMove:Boolean = true):void
When we drag the image it changes the size and drop the image it resize.
|
<?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"xmlns:s=" library://ns.adobe.com/flex/spark"xmlns:mx=" library://ns.adobe.com/flex/mx"minWidth=" 955" minHeight="600"><![CDATA[ import flash.events.MouseEvent;[ Embed(source='C:/work/bikrant/image/roseindia.gif')] public var roseindiaImage:Class; // initialize the drag and drop operation{ var dragInitiator:Image=Image(event.currentTarget);dragSource.addData(dragInitiator, "image"); var image:Image= new Image();image.source=roseindiaImage; image.height=100; image.width=85; DragManager.doDrag(dragInitiator, dragSource, event, image, -100, -85, 1.00); } { DragManager.acceptDragDrop(Panel(event.currentTarget)); } } Image(event.dragInitiator).x = Panel(event.currentTarget).mouseX; Image(event.dragInitiator).y = Panel(event.currentTarget).mouseY; } ]]> </fx:Script> <s:Panel title="Specify the drag indicator by using the DragManager"width=" 386"height=" 282"chromeColor=" #555555"color=" #CCCCCC"dragEnter="dragEnterHandler(event);" dragDrop="dragDropHandler(event);" >source=" {roseindiaImage}"mouseMove="mouseMoveHandler(event)" /></s:Application> |

To view this page ensure that Adobe Flash Player version 10.0.0 or greater is installed.