Can somebody give me an example of Multiple Choice Questions, where the question are being fetched from a XML file.
do you want to list all of the quesitons in the xml file?
hi e.s.x.s ,
that will also b fine. pls. tell me abt that. i will list all my questions in XML fine.
thnx for ur nice reply.
xml file content:
<?xml version="1.0" encoding="UTF-8"?>
<dataroot>
<question>what is the matrix?</question>
<question>is it air u r beathing now?</question>
</dataroot>
xml file name: qst.xml
[COLOR=blue]your swf and xml files are must be in the same directory![/COLOR]
put the below code your first frame and create a dynamic textbox and [COLOR=red]set its var to “qst”[/COLOR]
[AS]
questions = new XML();
questions.load(“qst.xml”);
questions.ignoreWhite = true;
questions.onLoad = function(success) {
if (success) {
for (i=0; i<questions.firstChild.childNodes.length; i++) {
_root[“qstion”+i] = questions.firstChild.childNodes*.firstChild.nodeValue;
qst = qst+"<br>"+_root[“qstion”+i];
}
}
};
stop();
[/AS]
this is a simple solution for your problem,but i hope it will help you…
You can download FLA and XML file …
thnx a lot. now i m trying to add some more questions in that file and then i will call those question into my flash file randomely.
Thnx again for ur co-operation :)).
Bye and take care .(and also try to b in touch, my mail id is jatin_anand@hotmail.com)
u r welcome jatin;) u can contact me with using my profile details:)
ßye…