Apache flex Flex 3 TileList拖放/重新排序异常。如何重新排列瓷砖?
我需要一些紧急的帮助。我正在用Flex3编写一个应用程序,它利用一个具有自定义itemRenderer的TileList来显示来自服务的信息。不幸的是,我在TileList的拖放/重新排列部分遇到了一个异常。启用dragEnabled和dragMoveEnabled后,在尝试重新排列控件中的平铺时,我收到一个完全可复制的异常: 例外情况:Apache flex Flex 3 TileList拖放/重新排序异常。如何重新排列瓷砖?,apache-flex,actionscript-3,air,tilelist,Apache Flex,Actionscript 3,Air,Tilelist,我需要一些紧急的帮助。我正在用Flex3编写一个应用程序,它利用一个具有自定义itemRenderer的TileList来显示来自服务的信息。不幸的是,我在TileList的拖放/重新排列部分遇到了一个异常。启用dragEnabled和dragMoveEnabled后,在尝试重新排列控件中的平铺时,我收到一个完全可复制的异常: 例外情况: <cmp:MemoTileList itemRenderer="CoverNote" dragEnabled="true" itemsChangeEff
<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">
</cmp:MemoTileList>
private function onReorder(event:DragEvent):void{
var indexStartDrag:Number = event.currentTarget.selectedIndex
var indexStopDrag:Number = this.memoList.calculateDropIndex(event);
Alert.show(indexStopDrag.toString());
}
ArgumentError:错误#2004:其中一个参数无效。
在flash.utils::ByteArray/writeObject()中
在flash.desktop::Clipboard/putSerialization()中
在flash.desktop::Clipboard/convertFlashFormat()中
在flash.desktop::Clipboard/setData()中
位于mx.managers::nativedFragmanagerImpl/doDrag()[C:\autobuild\3.2.0\frameworks\projects\airframework\src\mx\managers\nativedFragmanagerImpl.as:282]
位于mx.managers::DragManager$/doDrag()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\managers\DragManager.as:243]
位于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()
位于mx.core::UIComponent/dispatchEvent()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:9298]
位于mx.controls.listClasses::ListBase/mouseMoveHandler()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\controls\listClasses\ListBase.as:8822]
以下是自定义TileList的代码:
<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">
</cmp:MemoTileList>
private function onReorder(event:DragEvent):void{
var indexStartDrag:Number = event.currentTarget.selectedIndex
var indexStopDrag:Number = this.memoList.calculateDropIndex(event);
Alert.show(indexStopDrag.toString());
}
当我尝试调试时,调试器似乎没有向我指出任何可能有错误的代码
有人能给我指出解决这个问题的正确方向吗
提前谢谢
塔伊丁
ArgumentError: Error #2004: One of the parameters is invalid.
是那些“可以成为任何人”的信息之一;(
我记得不久前我就有了它,拼错了一些函数,Eclipse编译得很好,尽管它本不应该….(重新启动Eclipse在这里很有帮助,但我花了一段时间才发现….)
我的建议是删除代码,直到代码正常工作,然后重新添加,同时检查参数的数量。这确实是一个“奇怪”的错误,你知道其中的一个,“必须按特定顺序调用这两个函数”等等。祝你好运
关于#2004的其他故事
这个很有趣;
您似乎已经陷入了AIR Runtime的一个bug。错误发生在NativedFragmanager的某个深处,您的OnReOrder方法似乎与此无关。我想说,互动程序列表的内容是破坏AIR Runtime的东西。