views:

122

answers:

2

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?

A: 

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.

bitc
A: 

Hello,

I have the same problem, did you had an answer ?

dayoud
It appears as though flash requires a component to be present in the library of the parent even if that component is only used in the child. I believe this has something to do with both SWFs using a shared asset folder, and for some reason this means the parent application must contain all components that may be used in the child.This requires you to know what components may be used in the child ... I don't know if this is a bug, or I'm just missing something. In any case, I just solved it by adding the components required.
jwc