Graphics Flex



    
    
    import mx.managers.DragManager;
    import mx.core.DragSource;
    import mx.events.DragEvent;
    import flash.events.MouseEvent;
    
    [Embed(source='logo.jpg')]
    public var globeImage:Class;
    
    private function mouseOverHandler(event:MouseEvent):void
    {
        var dragInitiator:Image = Image(event.currentTarget);
        var ds:DragSource = new DragSource();
        ds.addData(dragInitiator, "img");
        
        var imageProxy:Image = new Image();
        imageProxy.source = globeImage;
        DragManager.doDrag(dragInitiator, ds, event,imageProxy, -5, -5, 1.00);
    }
    private function dragEnterHandler(event:DragEvent):void {
        if (event.dragSource.hasFormat("img"))
        {
            DragManager.acceptDragDrop(Canvas(event.currentTarget));
        }
    }
    private function dragDropHandler(event:DragEvent):void {
        Image(event.dragInitiator).x =Canvas(event.currentTarget).mouseX;
        Image(event.dragInitiator).y =Canvas(event.currentTarget).mouseY;
    }
  
    

                   dragEnter="dragEnterHandler(event);"
               dragDrop="dragDropHandler(event);">