Skip navigation
Home/Support/

Forums

119 Views 2 Replies Latest reply: Jul 7, 2011 3:35 PM by kevin.gaffney RSS
kevin.gaffney Calculating status... 2 posts since
Jul 7, 2011
Currently Being Moderated

Jul 7, 2011 6:55 AM

Scroller null focusManager exception

Currently working on a project that needs to take a component & pop it out of it's parent to the top level app. I am using a spark textAera. Initially when the textArea is "unpopped out" the textAera works fine. However, when it is popped out and a user then focuses in on the textArea a null object reference is thrown from the Scroller class focusInHandler method.

 

Currently to remove and pop out the component the code I am using is:

 

IVisualElementContainer(resizeComponent.parent).removeElement(resizeCo mponent);

FlexGlobals.topLevelApplication.systemManager.addChild(resizeComponent );

 

where resizeComponent is the component I want to pop out.

 

Exception occurs when focusing in, Scroller.as:

  

override protected function focusInHandler(event:FocusEvent):void

    {

        super.focusInHandler(event);

       

        // When we gain focus, make sure the focused element is visible

        if (viewport && ensureElementIsVisibleForSoftKeyboard)

        {

            var elt:IVisualElement = focusManager.getFocus() as IVisualElement; //null object excpetion thrown here

            lastFocusedElement = elt;

        }

    }

 

What am I doing wrong?

 

Thanks,

Kevin

More Like This

  • Retrieving data ...

Bookmarked By (0)

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points