ScrollPane Component required in library even though it is not being used by Parent Movie

两盒软妹~` 提交于 2020-01-07 02:20:15

问题


note: all as3 is written in CS4 and compiled for 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.

When I attempt to have a Parent movie load the standalone SWF, i receive a run-time error:

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

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?


回答1:


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.



来源:https://stackoverflow.com/questions/2668564/scrollpane-component-required-in-library-even-though-it-is-not-being-used-by-par

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!