loading swf file problem
Copy link to clipboard
Copied
hi, I am getting one problem on loading my own swf file. Here, I have one "yeti.swf". I works perfect and does not show any error. Now, currently I am loading this "yeti.swf" in another "load.swf" file. This "load.swf" loads "yeti.swf". But while I load this "yeti.swf" I am facing error "Cannot access a property or method of a null object reference.". Here, in "yeti.swf" I did so many programming code just as loading xml file , loading images and show in stage and so on. I am shucked why I am getting such a problem ?
You can see my code
Copy link to clipboard
Copied
because you're trying to reference an object that's not defined.
to pinpoint your problem click file/publish settings/flash and tick "permit debugging". when you retest the line number with the null reference will be in the error message. copy and paste that line of code.
Copy link to clipboard
Copied
ya you are write. It show error the certain line number on my Menu.as. But while I run "yeti.swf" alone works fine and whenever I load this "yeti.swf" in another swf. It shows error
Copy link to clipboard
Copied
then you probably have a path reference error.
the most common cause of that would be caused by using a reference to "root" in the loaded swf.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
i generally don't download and correct files unless i'm hired. this problem you can probably solve yourself.
are both files as3 files? is there code in yeti.swf?
Copy link to clipboard
Copied
Ok, I tried to load another test.swf and it works nice and does not shows any error. In test.swf I did simple animation only. But when I again try to load "yeti.swf". I shows error. Both files are in sample directory. I do not know how to reference my "yeti.swf" in root. May be u are right but I am not sure.

Copy link to clipboard
Copied
I've had a very similar problem quite recently. Check that you are not calling the stage property from withing yeti.swf before it is added to the stage (e.g. if you try to use 'stage' in the constructor).

