I writing a simple news content mgmt script for flash. It follows this path HTML(forms)–>PHP–>MySQL–>PHP–>XML–>Flash. I have everything but the flash actionScript working.
For some reason I can not get these attributes to load into a dynamic text field.
here’s the XML code:
<xml version="1.0"?>
<news>
<stories id="1" date="June 21, 2007" story="testing the story, blah blah blah" spacer="+++++++++++++++++++++++++++++++++++++++++++++++++" />
<stories id="2" date="June 22, 2007" story="Story number 2, more blah blah blah" spacer="+++++++++++++++++++++++++++++++++++++++++++++++++" />
<stories id="3" date="June 23, 2007" story="Story number 3, f marry kill" spacer="+++++++++++++++++++++++++++++++++++++++++++++++++" />
<stories id="4" date="June 24, 2007" story="Its my birthday!" spacer="+++++++++++++++++++++++++++++++++++++++++++++++++" />
<stories id="5" date="June 27, 2007" story="ASDKASKDHAKSHDAKSDHAKSDAKJSHDAKJSD" spacer="+++++++++++++++++++++++++++++++++++++++++++++++++" />
<stories id="6" date="June 28, 2007" story="It WORKS!!!! cheap jew son of a *****!" spacer="+++++++++++++++++++++++++++++++++++++++++++++++++" />
</news>
here is my action script code:
// Attributes arrays
var nd:Array = new Array();
var ns:Array = new Array();
var sp:Array = new Array();
// Load XML
var newsXML:XML = new XML();
newsXML.ignoreWhite = true;
newsXML.onLoad = function()
{
var nodes:Array = this.firstChild.childNodes;
for(i=0;i<nodes.length;i++)
{
nd.push(nodes*.attributes.date);
ns.push(nodes*.attributes.story);
sp.push(nodes*.attributes.spacer);
}
theNews.text = nd+ns+sp;
}
newsXML.load("news.php");
It keeps returning a “NaN” value in my dynamic text box(instance name: theNews). and when i change theNews.text to only load on var(nd) it returns undefined.
any suggestions?
thanks