refer the following links
http://livedocs.adobe.com/flex/3/html/help.html?content=dragdrop_4.html#174194
http://livedocs.adobe.com/flex/3/html/help.html?content=dragdrop_6.html#247937
http://livedocs.adobe.com/flex/3/html/help.html?content=dragdrop_7.html#247940
http://livedocs.adobe.com/flex/3/html/help.html?content=dragdrop_8.html#225115
Best Regards,
Sathya Moorthi K | MCA,
mailto: ksathyanm@gmail.com
hi,
i have problem here. i have list of images to be arranged according to the ranking. however, i cant drop the image. below is the code. may i know where's the mistake?
__________________________________________________________
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical"
horizontalAlign="center"
backgroundGradientAlphas="[1.0, 1.0]"
backgroundGradientColors="[#FFFFFF, #FFFFFF]"
creationComplete="service.send()" viewSourceURL="srcview/index.html">
<mx:Script>
<![CDATA[
import mx.core.DragSource;
import mx.collections.ArrayCollection;
import mx.rpc.events.ResultEvent;
import mx.events.DragEvent;
import mx.managers.DragManager;
import mx.core.UIComponent
[Bindable]
private var images:ArrayCollection;
private function serviceHandler(event:ResultEvent):void{
images = event.result.gallery.image;
}
private function initiateDrag(event:MouseEvent,value:String):void{
var dragInitiator:Image= event.currentTarget as Image;
var dragSource:DragSource = new DragSource();
dragSource.addData(value, 'value');
var dragProxy:Image = new Image();
dragProxy.source = event.currentTarget.source;
dragProxy.width = 100 ;
dragProxy.height = 100 ;
DragManager.doDrag(dragInitiator, dragSource, event, dragProxy);
}
private function dragEnterHandler(event:DragEvent):void {
var dropTarget:List=event.currentTarget as List;
if (event.dragSource.hasFormat('value')) {
DragManager.acceptDragDrop(dropTarget);
}
{
DragManager.acceptDragDrop(UIComponent(event.target));
}
}
]]>
</mx:Script>
<mx:HTTPService id="service" url="datas.xml" result="serviceHandler(event)"/>
<mx:Label text="Drag a thumbnail image inside the black box and drop it to display its bigger version"/>
<mx:HBox>
<mx:Repeater dataProvider="{images}" id="rep">
<mx:Image source="assets/thumbs/{rep.currentItem}"
mouseMove="initiateDrag(event,event.currentTarget.getRepeaterItem())" />
</mx:Repeater>
</mx:HBox>
<mx:List
iconField="image_pic"
dragEnabled="true"
dropEnabled="true"
dragMoveEnabled="true"
rowCount="1"
columnCount="1"
rowHeight="60"
columnWidth="60"
verticalScrollPolicy="off"
alternatingItemColors="[#D3D3D3, #DDDADA]"
width="81" height="63"
paddingLeft="1" paddingRight="1" paddingTop="1" paddingBottom="1"/>
<mx:List
iconField="image_pic"
dragEnabled="true"
dropEnabled="true"
dragMoveEnabled="true"
rowCount="1"
columnCount="1"
rowHeight="60"
columnWidth="60"
verticalScrollPolicy="off"
alternatingItemColors="[#D3D3D3, #DDDADA]"
width="81" height="63"
paddingLeft="1" paddingRight="1" paddingTop="1" paddingBottom="1"/>
<mx:List
iconField="image_pic"
dragEnabled="true"
dropEnabled="true"
dragMoveEnabled="true"
rowCount="1"
columnCount="1"
rowHeight="60"
columnWidth="60"
verticalScrollPolicy="off"
alternatingItemColors="[#D3D3D3, #DDDADA]"
width="81" height="63"
paddingLeft="1" paddingRight="1" paddingTop="1" paddingBottom="1"/>
<mx:List
iconField="image_pic"
dragEnabled="true"
dropEnabled="true"
dragMoveEnabled="true"
rowCount="1"
columnCount="1"
rowHeight="60"
columnWidth="60"
verticalScrollPolicy="off"
alternatingItemColors="[#D3D3D3, #DDDADA]"
width="81" height="63"
paddingLeft="1" paddingRight="1" paddingTop="1" paddingBottom="1"/>
</mx:Application>
thnks
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Alternative FAQ location: https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com