5 Replies Latest reply on May 21, 2007 9:11 PM by nITiNkIlLeRmEeRuT

    XML wont load

    mr.nazarko
      hello,

      im using this great tutorial from gotoandlean.com
      but have run into some problems

      im trying to load jpg's into a flash with xml, using the following code
      ------------------------------------------------------------------------------------

      var x:XML = new XML ();
      x.ignoreWhite = true;


      var urls:Array = new Array();
      var captions:Array = new Array();
      var w:Array = new Array();
      var h:Array = new Array();
      var WhoIsOn:Number;

      x.onLoad = function() {
      var photos:Array = this.firstChild.childNodes;
      for (i=0;i<photos.length;i++) {
      urls.push(photos .attributes,url);
      captions.push(photos
      .attributes,caption);

      }


      holder.loadMovie(urls[0]);
      caption.text = captions[0];
      whoIsOn = 0;
      }

      x.load(" http://www.antonnazarko.com/DAVE/photoLIST.xml");

      previous.onRelease = function (){
      if (whoIsOn > 0){
      whoIsOn--;
      holder.loadMovie(urls[whoIsOn]);
      caption.text = captions[whoIsOn];

      }
      }
      -------------------------------------------------------------------------------

      but i always get this prompt
      Error opening URL 'file:///C|/Documents%20and%20Settings/anton/Desktop/DAVEG/[type Object]'


      -- could someone double check thie code for me ?

      not sure why it doesnt work.

      thanks,
      anton
        • 1. Re: XML wont load
          joeschmoesdf
          use a relitive location for the file such as

          x.load("DAVE/photoLIST.xml");
          • 2. Re: XML wont load
            Level 7
            are u using the url of somebody elses domain.
            if not give relative path to xml.

            "mr.nazarko" <webforumsuser@macromedia.com> wrote in message
            news:f2raih$i0p$1@forums.macromedia.com...
            > hello,
            >
            > im using this great tutorial from gotoandlean.com
            > but have run into some problems
            >
            > im trying to load jpg's into a flash with xml, using the following code
            >
            > --------------------------------------------------------------------------------
            > ----
            >
            > var x:XML = new XML ();
            > x.ignoreWhite = true;
            >
            >
            > var urls:Array = new Array();
            > var captions:Array = new Array();
            > var w:Array = new Array();
            > var h:Array = new Array();
            > var WhoIsOn:Number;
            >
            > x.onLoad = function() {
            > var photos:Array = this.firstChild.childNodes;
            > for (i=0;i<photos.length;i++) {
            > urls.push(photos .attributes,url);
            > captions.push(photos
            .attributes,caption);
            >
            > }
            >
            >
            > holder.loadMovie(urls[0]);
            > caption.text = captions[0];
            > whoIsOn = 0;
            > }
            >
            > x.load(" http://www.antonnazarko.com/DAVE/photoLIST.xml");
            >
            > previous.onRelease = function (){
            > if (whoIsOn > 0){
            > whoIsOn--;
            > holder.loadMovie(urls[whoIsOn]);
            > caption.text = captions[whoIsOn];
            >
            > }
            > }
            > -------------------------------------------------------------------------------
            >
            > but i always get this prompt
            > Error opening URL
            > 'file:///C|/Documents%20and%20Settings/anton/Desktop/DAVEG/[type Object]'
            >
            >
            > -- could someone double check thie code for me ?
            >
            > not sure why it doesnt work.
            >
            > thanks,
            > anton
            >


            • 3. Re: XML wont load
              mr.nazarko Level 1
              hey thanks for the reply,

              tried to use relative path,
              x.load("photoLIST.xml"); -- should work? all files are in a local folder!

              also tried it online with two different servers,
              but still wont work,

              -----------------------
              still get this prompt
              Error opening URL
              > 'file:///C|/Documents%20and%20Settings/anton/Desktop/DAVEG/[type Object]'
              -----------------------

              why is it looking locally when ive directed it to an absolute path?

              could this old tutorial im using be incompatible with cs3?

              any help is appreciated,

              thanks again,
              anton
              • 4. Re: XML wont load
                mr.nazarko Level 1
                can someone check if my xml is wrong?
                http://www.antonnazarko.com/DAVE/photoLIST.xml

                what is a type Object?
                the my xml loaded variable caption comes up as "type Object"
                instead of the real caption.

                thanks again,
                anton


                • 5. XML wont load
                  nITiNkIlLeRmEeRuT Level 1
                  Try this