Bit of a confusing one this. I have 2 simple lists with the ability to drag/drop from one to the other. When these lists are in standard components all is fine. The dragEnter event is dispatched when you hover over any point of the other list. However when this is in a viewstack I cannot drag a list item in the first 1cm or so of the list – dragEnter is not called until you drag about 1cm below the top of the list. This seem to be compounded the more layout components the list is inside.

 

I’ve some sample code below – simple stuff which demonstrates the odd behaviour. Removing the viewstack removes the small area at the top of the list which is not able to accept a drag item. Have you seen anything like this?

 

 

<?xml version="1.0" encoding="utf-8"?>

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="created()">

            <mx:Script>

                        <![CDATA[

                                    import mx.collections.IList;

                                    import mx.events.DragEvent;

                                    import mx.collections.ArrayCollection;

                                    import mx.managers.DragManager;

                                    [Bindable] private var ac : ArrayCollection;

                                   

                                    private function created() : void

                                    {

                                                var ar : Array = new Array("test","test2");

                                                ac = new ArrayCollection(ar);

                                    }

                                    private function doDragEnter(event:DragEvent):void

                                    {

                                                var dragInitiator:List=List(event.currentTarget);

                                                DragManager.acceptDragDrop(dragInitiator);

                                    }

                                    private function doDragDrop(event:DragEvent):void

                                    {       

 

                                                var dropTarget:List=List(event.currentTarget);           

 

                                                var items:Array=event.dragSource.dataForFormat("items") as Array;

 

                                                var dropLoc:int=dropTarget.calculateDropIndex(event);       

 

                                                for (var i:uint=0; i < items.length; i++)    

                                                {

                                                            IList(dropTarget.dataProvider).addItemAt(items[i], dropLoc );

                                                }

                                    }

                        ]]>

            </mx:Script>

            <mx:ViewStack width="100%" height="100%">

                        <mx:HBox width="100%" height="100%">

                                    <mx:List x="31" y="53" width="100" dataProvider="{ac}" dragDrop="doDragDrop(event)" dragEnabled="true" dragMoveEnabled="true" dragEnter="doDragEnter(event)"></mx:List>

                                    <mx:List x="307" y="53" width="100" dataProvider="{new ArrayCollection()}" dragDrop="doDragDrop(event)" dragEnabled="true" dragMoveEnabled="true" dragEnter="doDragEnter(event)"></mx:List>

                        </mx:HBox>

            </mx:ViewStack>

</mx:Application>

 

 

------------------------------------
Steve Cox
Senior Online Application Developer
Quba New Media
www.quba.co.uk
t: 0114 279 7779
f: 0114 272 2854
e:
[EMAIL PROTECTED]

The Maltings
81 Burton Road
Sheffield S3 8BX
------------------------------------

Quba's e-mail disclaimer

The information contained in this email and any attachments is intended only for the use of the individual to whom it is addressed and may contain information that is privileged and confidential, the disclosure of which is strictly prohibited by law.If you have received this e-mail in error, please notify the sender immediately and delete this e-mail.

Any views expressed in this e-mail are those of the individual sender. This email message and any attached files have been scanned for the presence of computer viruses. However, you are advised that you open any attachments at your own risk. We thank you for your co-operation.

Quba New Media Ltd
Registered in
England & Wales No. 4038459
Registered Address: The Maltings,
81 Burton Road, Sheffield, South Yorkshire, S3 8BX

 

__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Software development tool Software development Software development services
Home design software Software development company

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___

Reply via email to