很奇怪的问题,滚动窗格很奇怪、窗格、问题

2023-09-08 15:34:28 作者:有人疼才显得出众

这是推动我疯了。看来我不能使用滚动窗格中的任何地方我AS3 code没有它崩溃每个下拉框的计划。

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()

这会发生任何点击下拉框,无论与否code引用的ScrollPane已被执行的时候。真正弱智的事情是,我甚至不能宣布一个ScrollPane变种没有它导致这些错误。 IE浏览器这样的:

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;

将导致所有下拉菜单打破。不,我并不想引用X =无对其进行初始化。使用新导致同样的问题,以及铸造任何一个ScrollPane初始化Scrollpanes。

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.

要解决这个问题,我已经直接在FLA创造scrollpanes和AS引用它们。这不破的程序,我可以访问它们的属性。他们甚至做工精细这种方式。

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.

任何想法?

编辑:

所以淘interweb一段时间后,大多数人都按照bhups下面的建议,并添加组件添加到库解决这一问题。我添加的东西,以我的主要的FLA从窗口 - >组件 - >滚动窗格,它确实显示在库中。它仍然无法正常工作。我甚至把舞台上的一个实例,以确保它有所有它需要无济于事的符号。有谁知道,可能是不正确的或其他任何东西,我可以看任何设置?如果有必要,我会提供任何信息。

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.

推荐答案

的ScrollPane不属于动作-3的核心库,以便实例或定义组件类的变量之前,你需要到特定的组件添加到您的库。哟可以在(FLASH_INSTALL_DIR /语言/配置/组件源)和组件UI中的组件源(FLASH_INSTALL_DIR /语言/配置/组件)的文件夹。

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.