TheConeHead
Programmer
Here is my xml (news.xml)
<?xml version="1.0"?>
<news>
<newsitem>
<headline>head line 0</headline>
<newstext>this is the text for newsitem
0</newstext>
</newsitem>
<newsitem>
<headline>head line 1</headline>
<newstext>this is the text for newsitem
1</newstext>
</newsitem>
</news>
Here is my AS:
function myOnLoad() {
//trace(myXML);
trace(myXML.firstChild.firstChild.firstChild.nodeValue);
}
if (myXML.loaded) {
if (myXML.status==0) {
myXML.ignoreWhite;
myXML.onLoad=myOnLoad();
_root.stop();
} else {
myBox.text="notloaded";
_root.gotoAndPlay(2);
}
} else {
gotoAndPlay(2);
}
I know the xml is getting loaded as trace(myXML) works fine, but
trace(myXML.firstChild.firstChild.firstChild.nodeValue);
produces undefined when my thinking is that it should produce head
line 0
what am I doing wrong?
<?xml version="1.0"?>
<news>
<newsitem>
<headline>head line 0</headline>
<newstext>this is the text for newsitem
0</newstext>
</newsitem>
<newsitem>
<headline>head line 1</headline>
<newstext>this is the text for newsitem
1</newstext>
</newsitem>
</news>
Here is my AS:
function myOnLoad() {
//trace(myXML);
trace(myXML.firstChild.firstChild.firstChild.nodeValue);
}
if (myXML.loaded) {
if (myXML.status==0) {
myXML.ignoreWhite;
myXML.onLoad=myOnLoad();
_root.stop();
} else {
myBox.text="notloaded";
_root.gotoAndPlay(2);
}
} else {
gotoAndPlay(2);
}
I know the xml is getting loaded as trace(myXML) works fine, but
trace(myXML.firstChild.firstChild.firstChild.nodeValue);
produces undefined when my thinking is that it should produce head
line 0
what am I doing wrong?