0 Replies Latest reply on Dec 18, 2008 5:46 AM by kaikai4007

    I got a problem in drag and drop options

    kaikai4007
      I want to creat a new component which is exported by Flex Component Kit from Flash ,and when I drag an item from a datagrid and drop it into a canvas, i will new the component and add it to the canvas ,but there is an exception thrown from the class UIMovieClip at 2466,and I find that,the stage property in the function removeFocusEventListeners at 2466 is null.but I don't know how to fix it.

      exceptions shown below:

      TypeError: Error #1009: object or property is null 。
      at mx.flash::UIMovieClip/removeFocusEventListeners()[E:\dev\trunk\frameworks\projects\flash- integration\src\mx\flash\UIMovieClip.as:2466]
      at mx.flash::UIMovieClip/focusOutHandler()[E:\dev\trunk\frameworks\projects\flash-integratio n\src\mx\flash\UIMovieClip.as:2509]


      the function in UIMovieClip class

      / **
      * Remove our focus event listeners.
      */
      private function removeFocusEventListeners():void
      {
      stage.removeEventListener(FocusEvent.KEY_FOCUS_CHANGE, keyFocusChangeHandler); //stage=null
      stage.removeEventListener(FocusEvent.FOCUS_OUT, focusOutHandler);
      focusListenersAdded = false;
      }

      if i create the component whithout draging and droping ,and just add it to the stage,there is no problem.
      I don't know why and how to fix it
      any reply will be helpful!~~