Skip to main content
Inspiring
May 21, 2007
Question

XML wont load

  • May 21, 2007
  • 4 replies
  • 356 views
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
This topic has been closed for replies.

4 replies

Inspiring
May 21, 2007
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


Inspiring
May 22, 2007
Try this
Inspiring
May 21, 2007
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
Inspiring
May 21, 2007
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
>


Participating Frequently
May 21, 2007
use a relitive location for the file such as

x.load("DAVE/photoLIST.xml");