views:

28

answers:

1

I am having an issue loading an external swf into my as3 project. I have created both swfs and both were creating using as3. In the one file I am trying to load the other swf, just for testing purposes. It works fine but for some reason I am getting this error:

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

It works fine until it throws this error and then it seems to mess up. Any ideas what might be causing this. Is there something I am missing doing or something that I need to do in order to get it to load properly. Any help is appreciated.

EDIT:

I thought this information might be helpful too. In the error it also says:

    at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.utils::Timer/tick()
A: 

It is hard to say what's causing null point error - in most cases like this (loaded SWF throwing 1009), it is due to accessing stage from the loaded SWF's constructor - stage will be null until you add the object to the display list.

The error statement you posted doesn't look complete; there's at least one line missing in it, and that's the important line - it conveys the location of error in your code. Post any timer handling code in the loaded SWF and we might be able to pinpoint the origin of error.

Amarghosh