简体   繁体   中英

flash as3 external swf help/error

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM