You need to have something in the HBox for this to work the way you are
expecting. All of the Container components work this way. Because the Panel
comes with children, it will seem to work as expected, but if you try a Form
or any variation of Box, Canvas, etc... it does not.

So, in your HBox, add a child (control) and try it again.

<mx:HBox height="40" width="80"
dragDrop="dragDropHandler(event)"
dragEnter="dragEnterHandler(event)"
dragExit="dragExitHandler(event)"
borderColor="#000000"
cornerRadius="15" borderStyle="solid">
    <mx:Label text="Drag Here"/>
</mx:HBox>

Regards,
Rob

On Jan 28, 2008 11:37 AM, netdeep <[EMAIL PROTECTED]> wrote:

>
> I am trying to drag a button from one panel to an HBox inside another
> panel and the
> dragEnter only fires on intersecting with the BORDER of the HBox and not
> while inside the
> HBox itself. If I drag it quickly, if I drag it slowly, it registers a
> dragEnter event and then
> immediated the dragExit event fires as I move inside the HBox. Does anyone
> know what is
> going on here?
>
> public function dragIt(event:MouseEvent, value:uint):void {
> var dragInitiator:Button = event.currentTarget as Button;
> var dragSource:DragSource = new DragSource();
> var dragProxy:Button = new Button();
> dragProxy.label = dragInitiator.label;
>
> DragManager.doDrag(dragInitiator, dragSource, event, dragProxy);
> }
>
> private function dragEnterHandler(event:DragEvent):void {
> var dropTarget:HBox = event.currentTarget as HBox;
> dropTarget.setStyle("borderThickness", 3);
> dropTarget.setStyle("borderColor", "#000000");
>
> DragManager.acceptDragDrop(dropTarget);
> }
>
> private function dragExitHandler(event:DragEvent):void {
> var dropTarget:HBox = event.currentTarget as HBox;
>
> dropTarget.setStyle("borderThickness", 1);
> dropTarget.setStyle("borderColor", "#cccccc");
> }
>
> private function dragDropHandler(event:DragEvent):void {
> var dropTarget:HBox = event.currentTarget as HBox;
> dropTarget.setStyle("borderThickness", 1);
> dropTarget.setStyle("borderColor", "#cccccc");
> // ... code to process drop ... //
> }
>
> <mx:HBox height="40" width="40"
> dragDrop="dragDropHandler(event)"
> dragEnter="dragEnterHandler(event)"
> dragExit="dragExitHandler(event)"
> borderColor="#cccccc"
> verticalAlign="middle" horizontalAlign="center"
> cornerRadius="15" borderStyle="solid"/>
>
>  
>



-- 
-- 
Regards,
Rob Rusher

Adobe Certified AIR, Connect, ColdFusion MX and Flex Instructor
m: 303-885-7044
im: robrusher

Reply via email to