Ok... got it working the way i wanted. Maybe it's useful to someone else.
var dumm:ArrayCollection = new ArrayCollection(['Test1','Test2','Test3']);
var hhbox:HBox = new HBox();
hhbox.percentWidth = 100;
var list1:List = new List();
list1.percentWidth = 50;
list1.dataProvider = dumm;
list1.allowMultipleSelection = true;
list1.dropEnabled = true;
list1.dragEnabled = true;
list1.dragMoveEnabled = true;
list1.setStyle("alternatingItemColors",["#FF", "#EE"]);
list1.name = value.fieldname + '_source';
list1.id = value.fieldname + '_source';
list1.addEventListener(DragEvent.DRAG_DROP,function(e:DragEvent):void
{
e.currentTarget.hideDropFeedback(e);
});
list1.addEventListener(DragEvent.DRAG_OVER,function(e:DragEvent):void
{
if (e.target.id.replace('_source','') ==
List(e.dragInitiator).id.replace('_source',''))
{
e.currentTarget.showDropFeedback(e);
DragManager.showFeedback(DragManager.MOVE);
}
else
{
e.currentTarget.hideDropFeedback(e);
e.preventDefault();
}
});
list1.addEventListener(DragEvent.DRAG_EXIT,function(e:DragEvent):void {
e.currentTarget.hideDropFeedback(e);
});
var list2:List = new List();
list2.percentWidth = 50;
list2.dataProvider = new ArrayCollection();
list2.allowMultipleSelection = true;
list2.dropEnabled = true;
list2.dragEnabled = true;
list2.dragMoveEnabled = true;
list2.setStyle("alternatingItemColors",["#FF", "#EE"]);
list2.name = value.fieldname;
list2.id = value.fieldname;
list2.addEventListener(DragEvent.DRAG_DROP,function(e:DragEvent):void
{
e.currentTarget.hideDropFeedback(e);
});
list2.addEventListener(DragEvent.DRAG_OVER,function(e:DragEvent):void
{
if (e.target.id == List(e.dragInitiator).id.replace('_source',''))
{
e.currentTarget.showDropFeedback(e);
DragManager.showFeedback(DragManager.MOVE);
}
else
{
e.currentTarget.hideDropFeedback(e);
e.preventDefault();
}
});
list2.addEventListener(DragEvent.DRAG_EXIT,function(e:DragEvent):void {
e.currentTarget.hideDropFeedback(e);
});
hhbox.addChild(list1);
hhbox.addChild(list2);
addChild(hhbox);
--- In flexcoders@yahoogroups.com, "Rafael Faria"
<[EMAIL PROTECTED]> wrote:
>
> I got this working, but if it doesnt use the builtin events when i
> drop it. I just disapear with the items i'm dragging.
>
> I don't want to create new function to the drop event, i want to use
> the builtin one. Any idea why?!
>
> Alex, anything you can help me with this code so i can keep using the
> builtin dragdrop events and just specify the list i want to interact?
>
> DragManager.showFeedback(DragManager.MOVE) doesn't seem to be working
> if you don't put the DragManager in the Enter event.
>
> =/
>
>
> var dumm:ArrayCollection = new
ArrayCollection(['Test1','Test2','Test3']);
> var hhbox:HBox = new HBox();
> hhbox.percentWidth = 100;
>
> var list1:List = new List();
> list1.percentWidth = 50;
> list1.dataProvider = dumm;
> list1.allowMultipleSelection = true;
> list1.dropEnabled = false;
> list1.dragEnabled = true;
> list1.dragMoveEnabled = true;
> list1.setStyle("alternatingItemColors",["#FF", "#EE"]);
> list1.name = value.fieldname + '_source';
> list1.id = value.fieldname + '_source';
> list1.addEventListener(DragEvent.DRAG_ENTER,function(e:DragEvent):void {
> DragManager.acceptDragDrop(UIComponent(e.currentTarget));
> });
>
> list1.addEventListener(DragEvent.DRAG_OVER,function(e:DragEvent):void
> {
> if (e.target.id == List(e.dragInitiator).id + '_source') {
> DragManager.showFeedback(DragManager.MOVE);
> } else {
> DragManager.showFeedback(DragManager.NONE);
> return;
> }
> });
>
>
> var list2:List = new List();
> list2.percentWidth = 50;
> list2.dataProvider = new ArrayCollection();
> list2.allowMultipleSelection = true;
> list2.dropEnabled = false;
> list2.dragEnabled = true;
> list2.dragMoveEnabled = true;
> list2.setStyle("alternatingItemColors",["#FF", "#EE"]);
> list2.name = value.fieldname;
> list2.id = value.fieldname;
> list2.addEventListener(DragEvent.DRAG_ENTER,function(e:DragEvent):void {
> DragManager.acceptDragDrop(UIComponent(e.currentTarget));
> });
>
> list2.addEventListener(DragEvent.DRAG_OVER,function(e:DragEvent):void
> {
>
> if (e.target.id == List(e.dragInitiator).id.replace('_source','')) {
> DragManager.showFeedback(DragManager.MOVE);
> } else {
> DragManager.showFeedback(DragManager.NONE);
> return;
> }
> });
>
> hhbox.addChild(list1);
> hhbox.addChild(list2);
>
>
>
> --- In flexcoders@yahoogroups.com, "Alex Harui" wrote:
> >
> > dragInitiator in the dragEvent
> >
> >
> >
> > From: flexcoders@yahoogroups.com
[mailto