title: Flex 3 TileList Drag/Drop/Re-order Exception. How do I rearrange tiles?
body: <p>I’m in need of some dire help here.  I'm writing an application in Flex 3 that utilizes a TileList with a custom itemRenderer to display info from a service.  Unfortunately, I'm running into an exception with the drag/drop/rearrange portion of the TileList.  With dragEnabled and dragMoveEnabled, I receive a fully-reproducible exception when trying to rearrange the tiles in the control:</p>
  
  <p><strong>Exception:</strong></p>
  
  <blockquote>
    <p>ArgumentError: Error #2004: One of the parameters is invalid.
        at flash.utils::ByteArray/writeObject()
        at flash.desktop::Clipboard/putSerialization()
        at flash.desktop::Clipboard/convertFlashFormat()
        at flash.desktop::Clipboard/setData()
        at mx.managers::NativeDragManagerImpl/doDrag()[C:\autobuild\3.2.0\frameworks\projects\airframework\src\mx\managers\NativeDragManagerImpl.as:282]
        at mx.managers::DragManager$/doDrag()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\managers\DragManager.as:243]
        at mx.controls.listClasses::ListBase/dragStartHandler()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\controls\listClasses\ListBase.as:9085]
        at flash.events::EventDispatcher/dispatchEventFunction()
        at flash.events::EventDispatcher/dispatchEvent()
        at mx.core::UIComponent/dispatchEvent()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:9298]
        at mx.controls.listClasses::ListBase/mouseMoveHandler()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\controls\listClasses\ListBase.as:8822]</p>
  </blockquote>
  
  <p><strong>Here’s the code for the custom TileList:</strong></p>
  
  <pre><code>&lt;cmp:MemoTileList itemRenderer="CoverNote" dragEnabled="true" itemsChangeEffect="{this.myTileListEffect}" backgroundAlpha="0" id="memoList" dataProvider="{this.management.memoCollection}" right="0.049865723" left="0.05" top="0" bottom="0" focusEnabled="false" focusAlpha="0" borderStyle="none" direction="horizontal" textAlign="left" allowMultipleSelection="false" showEffect="fadeIn" hideEffect="fadeOut" effectEnd="fadeOut" effectStart="fadeIn" dragDrop="onReorder(event)" dragMoveEnabled="true"&gt;
  &lt;/cmp:MemoTileList&gt;
  </code></pre>
  
  <p><strong>Here's the code for the onReorder(event):</strong></p>
  
  <pre><code>private function onReorder(event:DragEvent):void{
              var indexStartDrag:Number = event.currentTarget.selectedIndex
              var indexStopDrag:Number = this.memoList.calculateDropIndex(event);
              Alert.show(indexStopDrag.toString());
  
  }
  </code></pre>
  
  <p>When I try to debug, the debugger doesn't seem to indicate to me any piece of code that might be faulty.  </p>
  
  <p>Can anyone point me the right direction as to how to solve this?</p>
  
  <p>Thanks in advance!</p>
  
  <p>Tajddin</p>