[flexcoders] Re: Odd DragOver Problem
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 flexcoders@yahoogroups.com, "droponrcll" wrote: > > > > --- In flexcoders@yahoogroups.com, Alex Harui wrote: > > > > Double check your logic about when you call acceptDragDrop > > Also, are you overriding createChildren? If so, please post your code. >
[flexcoders] Re: Odd DragOver Problem
Thank you for the help. I have a "dragEnterHandler" function which is called upon the main container's "DragEvent.DRAG_ENTER" event. The dragEnterHandler is the only place where acceptDragDrop is called, but that handler is only called when I'm on the left side of the container. I'm looking through the Flex source now to see when exactly the DRAG_ENTER event is dispatched. It's worth noting that the dead zone changes as the size of the control changes. It's not half of the container size, but around 60% of the length. Thank you again for your assistance. --- In flexcoders@yahoogroups.com, Alex Harui wrote: > > Double check your logic about when you call acceptDragDrop > > Alex Harui > Flex SDK Developer > Adobe Systems Inc.<http://www.adobe.com/> > Blog: http://blogs.adobe.com/aharui > > From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On > Behalf Of bgamblin > Sent: Tuesday, November 10, 2009 8:54 AM > To: flexcoders@yahoogroups.com > Subject: [flexcoders] Re: Odd DragOver Problem > > > > Well, I hate to sound ditzy here, but I didn't actually fix all the problems > by changing the background color. That fix stabilized the problem, making it > so that the dead zones no longer seem random. However, it is now a situation > where there is a definite cutoff about midway through the main HBox. Anything > to the left of center will create a DragOver event. Anything to the right, > won't. > > Has anybody seen this issue? > > --- In flexcoders@yahoogroups.com<mailto:flexcoders%40yahoogroups.com>, > "bgamblin" wrote: > > > > Never mind. I figured it out. I totally forgot that for something to be > > droppable, it has to be a visible component. In this case, setting the > > background color to anything at all makes it a droppable target. > > > > Sorry for the interruption. > > > > > > --- In flexcoders@yahoogroups.com<mailto:flexcoders%40yahoogroups.com>, > > "bgamblin" wrote: > > > > > > Say you have an HBox, and inside that HBox you have lots of little child > > > HBoxes. Now, you want to rearrange the child HBoxes using drag and drop. > > > Using Flex, it's pretty easy to enable drag/drop support. However, the > > > dragover event seems to fire at odd points. > > > > > > As I drag a child HBox around the main HBox, I sometimes see the invalid > > > drag icon, even though it should be valid. If it disallowed dragging one > > > child over another, I could understand that. But even that seems random, > > > with some portions of the children showing as valid drag targets, and > > > others not. With a small number of children, it was odd but not > > > debilitating. With a large number of children, it became entirely > > > untenable. If I have ten children, I can't drop the items anywhere except > > > the first half of it's width. > > > > > > Is there another element to this that affects where an object becomes a > > > drop target or not? Variable width perhaps? Padding? I'm at a loss. > > > > > >
[flexcoders] Re: Odd DragOver Problem
--- In flexcoders@yahoogroups.com, Alex Harui wrote: > > Double check your logic about when you call acceptDragDrop Also, are you overriding createChildren? If so, please post your code.
RE: [flexcoders] Re: Odd DragOver Problem
Double check your logic about when you call acceptDragDrop Alex Harui Flex SDK Developer Adobe Systems Inc.<http://www.adobe.com/> Blog: http://blogs.adobe.com/aharui From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of bgamblin Sent: Tuesday, November 10, 2009 8:54 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Odd DragOver Problem Well, I hate to sound ditzy here, but I didn't actually fix all the problems by changing the background color. That fix stabilized the problem, making it so that the dead zones no longer seem random. However, it is now a situation where there is a definite cutoff about midway through the main HBox. Anything to the left of center will create a DragOver event. Anything to the right, won't. Has anybody seen this issue? --- In flexcoders@yahoogroups.com<mailto:flexcoders%40yahoogroups.com>, "bgamblin" wrote: > > Never mind. I figured it out. I totally forgot that for something to be > droppable, it has to be a visible component. In this case, setting the > background color to anything at all makes it a droppable target. > > Sorry for the interruption. > > > --- In flexcoders@yahoogroups.com<mailto:flexcoders%40yahoogroups.com>, > "bgamblin" wrote: > > > > Say you have an HBox, and inside that HBox you have lots of little child > > HBoxes. Now, you want to rearrange the child HBoxes using drag and drop. > > Using Flex, it's pretty easy to enable drag/drop support. However, the > > dragover event seems to fire at odd points. > > > > As I drag a child HBox around the main HBox, I sometimes see the invalid > > drag icon, even though it should be valid. If it disallowed dragging one > > child over another, I could understand that. But even that seems random, > > with some portions of the children showing as valid drag targets, and > > others not. With a small number of children, it was odd but not > > debilitating. With a large number of children, it became entirely > > untenable. If I have ten children, I can't drop the items anywhere except > > the first half of it's width. > > > > Is there another element to this that affects where an object becomes a > > drop target or not? Variable width perhaps? Padding? I'm at a loss. > > >
[flexcoders] Re: Odd DragOver Problem
Well, I hate to sound ditzy here, but I didn't actually fix all the problems by changing the background color. That fix stabilized the problem, making it so that the dead zones no longer seem random. However, it is now a situation where there is a definite cutoff about midway through the main HBox. Anything to the left of center will create a DragOver event. Anything to the right, won't. Has anybody seen this issue? --- In flexcoders@yahoogroups.com, "bgamblin" wrote: > > Never mind. I figured it out. I totally forgot that for something to be > droppable, it has to be a visible component. In this case, setting the > background color to anything at all makes it a droppable target. > > Sorry for the interruption. > > > --- In flexcoders@yahoogroups.com, "bgamblin" wrote: > > > > Say you have an HBox, and inside that HBox you have lots of little child > > HBoxes. Now, you want to rearrange the child HBoxes using drag and drop. > > Using Flex, it's pretty easy to enable drag/drop support. However, the > > dragover event seems to fire at odd points. > > > > As I drag a child HBox around the main HBox, I sometimes see the invalid > > drag icon, even though it should be valid. If it disallowed dragging one > > child over another, I could understand that. But even that seems random, > > with some portions of the children showing as valid drag targets, and > > others not. With a small number of children, it was odd but not > > debilitating. With a large number of children, it became entirely > > untenable. If I have ten children, I can't drop the items anywhere except > > the first half of it's width. > > > > Is there another element to this that affects where an object becomes a > > drop target or not? Variable width perhaps? Padding? I'm at a loss. > > >
[flexcoders] Re: Odd DragOver Problem
Never mind. I figured it out. I totally forgot that for something to be droppable, it has to be a visible component. In this case, setting the background color to anything at all makes it a droppable target. Sorry for the interruption. --- In flexcoders@yahoogroups.com, "bgamblin" wrote: > > Say you have an HBox, and inside that HBox you have lots of little child > HBoxes. Now, you want to rearrange the child HBoxes using drag and drop. > Using Flex, it's pretty easy to enable drag/drop support. However, the > dragover event seems to fire at odd points. > > As I drag a child HBox around the main HBox, I sometimes see the invalid drag > icon, even though it should be valid. If it disallowed dragging one child > over another, I could understand that. But even that seems random, with some > portions of the children showing as valid drag targets, and others not. With > a small number of children, it was odd but not debilitating. With a large > number of children, it became entirely untenable. If I have ten children, I > can't drop the items anywhere except the first half of it's width. > > Is there another element to this that affects where an object becomes a drop > target or not? Variable width perhaps? Padding? I'm at a loss. >