rd42
10-31-2008, 02:01 PM
php generated xml does not display images in flash, but the hand typed does, any ideas?
Could this be caused by the filename being .php instead of .xml? I can't see any difference in the XML from the PHP vs the hand typed XML.
I'm using ActionScript 3.0, Flash CS3.
PHP generated XML (view source from php file data3.php) - doesn't work
<?xml version="1.0"?>
<slideshow>
<photo url="http://xxxx/images/CelliOliveOilBlend.png" caption="1 Liter Bottle"/>
<photo url="http://xxxx/lava/images/1224858460.jpg" caption="6 Pack Bottles"/>
</slideshow
Flash load function for php xml file
x.onLoad = function(success) {
var photos:Array = this.firstChild.childNodes;
for(i=0;i<photos.length;i++) {
urls.push(photos[i].attributes.url);
captions.push(photos[i].attributes.caption);
}
holder.loadMovie(urls[0]);
caption.text = captions[0];
whoIsOn = 0;
}
x.load("data/data3.php");
Hand typed XML - works - data3.xml
<?xml version="1.0"?>
<slideshow>
<photo url="http://xxxx/images/CelliOliveOilBlend.png" caption="1 Liter Bottle"/>
<photo url="http://xxxx/lava/images/1224858460.jpg" caption="6 Pack Bottles"/>
</slideshow
Flash load function for xml data3.xml
x.onLoad = function(success) {
var photos:Array = this.firstChild.childNodes;
for(i=0;i<photos.length;i++) {
urls.push(photos[i].attributes.url);
captions.push(photos[i].attributes.caption);
}
holder.loadMovie(urls[0]);
caption.text = captions[0];
whoIsOn = 0;
}
x.load("data/data3.xml");
Could this be caused by the filename being .php instead of .xml? I can't see any difference in the XML from the PHP vs the hand typed XML.
I'm using ActionScript 3.0, Flash CS3.
PHP generated XML (view source from php file data3.php) - doesn't work
<?xml version="1.0"?>
<slideshow>
<photo url="http://xxxx/images/CelliOliveOilBlend.png" caption="1 Liter Bottle"/>
<photo url="http://xxxx/lava/images/1224858460.jpg" caption="6 Pack Bottles"/>
</slideshow
Flash load function for php xml file
x.onLoad = function(success) {
var photos:Array = this.firstChild.childNodes;
for(i=0;i<photos.length;i++) {
urls.push(photos[i].attributes.url);
captions.push(photos[i].attributes.caption);
}
holder.loadMovie(urls[0]);
caption.text = captions[0];
whoIsOn = 0;
}
x.load("data/data3.php");
Hand typed XML - works - data3.xml
<?xml version="1.0"?>
<slideshow>
<photo url="http://xxxx/images/CelliOliveOilBlend.png" caption="1 Liter Bottle"/>
<photo url="http://xxxx/lava/images/1224858460.jpg" caption="6 Pack Bottles"/>
</slideshow
Flash load function for xml data3.xml
x.onLoad = function(success) {
var photos:Array = this.firstChild.childNodes;
for(i=0;i<photos.length;i++) {
urls.push(photos[i].attributes.url);
captions.push(photos[i].attributes.caption);
}
holder.loadMovie(urls[0]);
caption.text = captions[0];
whoIsOn = 0;
}
x.load("data/data3.xml");