I'm not overriding CreateChildren, but I'd be glad to post the code I'm using.
Here's the function for when the main container is created:
public function ColumnArranger()
{
super();
this.setStyle("borderStyle","solid");
this.setStyle("borderThickness","1");
this.setStyle("backgroundColor","#1B4B6A");
this.percentWidth = 100;
addEventListener( DragEvent.DRAG_ENTER, dragEnterHandler );
addEventListener( DragEvent.DRAG_DROP, dragDropHandler );
addEventListener( DragEvent.DRAG_OVER, dragOverHandler );
addEventListener( DragEvent.DRAG_EXIT, dragExitHandler );
}
This is the function for the addition of children:
public function populateData(columnArray:Array):void
{
var currBox:HBox = null;
var currLabel:Label = null;
var currCheckBox:CheckBox = null;
for each (var currValues:Object in columnArray) {
currBox = new HBox();
currBox.setStyle("horizontalAlign","center");
currBox.setStyle("borderStyle","solid");
currBox.setStyle("borderThickness","1");
currBox.percentWidth=100;
currLabel = new Label();
currLabel.text = currValues.name;
currBox.addChild(currLabel);
currBox.addEventListener( MouseEvent.MOUSE_MOVE, beginDrag );
this.addChild(currBox);
}
}
Then this is the function for the child's MouseMove:
public function beginDrag( mouseEvent:MouseEvent ):void
{
if (mouseEvent.buttonDown) {
var dragInitiator:IUIComponent = mouseEvent.currentTarget as
IUIComponent;
var dragSource:DragSource = new DragSource();
DragManager.doDrag( dragInitiator, dragSource, mouseEvent, null
);
}
}
--- In [email protected], "droponrcll" <amyblankens...@...> wrote:
>
>
>
> --- In [email protected], Alex Harui <aharui@> wrote:
> >
> > Double check your logic about when you call acceptDragDrop
>
> Also, are you overriding createChildren? If so, please post your code.
>