Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

loading swf file problem

Community Beginner ,
Dec 26, 2009 Dec 26, 2009

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

TOPICS
ActionScript
857
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 26, 2009 Dec 26, 2009

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Dec 26, 2009 Dec 26, 2009

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 26, 2009 Dec 26, 2009

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Dec 27, 2009 Dec 27, 2009

hi, I have made one samle swf to load with click event handler. Can u check this file. My main file is load.swf

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 27, 2009 Dec 27, 2009

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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Dec 26, 2009 Dec 26, 2009

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Dec 28, 2009 Dec 28, 2009
LATEST

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines