Connecting Tech Pros Worldwide Forums | Help | Site Map

XML load problem

Member
 
Join Date: Jan 2008
Posts: 113
#1: Jan 22 '09
Hi,

I am trying to get my flash file to load xml data correctly, when i load loader.swf in the browser directly my xml is loaded and the movie functions correctly.
However when i embed and load the loader.swf from the index.html file, my xml is not loaded.

I have four files-

/test/index.html
/flash/loader.swf
/flash/house.swf
/flash/xml/data.xml


The xml loading code appears in the house.swf as follows:

Expand|Select|Wrap|Line Numbers
  1. /* Load XML information for info panel */
  2. var dataXML = new XML();
  3.  
  4. dataXML.ignoreWhite = true;
  5. dataXML.onLoad = function(success) {
  6.     if (success){
  7.         trace("XML Loaded.");
  8.     }
  9.     else {
  10.         trace("XML Failed to load.");        
  11.     }
  12. }
  13. dataXML.load("http://www.***.co.uk/flash/xml/data.xml");
  14.  
The loader.swf loads the house.swf using the loadClip method in conjunction with the MovieClipLoader class.

Expand|Select|Wrap|Line Numbers
  1. my_mcl.loadClip("http://www.***.co.uk/flash/house.swf",my_mc);
Does anyone know why the xml isn't loading when the loader.swf is embedded in the html file?

Thanks,

Chromis

Reply