I did something similar, but I took an element of one type from a list
and dropped it onto a canvas and then converted it to another type. 
This was done by just accepting the data type that gets dropped in the
doDragDrop function and converting it in there before adding it. The odd
thing is how it's in the "items"  list. I believe that hung me up for a
while. Anyway, check out the code, which I think is pretty much a rip
from the docs. This code is from my receiving canvas.

             private function doDragEnter(event:DragEvent):void
             {
                 var dropTarget:Canvas = event.currentTarget as Canvas
                 DragManager.acceptDragDrop(dropTarget);
             }

             private function doDragDrop(event:DragEvent):void
             {
                 var dropTarget:Canvas = Canvas(event.currentTarget);

                 var items:Array =
event.dragSource.dataForFormat("items") as Array;

                 if (!(event.dragSource.hasFormat("items")))
                 {
                     trace("stop");
                 }

                 for (var i:int = 0; i<items.length; i++)
                 {
                         //This is the other data type. The addCard
method is akin to your factory.
                     var card:CardView = addCard(items[i]);
                     card.x = this.mouseX;
                     card.y = this.mouseY;
                 }
             }

--- In [email protected], "Sean Riggle" <[EMAIL PROTECTED]> wrote:
>
> I am running into problems using drag and drop in Flex.  I have a
> data grid and a list; I want to implement drag and drop between the
two.
>
> Here is the catch:
> The list and the grid have different data providers that are of
> different types.  This causes the list not to accept dragged items
> from the grid and vice versa.  They are custom types of data, but I do
> have
> factories to convert from one type to the other.
>
> Can I use these factories to convert the data to a different type when
> the DragEvent.DRAG_START event is fired so that my list will accept
> dragged items from my grid?  Has anyone done anything similar that can
> give me some direction with this issue?
>
> Thanks,
> Sean
>


Reply via email to