Dr_s99
01-10-05, 04:46 PM
Hello,
In flash i want to read an XML file that looks like this
<?xml version="1.0" encoding="UTF-8"?>
<root>
<question>
<text>The definition of margin is?(choose one)</text>
<answer correct="true">The amount of money the investor is to provide</answer>
<message>Yes you are correct!</message>
<answer correct="false">The amount of money available to purchase securities</answer>
<message>No sorry, this definition is for buying power. Please try again</message>
<answer correct="false">The amount of money the brokerage firm will extend to the investor </answer>
<message>No sorry, this definition is for loan value. Please try again</message>
<answer correct="false">The difference between the profit made on margin and the profit made on a cash transaction</answer>
<message>No sorry, this isn't the right answer. Please try again</message>
</question>
</root>
Now i found a way to get the texts and all this stuff but... how could i get the Attribute for answer???
here is my Flash code:
function myOnLoad() {
_root.text.text =doc.childNodes[0].firstChild.childNodes[0].firstChild;//.childNodes[1].firstChild;
_root.answer1.text = doc.childNodes[0].firstChild.childNodes[1].firstChild;//.childNodes[1].firstChild;
_root.answer1_msg.text =doc.childNodes[0].firstChild.childNodes[2].firstChild;//.childNodes[1].firstChild;
_root.answer1_correct.text = doc.childNodes[0].firstChild.childNodes[1].firstChild.attributes("correct").name;//.childNodes[1].firstChild;
i want "answer1_correct" to show the correct attribute... i mean "false and true"... well you know..:D
Thank you,
Dr_s99
In flash i want to read an XML file that looks like this
<?xml version="1.0" encoding="UTF-8"?>
<root>
<question>
<text>The definition of margin is?(choose one)</text>
<answer correct="true">The amount of money the investor is to provide</answer>
<message>Yes you are correct!</message>
<answer correct="false">The amount of money available to purchase securities</answer>
<message>No sorry, this definition is for buying power. Please try again</message>
<answer correct="false">The amount of money the brokerage firm will extend to the investor </answer>
<message>No sorry, this definition is for loan value. Please try again</message>
<answer correct="false">The difference between the profit made on margin and the profit made on a cash transaction</answer>
<message>No sorry, this isn't the right answer. Please try again</message>
</question>
</root>
Now i found a way to get the texts and all this stuff but... how could i get the Attribute for answer???
here is my Flash code:
function myOnLoad() {
_root.text.text =doc.childNodes[0].firstChild.childNodes[0].firstChild;//.childNodes[1].firstChild;
_root.answer1.text = doc.childNodes[0].firstChild.childNodes[1].firstChild;//.childNodes[1].firstChild;
_root.answer1_msg.text =doc.childNodes[0].firstChild.childNodes[2].firstChild;//.childNodes[1].firstChild;
_root.answer1_correct.text = doc.childNodes[0].firstChild.childNodes[1].firstChild.attributes("correct").name;//.childNodes[1].firstChild;
i want "answer1_correct" to show the correct attribute... i mean "false and true"... well you know..:D
Thank you,
Dr_s99