2 Replies Latest reply on Apr 9, 2010 9:22 AM by invulse1

    Error when dragging tree item - get firstVisibleItem

    invulse1

      I have been trying to debug this for hours but I can't determine any reason behind this error.

       

      I have a tree which I am populating with Array collections.  The items in the array collection have views which I am adding to a canvas, however when I add the view to the canvas, when I try to drag any element in the tree I immediately receive this error:

       

      TypeError: Error #1010: A term is undefined and has no properties.

      at mx.controls::Tree/get firstVisibleItem()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\controls\Tree. as:764]

      at ObjectOutput/writeObject()

      at mx.collections::ArrayList/writeExternal()[C:\autobuild\3.2.0\frameworks\projects\framewor k\src\mx\collections\ArrayList.as:452]

      at mx.collections::ArrayCollection/writeExternal()[C:\autobuild\3.2.0\frameworks\projects\fr amework\src\mx\collections\ArrayCollection.as:144]

      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\airfra mework\src\mx\managers\NativeDragManagerImpl.as:282]

      at mx.managers::DragManager$/doDrag()[C:\autobuild\3.2.0\frameworks\projects\framework\src\m x\managers\DragManager.as:243]

      at mx.controls.listClasses::ListBase/dragStartHandler()[C:\autobuild\3.2.0\frameworks\projec ts\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\projec ts\framework\src\mx\controls\listClasses\ListBase.as:8822]

      If I dont add my view to the canvas I don't get this error when trying to re-order, but I cant find any reasoning behind this error coming up.  When debugging the error it seems like the property listItems in Tree.as is causing the error, but in the debugger listItems is not null, why would this be happening?