TypeError: Error #1009: Cannot access a property or method of a null object reference.
at spark.components::Scroller/focusInHandler()[E:\\dev\\4.y\\frameworks\\proje
I ran into the same issue, and the root cause was that PopUpManager/PopUpAnchor would not properly set the focusManager if the component being popped up does not implement the IFocusManagerContainer
interface. After implementing such interface, the problem goes away.
I know this is old but here is a solution that works for me.
dataGrid.scroller.addEventListener(FocusEvent.FOCUS_IN, dataGridFocusInHandler, false, 1);
and
protected function dataGridFocusInHandler(event:FocusEvent):void {
if(dataGrid.scroller.focusManager == null) {
event.stopImmediatePropagation();
}
}
could also been applied to a list I anticipate
Cheers Adz
I've got the same problem in one of my projects and looks like it's known bug of SDK. In my case I just wrote custom Scroller class where added focusManager != null check. Something like
package components
{
import flash.events.FocusEvent;
import spark.components.Scroller;
public class MyScroller extends Scroller
{
public function MyScroller()
{
super();
}
override protected function focusInHandler(event:FocusEvent):void
{
if(focusManager != null) {
super.focusInHandler(event);
}
}
}
}
Best regrads, Roman
I was having this issue, and it turns out that it was caused by some buttons I had as item renderers in my grid. These buttons would change the view to a different section, and apparently keep focus after pressed, causing all sorts of trouble. I set them to focusEnabled=false, and it solved the problem.