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

前端 未结 4 1569
梦毁少年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:58

    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

提交回复
热议问题