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

Loading External SWF that loads XML

Community Beginner ,
Jan 02, 2013 Jan 02, 2013

Hey all I have a swf that loads an swf file into that loads pictures from an XML file thanks to Ned Murphy.  I have a new problems with it.  It works everywhere I try it except on the webserver.  When I try it I get nothing.  It doesnt seem to load the external SWf file or it may not be loading the XML file.  I am not sure why.  Has anyone ran into this before ? thanks.

EDIT

It works if I try the SWF from the webserver but when I embed it in an HTML file and run it through a broweser I get nothing.

TOPICS
ActionScript
2.7K
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

correct answers 1 Correct answer

LEGEND , Jan 02, 2013 Jan 02, 2013

If the swf is is another folder from the html page that embeds it, you probably need to adjust how you target the files that the swf's load. 

When you embed an swf file into a web page, anything the swf loads has to be targeted as if that swf is in the same folder as the html page that holds it.  So if the html page uses something like "flash/main.swf" to embed the top level swf, then if the top level file loads another swf from that same flash folder it needs to also use the "flash/other.swf" r

...
Translate
LEGEND ,
Jan 02, 2013 Jan 02, 2013

If the swf is is another folder from the html page that embeds it, you probably need to adjust how you target the files that the swf's load. 

When you embed an swf file into a web page, anything the swf loads has to be targeted as if that swf is in the same folder as the html page that holds it.  So if the html page uses something like "flash/main.swf" to embed the top level swf, then if the top level file loads another swf from that same flash folder it needs to also use the "flash/other.swf" regardless that it is in the same folder on the server.  When it's embedded in the page, it's as good as being wherever that page lives.

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
LEGEND ,
Jan 02, 2013 Jan 02, 2013

If you were to move the swf's into the same folder with the html page, that would probably cure the problem, but it is not necessary... you just need to be aware of how you need to target files.

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 ,
Jan 02, 2013 Jan 02, 2013

The code that calls it is this:

my_loader.loadClip(currentArray+".swf", this["slideshow_mc"]);

The SWF are all in the same folder... the HTML file is out one level.

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 ,
Jan 02, 2013 Jan 02, 2013

Does there have to be settings on the server for calling XML to work in the sub 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
LEGEND ,
Jan 02, 2013 Jan 02, 2013

Because the html is out one level, if you reread my first response, I think you will find it applies and that you need to adjust how you target the secondary swf file... and likely any xml file and image files as well.  When you load that first swf into the html page, it is basically no longer in the same folder as the rest of the swf's... the same goes for the others once they get loaded by the first

There should not need to be any settings for the server... an xml file is just a text file by another name.

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 ,
Jan 02, 2013 Jan 02, 2013

ok so let me get this straight.

The main html refers to flash swf as   Flash/main.swf

So to load aonther on in to this main it must have the link to the swf as Flash/sub1.swf

So now if the Sub1.swf is load an xml file of images does it have to refer to the main html page or to the swf file?

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
LEGEND ,
Jan 02, 2013 Jan 02, 2013
LATEST

I have never worked at that many levels, so I cannot provide the definitive answer.  My first inclination based on what I have told you so far would be to say you need to give the same consideration for the xml file.  If the second swf is loaded into the main, then it too is now sitting in the html file's folder (relatively speaking)... so to target the xml file, it should be using a path as if it too is in the html file's folder.

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