Adobe Air: scroller throws error when changes focus between different applications

前端 未结 4 1523
梦毁少年i
梦毁少年i 2021-01-21 06:04
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         


        
4条回答
  •  迷失自我
    2021-01-21 06:44

    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

提交回复
热议问题