The dragSource has the data being dropped which should have the name you
want.

 

calculateDropIndex should be the index of the insert

 

________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of timgerr
Sent: Wednesday, July 16, 2008 1:35 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Questions about Drag and Drop Tree Controlls

 

In a drag and drop tree I was wondering how to get the name of the
node being dropped and how to get the name of the node that it was
dropped into? Here is what I have so far,
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml
<http://www.adobe.com/2006/mxml> ">

<!-- Here is the HTTP Request -->
<mx:HTTPService id="xmlLoader"
url="http://127.0.0.1/try/xml/xml_v7.php
<http://127.0.0.1/try/xml/xml_v7.php> " resultFormat="e4x"
contentType="application/xml" 
result="xmlReturned(event)" />
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml
<http://www.adobe.com/2006/mxml> " width="400"
height="300" left="20" top="10">

<mx:Script>
<![CDATA[
import mx.collections.XMLListCollection;
[Bindable]
private var xmlValue:XMLListCollection;
private function xmlReturned(event:Event):void
{
xmlValue = new XMLListCollection(new XMLList(xmlLoader.lastResult));
}

public function DoThis():void
{
trace('I was called');
}
]]>

</mx:Script>

<mx:Button click="xmlLoader.send()" label="get XML"/>
<mx:Tree dataProvider="{xmlValue}" y="100" labelField="@label"
width="300" showRoot="true"
dragEnabled="true" dropEnabled="true" dragMoveEnabled="true"
dragComplete="DoThis()"
/>
</mx:Canvas>
</mx:Application>

I do not know what to put for the DoThis function.
Thanks for the help,
timgerr

 

Reply via email to