Jump to content

Parsing Php-xml file with flash


snakebit

Recommended Posts

Hi,
I have php file which generate dynamically xml ([b]myXML.php[/b]), the problem come when I try to pars it with flash ([b]Macromedia Flash MX 2004[/b]) it didn't work:

[code]
myXML = new XML();
myXML.ignoreWhite = true;
myXML.onLoad = readXML;
myXML.load("myXML.php");
function readXML() {
root = myXML.childNodes;
trace(root);
}
[/code]
the trace result is white output window
The worse, there is no "null", "undefined" and etc. messages ???

I think the problem is in PHP file, because when I parse real xml file with the same content everything work fine.
Link to comment
https://forums.phpfreaks.com/topic/31476-parsing-php-xml-file-with-flash/
Share on other sites

I agree with thorpe on this one. While some of us are familiar with Flash AS, here is not the place to ask those coding questions. However, I would recommend you hit your myXML.php directly and make sure that the page is displayed as you anticipated. Also, be sure you're sending out header information to declare the Contente-type as XML, too. Otherwise, if you have issues with that, please post them here. If you're after specific actionscript help, post it in the Miscellaneous board, and we'll see if we can't help you there.
Sorry :-[ , that is what I want to do:

[b]myClass.php[/b]
[CODE]
class myTestClass{

function myXMLoutputfunction(){
header("Content-type: text/xml");
echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>"
                   ."<test_node>"
                   ."<nachalo>test_txt</nachalo>"
                   ."</test_node>";
}
}[/CODE]

[b]showclass.php[/b]
[CODE]
include("myClass.php");
myTestClass::myXMLoutputfunction();
[/CODE]

[b]showFlash.fla[/b]
[CODE]
myXML = new XML();
myXML.ignoreWhite = true;
myXML.onLoad = readXML;
myXML.load("myXML.php");
function readXML() {
    root = myXML.childNodes;
    trace(root);
}[/CODE]

When I click on [b]showclass.php[/b] everiting is perfectly working, but loading it in flash is the problem :(

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.