Adobe Air:在不同应用程序之间更改焦点时,滚动条会引发错误 [英] Adobe Air: scroller throws error when changes focus between different applications

查看:38
本文介绍了Adobe Air:在不同应用程序之间更改焦点时,滚动条会引发错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at spark.components::Scroller/focusInHandler()[E:\dev\4.y\frameworks\projects\spark\src\spark\components\Scroller.as:2139]
    at flash.display::Stage/set focus()
    at mx.core::UIComponent/setFocus()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\UIComponent.as:9905]
    at spark.components::RichEditableText/setFocus()[E:\dev\4.y\frameworks\projects\spark\src\spark\components\RichEditableText.as:3126]
    at spark.components.supportClasses::SkinnableTextBase/setFocus()[E:\dev\4.y\frameworks\projects\spark\src\spark\components\supportClasses\SkinnableTextBase.as:1874]
    at mx.managers::FocusManager/activateWindowHandler()[E:\dev\4.y\frameworks\projects\framework\src\mx\managers\FocusManager.as:740]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at mx.core::UIComponent/dispatchEvent()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\UIComponent.as:13152]
    at spark.components::WindowedApplication/nativeWindow_activateHandler()[E:\dev\4.y\frameworks\projects\airspark\src\spark\components\WindowedApplication.as:2739]

在我的 Adob​​e Air 程序中,每当我使用我的应用程序并在此应用程序和其他应用程序之间切换焦点时,我都会遇到上述错误.(我已经尝试了几次,这个错误是可重现的.)

In my Adobe Air program, I got the above error, whenever I use my app, and switch focus around between this app and other applications. (I've tried several times and this error is reproducible.)

导致此问题的原因以及如何解决?

What causes this problem and how to fix it?

我的程序有一个堆栈视图,其中一个堆栈视图有一个列表.当列表中至少有一个对象时,就会出现上述错误.

my program has a stackview, and one of the stackviews has a list. This error above will occur when the list has at least one object in.

推荐答案

我在我的一个项目中遇到了同样的问题,看起来是 SDK 的已知错误.就我而言,我只是编写了自定义 Scroller 类,其中添加了 focusManager != null 检查.类似的东西

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);
            }
        }
    }
}

最好的毕业生,罗马

这篇关于Adobe Air:在不同应用程序之间更改焦点时,滚动条会引发错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆