0 Replies Latest reply on Jun 17, 2010 2:52 AM by puneet_iitg

    Weird behaviour in dragging from tilelist to list

    puneet_iitg

      Hi All,

       

      I am trying to drag an item from a tilelist into a list but I am encountering this error:

       

      TypeError: Error #1009: Cannot access a property or method of a null object reference.
          at components::TileListItem/set data()[C:\Documents and Settings\puneet\Adobe Flash Builder 4 Plug-in\LatestSeatBeltProject\src\components\TileListItem.mxml:35]
          at mx.controls.listClasses::ListItemDragProxy/createChildren()[C:\autobuild\3.5.0\frameworks \projects\framework\src\mx\controls\listClasses\ListItemDragProxy.as:90]
          at mx.core::UIComponent/initialize()[C:\autobuild\3.5.0\frameworks\projects\framework\src\mx \core\UIComponent.as:5381]
          at mx.core::UIComponent/http://www.adobe.com/2006/flex/mx/internal::childAdded()[C:\autobuild\3.5.0\frameworks\pro jects\framework\src\mx\core\UIComponent.as:5278]
          at mx.core::UIComponent/addChild()[C:\autobuild\3.5.0\frameworks\projects\framework\src\mx\c ore\UIComponent.as:4980]
          at mx.managers::DragManagerImpl/doDrag()[C:\autobuild\3.5.0\frameworks\projects\framework\sr c\mx\managers\DragManagerImpl.as:281]
          at mx.managers::DragManager$/doDrag()[C:\autobuild\3.5.0\frameworks\projects\framework\src\m x\managers\DragManager.as:243]
          at mx.controls.listClasses::ListBase/dragStartHandler()[C:\autobuild\3.5.0\frameworks\projec ts\framework\src\mx\controls\listClasses\ListBase.as:9190]
          at flash.events::EventDispatcher/dispatchEventFunction()
          at flash.events::EventDispatcher/dispatchEvent()
          at mx.core::UIComponent/dispatchEvent()[C:\autobuild\3.5.0\frameworks\projects\framework\src \mx\core\UIComponent.as:9440]
          at mx.controls.listClasses::ListBase/mouseMoveHandler()[C:\autobuild\3.5.0\frameworks\projec ts\framework\src\mx\controls\listClasses\ListBase.as:8927]

       

       

      BACKGROUND INFORMATION:

       

      Source: (Tilelist) has a custom itemrenderer where I have overriden the set data function as:

       

      override public function set data(value:Object):void{
                      super.data = value;
      }

       

      Destination: (List) on which I have defined a custom item renderer displaying an image and a label in each item.

      I have set dragenabled property of source and dropenabled property of destination to be true. It seems as if the set function is causing problems when the object chosen is null.

       

      Now, as soon as i drag an item from the tilelist into the list, the aforementioned error pops up but after dismissing all or clicking on the continue button, I am still able to copy the dragged content from source to the destination. Can anyone please explain what's happening ?

       

      Thanks,

      Puneet.