Hi!
I have a php-script that generates a xml-output.
The file is called data.php, and is to be imported into a .swf file.
I have problems getting the .swf file to import the data.php-file. If I just watch the data.php-file in IEx, and then save it as an XML-file, e.g. data.xml, then my .swf-file manages to import it without problems.
The problem is when importing the data.php - file, and I suspect that it has something to do with the encoding...?
This is my function that prints XML-data:
<?
/**
* Print the XML for the flash file
*/
function printXML(){
//Set header type
header("Content-Type: text/xml; charset=iso-8859-1");
//Print items to make a valid XML file
echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n<hybristream version =\"0.1\">\n<datalist>\n";
//Print the settings
$this->printXMLsettings();
//Print the subtitle
$this->printXMLsubtitle();
//Print the items for the flashfile
$this->printXMLitems();
//End the XML file
?></datalist>
</hybristream><?
}
?>
Typical output is like this:
<?xml version="1.0" encoding="iso-8859-1"?>
<hybristream version ="0.1">
<datalist>
<settings>
<video>false</video>
<loop>false</loop>
<audio></audio>
</settings>
<subtitle>
<text>This is some subtitle. Juhu!</text>
<posX>20</posX>
<posY>200</posY>
<width>200</width>
<height>200</height>
<size>12</size>
<color>0x000000</color>
<font>Arial</font>
<bold>0</bold>
</subtitle>
<item>
<image>image2.jpg</image>
<duration>5</duration>
<fade>2</fade>
</item>
<item>
<image>image3.jpg</image>
<duration>5</duration>
<fade>2</fade>
</item>
<item>
<image>image4.jpg</image>
<duration>5</duration>
<fade>2</fade>
</item>
<item>
<image>image5.jpg</image>
<duration>5</duration>
<fade>2</fade>
</item>
<item>
<image>image6.jpg</image>
<duration>5</duration>
<fade>2</fade>
</item>
<item>
<image>image1.jpg</image>
<duration>5</duration>
<fade>2</fade>
</item>
</datalist>
</hybristream>
Anybody know what I am doing wrong? Why won't the .swf-file import XML-data from the data.php-file, when it works after saving the output as an XML-file ("Save as..."->data.xml in IEx) ?
Thanks!!!
PS! I do not have access to the .fla-file of the .swf, which makes it pretty hard to debug...
Torbjørn