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 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 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 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]
Are the arraycollection items display objects? That might not work.
The items in the array collection are just subclasses of object that have a label property, children getter and a view property which is of a UIComponent type, the error only happens when the view property is added as a child somewhere. The error seems to occur when the array does writeExternal. I have no idea why there is an error, because when debugging the writeExternal says no source and I cannot debug what is happening.