ScrollPane 的非常奇怪的问题

发布于 2024-08-17 10:14:39 字数 1107 浏览 3 评论 0原文

这让我发疯。看来我无法在 AS3 代码中的任何地方使用 ScrollPane,否则它会导致程序中的每个下拉框崩溃。

以下是单击下拉框时收到的错误消息:

TypeError: Error #1009: Cannot access a property or method of a null object reference.
at fl.containers::BaseScrollPane/drawBackground()
at fl.controls::List/draw()
at fl.core::UIComponent/drawNow()
at fl.controls::List/scrollToIndex()
at fl.controls::SelectableList/scrollToSelected()
at fl.controls::ComboBox/open()
at fl.controls::ComboBox/onToggleListVisibility()

单击任何下拉框时都会发生这种情况,无论引用 ScrollPane 的代码是否已执行。真正迟钝的是,我什至无法声明一个scrollPane var而不导致这些错误。 IE this:

var x:ScrollPane;

导致所有下拉菜单中断。不,我不想在没有初始化 x 的情况下尝试引用它。使用“new”初始化滚动窗格以及将任何内容投射到滚动窗格都会导致同样的问题。

为了解决这个问题,我直接在 fla 中创建滚动窗格并从 AS 引用它们。这不会破坏程序,而且我可以访问它们的属性。他们甚至以这种方式工作得很好。

简而言之,在程序中的任何位置使用“ScrollPane”一词都会破坏它。这也不仅仅是我的系统。至少有两名与我合作的其他开发人员也遇到过这种情况。

有什么想法吗?


编辑:

因此,在互联网上搜索了一段时间后,大多数人都通过遵循下面的 bhups 建议并将组件添加到库中来解决这个问题。我正在从窗口 -> 将其添加到我的主 fla 中组件-> ScrollPane 它确实出现在库中。它仍然不起作用。我什至在舞台上放置了一个实例,以确保它拥有所需的所有符号,但没有效果。有谁知道任何可能不正确的设置或我可以查看的其他内容?如有必要,我会提供任何信息。

This is driving me crazy. It seems I cannot use ScrollPane ANYWHERE in my AS3 code without it crashing every dropdown box in the program.

Here is the error message I get when clicking a dropdown box:

TypeError: Error #1009: Cannot access a property or method of a null object reference.
at fl.containers::BaseScrollPane/drawBackground()
at fl.controls::List/draw()
at fl.core::UIComponent/drawNow()
at fl.controls::List/scrollToIndex()
at fl.controls::SelectableList/scrollToSelected()
at fl.controls::ComboBox/open()
at fl.controls::ComboBox/onToggleListVisibility()

This happens when clicking ANY dropdown box, regardless of whether or not the code referencing ScrollPane has been executed. The really retarded thing is that I can't even declare a scrollPane var without it causing these errors. IE this:

var x:ScrollPane;

causes all dropdowns to break. And no, I'm not trying to reference x without initializing it. Initializing Scrollpanes using 'new' causes the same problem, as well as casting anything to a ScrollPane.

To get around this, I have been creating scrollpanes directly in the fla and referencing them from AS. This doesn't break the program, and I can access their properties. They even work fine this way.

In short, using the word 'ScrollPane' anywhere in the program breaks it. This is not just my system either. It is happening to at least two other devs I work with.

Any ideas?


edit:

So after scouring the interweb for a while, most people are solving this issue by following bhups suggestions below and adding the component to the library. I'm adding the thing to my main fla from window -> components -> ScrollPane and it indeed shows up in the library. It still doesn't work. I even put one instance on the stage to make sure it had all of the symbols it needed to no avail. Does anyone know of any settings that may be incorrect or anything else I can look at? I will provide any info if necessary.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

风和你 2024-08-24 10:14:39

ScrollPane 不属于 ActionScript-3 的核心库,因此在实例化或定义 Components 类的变量之前,您需要将该特定组件添加到您的库中。您可以在 (FLASH_INSTALL_DIR/LANGUAGE/Configuration/Component Source) 中找到组件源,在 (FLASH_INSTALL_DIR/LANGUAGE/Configuration/Components) 文件夹中找到组件 UI。

ScrollPane doesn't belong to the core libraries of ActionScript-3 so before instantiating or defining a variable of Components classes you need to add that particular component to you library. yo can find components source in (FLASH_INSTALL_DIR/LANGUAGE/Configuration/Component Source) and Components UI in (FLASH_INSTALL_DIR/LANGUAGE/Configuration/Components) folder.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文