View Single Post
Old 06-11-2009, 11:56 AM   PM User | #2
Inigoesdr
Super Moderator


 
Inigoesdr's Avatar
 
Join Date: Mar 2007
Location: Florida, USA
Posts: 3,601
Thanks: 2
Thanked 397 Times in 390 Posts
Inigoesdr is a jewel in the roughInigoesdr is a jewel in the roughInigoesdr is a jewel in the rough
Here is an example of how you might do it:
Code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
	<mx:Script>
		<![CDATA[
			import mx.controls.Alert;
		
			private function updateDB():void
			{
				var temp:String = '';
				for(var i:String in itemList.dataProvider)
					temp += itemList.dataProvider[i].data + '\n';

				Alert.show(temp);
			}
		]]>
	</mx:Script>

	<mx:List id="itemList"
		dragEnabled="true" 
		dragMoveEnabled="true" 
		dropEnabled="true">
		<mx:ArrayCollection>
			<mx:Object label="Item 1" data="1" />
			<mx:Object label="Item 2" data="2" />
			<mx:Object label="Item 3" data="3" />
			<mx:Object label="Item 4" data="4" />
			<mx:Object label="Item 5" data="5" />
			<mx:Object label="Item 6" data="6" />
		</mx:ArrayCollection>
	</mx:List>
	<mx:Spacer height="30" />
	<mx:Button label="Update"
		click="updateDB()" />
</mx:Application>
I used an ArrayCollection for the data provider, but you could easily adapt this to work with your database/RemoteObject source.
Inigoesdr is offline   Reply With Quote