tronoku
March 29th, 2009, 01:22 AM
Hi, I am a front-end developer that is just getting into flash and AS 3.0.
I have a basic question..
First, let me explain the situation.
I have a php script that grabs data from a sql database and stores it into an XML file, this data is then read by a flash doc which should show the different values based on the movie.
I have successfully loaded the xml doc into my flash and have been able to traverse the xml dom thanks to a tutorial on this website. (thank you for that, it was a very in depth helpful tutorial found here http://www.kirupa.com/developer/flashcs3/using_xml_as3_pg7.htm (http://www.kirupa.com/forum/../developer/flashcs3/using_xml_as3_pg7.htm))
Now, here is my issue. I have successfully used trace to call out information into the "output" window.. But I cannot for the life of me figure out how to put this information into my dynamic text box.
After a bit of looking around I found out that I create a dynamic text box to input text. (like a said.. I am new to flash entirely)
So I created a dynamic text box and typed in text_1 into the box underneat it. (I can only assume that this is the name of the text box)
So then I used the action script text_1.text = nodeText.node.text.text()[0];
But this comes up with some errors..
Please let me know if I need to give anymore information.
Thanks,
Jeff
My xml is very simple..
<?xml version="1.0" encoding="ISO-8859-1"?>
<document>
<node>
<text>Sample Text1</text>
</node>
<node>
<text>Sample Text2</text>
</document>
And here is my action script code:
var xmlLoader:URLLoader = new URLLoader();
var xmlData:XML = new XML();
xmlLoader.addEventListener(Event.COMPLETE, LoadXML);
xmlLoader.load(new URLRequest("note.xml"));
function LoadXML(e:Event):void {
xmlData = new XML(e.target.data);
ParseData(xmlData);
}
function ParseData(nodeText:XML):void {
text_1.text = nodeText.node.text.text()[0];
}
I have a basic question..
First, let me explain the situation.
I have a php script that grabs data from a sql database and stores it into an XML file, this data is then read by a flash doc which should show the different values based on the movie.
I have successfully loaded the xml doc into my flash and have been able to traverse the xml dom thanks to a tutorial on this website. (thank you for that, it was a very in depth helpful tutorial found here http://www.kirupa.com/developer/flashcs3/using_xml_as3_pg7.htm (http://www.kirupa.com/forum/../developer/flashcs3/using_xml_as3_pg7.htm))
Now, here is my issue. I have successfully used trace to call out information into the "output" window.. But I cannot for the life of me figure out how to put this information into my dynamic text box.
After a bit of looking around I found out that I create a dynamic text box to input text. (like a said.. I am new to flash entirely)
So I created a dynamic text box and typed in text_1 into the box underneat it. (I can only assume that this is the name of the text box)
So then I used the action script text_1.text = nodeText.node.text.text()[0];
But this comes up with some errors..
Please let me know if I need to give anymore information.
Thanks,
Jeff
My xml is very simple..
<?xml version="1.0" encoding="ISO-8859-1"?>
<document>
<node>
<text>Sample Text1</text>
</node>
<node>
<text>Sample Text2</text>
</document>
And here is my action script code:
var xmlLoader:URLLoader = new URLLoader();
var xmlData:XML = new XML();
xmlLoader.addEventListener(Event.COMPLETE, LoadXML);
xmlLoader.load(new URLRequest("note.xml"));
function LoadXML(e:Event):void {
xmlData = new XML(e.target.data);
ParseData(xmlData);
}
function ParseData(nodeText:XML):void {
text_1.text = nodeText.node.text.text()[0];
}