here is example code of what I am seeing.  Why doesn't a leaf carry the data
in the drag event?

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"; layout="vertical">

   <mx:Script>
       <![CDATA[
           import mx.events.DragEvent;
           import mx.controls.Alert;
           import mx.core.DragSource;
           import mx.utils.ObjectUtil;

           public function handleMe( event:DragEvent) : void    {
               var ds:Array = event.dragSource.dataForFormat("treeItems")
as Array;
               Alert.show(ObjectUtil.toString(ds));
           }
       ]]>
   </mx:Script>

       <mx:XML id="treeData">
       <node label="Mail Box">
           <node label="Inbox">
               <node label="Marketing"/>
               <node label="Product Management"/>
               <node label="Personal"/>
           </node>
           <node label="Outbox">
               <node label="Professional"/>
               <node label="Personal"/>
           </node>
           <node label="Spam"/>
           <node label="Sent"/>
       </node>
   </mx:XML>

   <mx:Tree id="myTree"
       labelField="@label"
       showRoot="false"
       itemRenderer="renderer.ActivityTaskTree"
       dataProvider="{treeData}"
       dragEnabled="true" />



    <mx:TextArea text="drop enter here" dragEnter="handleMe( event )">

    </mx:TextArea>

</mx:Application>


On 3/13/07, Douglas Knudsen <[EMAIL PROTECTED]> wrote:

I have a Tree, and a dream it seems.  The Tree's dataProvider is XML
based.  The Tree looks lovely and bares leaves.  I set dragEnabled = true.
On another object in my app I am capturing the dragEnter event with this
mehtod

private    function doDragEnter(event : DragEvent) : void {

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

             Alert.show (ObjectUtil.toString(ds));return;

         }

Now, if I drag a leaf over this object, the Alert above displays
(Array)#0
[0]

as in it does NOT display the XML frag represented by the leaf.

If I drag a branch, item with the folder icon, the Alert above displays
(Array)#0
[0]<node label=.......</node>

it displays the XML frag for the branch and all its children?

WT?

--
Douglas Knudsen
http://www.cubicleman.com
this is my signature, like it?




--
Douglas Knudsen
http://www.cubicleman.com
this is my signature, like it?

Reply via email to