note: all as3 is written in CS4 and compiled for flash 10.
注意:所有as3都是用CS4编写的,并为flash 10编译。
I have a parent movie that loads a separate standalone SWF movie. This standalone movie happens to use the ScrollPane component (fl.containers.ScrollPane), and it runs correctly when launched on it's own.
我有一部父电影,可以加载一个单独的独立SWF电影。这个独立的电影碰巧使用了ScrollPane组件(fl.containers.ScrollPane),并且当它自己启动时它可以正确运行。
When I attempt to have a Parent movie load the standalone SWF, i receive a run-time error:
当我尝试让父电影加载独立SWF时,我收到运行时错误:
TypeError: Error #1009: Cannot access a property or method of a null object reference. at fl.containers::ScrollPane/drawBackground() at fl.containers::ScrollPane/draw() at fl.core::UIComponent/callLaterDispatcher()
TypeError:错误#1009:无法访问空对象引用的属性或方法。 at fl.containers :: ScrollPane / drawBackground()at fl.containers :: ScrollPane / draw()at fl.core :: UIComponent / callLaterDispatcher()
I understand that this error can be avoided by adding the ScrollPane component to the Parent Movie library. My question is why is this necessary? If the component is only used in the standalone SWF being loaded by the Loader class, why does the Parent movie require the component to be in the library as well?
我知道通过将ScrollPane组件添加到父电影库可以避免此错误。我的问题是为什么这是必要的?如果组件仅用于Loader类加载的独立SWF,为什么Parent影片也要求组件也在库中?
1 个解决方案
#1
0
Seems more like the ScrollPane is not initialised before it is referenced. Might be that the parent does not let the swf execute its initialisation code before use.
看起来更像ScrollPane在引用之前没有初始化。可能是父母在使用之前不让swf执行其初始化代码。
#1
0
Seems more like the ScrollPane is not initialised before it is referenced. Might be that the parent does not let the swf execute its initialisation code before use.
看起来更像ScrollPane在引用之前没有初始化。可能是父母在使用之前不让swf执行其初始化代码。