Skip to main content
Participating Frequently
May 3, 2011
Question

importing an external swf into another

  • May 3, 2011
  • 1 reply
  • 394 views

Hi all,

i've got a really confusing problem with importing one swf into another.

All of my SWF files are AS3 but each one is coded differently.

i have my main SWF file, were i load some swf files that have no functionality and it works perfectly!

but now that i have to load in an SWF file that has functionality, it does not work.

Accually what i'm trying to load in the MAIN swf is an AS3  " chiken and eggs" style game, wich has

external .as files.

And i get an error:

TypeError: Error #1009: Cannot access a property or method of a null object reference.

I REALY NEED HELP!!!!!!

thx  

This topic has been closed for replies.

1 reply

May 3, 2011

>>TypeError: Error #1009: Cannot access a property or method of a null object reference.

That's a common mistake when loading swf's. Likely you are trying to reference the stage in the loaded movie, before it's actually been added to the stage. Use the ADDED_TO_STAGE event to init your objects...

mag_8524Author
Participating Frequently
May 6, 2011

one question. should i use the ADDED_TO_STAGE event  in the main function of the external file i'm trying to load?

or should i use it in the new file that i'm trying to load the external one in?

thx!