Search code examples
flashapache-flexflex-spark

Using a vgroup as a drop target in Flex


Is it possible to use a VGroup as a drop target in flex? I like the functionality of a vgroup (adding elements easily, etc) but I haven't found a way to get it to register when things are dropped on it.

Is this possible?


Solution

  • The solution in my case was to surround the whole thing in a VBox, which does support dragEnter and dragDrop, which makes configuration easier.

        <s:Group top="30" width="100%" height="100%">
            <mx:VBox id="dropTargetVBox" label="if" 
                    width="100%" height="100%"
                    borderStyle="none" dragEnter="dragEnterHandler(event)" dragDrop="dragDropHandler(event)">
                <s:Scroller width="100%" height="100%">
                    <s:VGroup id="lst" gap="0" height="100%" width="100%">
                    </s:VGroup>
                </s:Scroller>
            </mx:VBox>
        </s:Group>
    

    And on top of this, also allows me to put other things inside (which is desirable for what I'm trying to do).