Use a bitmap of the target instead of the original target.

///////////////////////////////////////////////
var target:UIComponent = event.currentTarget as UIComponent;
var dragProxy:Bitmap;
var myBitmapData:BitmapData = new BitmapData(target.width, target.height);
myBitmapData.draw(target); // draw target onto bitmap
dragProxy = new Bitmap(myBitmapData);
//////////////////////////////////////////////

- Dan Freiman

On Nov 11, 2007 12:57 PM, <[EMAIL PROTECTED]> wrote:

>   Hi,
>
> I am trying to drag an UIComponent instance over an Image object and
> drag and drop work fine but i am having problem with dragProxy image.
> I would like to use my original drag source UIComponent as dragProxy
> image but if i do the following:
>
> public function dragItSubs(event:MouseEvent):void{
>
> // Get the drag initiator component from the event object.
> var dragInitiator:UIComponent = event.currentTarget as UIComponent;
>
> /////////////////////////////////////////////////////////
> var dragProxy:UIComponent = new UIComponent;
> dragProxy = event.currentTarget as UIComponent;
> /////////////////////////////////////////////////////////
>
> // Call the DragManager doDrag() method to start the drag.
> DragManager.doDrag(dragInitiator, event, dragProxy);
>
> }
>
> then the original UIComponent (which is a drag source) is used as
> dragProxy while dragging it but that same component dissapears from
> its original position as soon as dragging starts. How can i accomplish
> that drag source UIComponent's "image" is used as dragProxy but the
> same source drag UIComponent is intact while dragging?
>
> thanks in advance
>
> --
> Best regards,
> Mirko mailto:msabljic[at]gmail.com
>
>  
>

Reply via email to