PDA

View Full Version : Multiple Choice Questions



jatin
July 18th, 2003, 07:11 AM
Can somebody give me an example of Multiple Choice Questions, where the question are being fetched from a XML file.

:eye:

e.s.x.s
July 18th, 2003, 07:27 AM
do you want to list all of the quesitons in the xml file?

jatin
July 19th, 2003, 12:30 AM
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.

e.s.x.s
July 19th, 2003, 07:23 AM
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
your swf and xml files are must be in the same directory!
put the below code your first frame and create a dynamic textbox and set its var to "qst"

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[i].firstChild.nodeValue;
qst = qst+"<br>"+_root["qstion"+i];
}
}
};
stop();

this is a simple solution for your problem,but i hope it will help you..;)
You can download FLA and XML file ..

jatin
July 19th, 2003, 08:51 AM
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)

e.s.x.s
July 19th, 2003, 09:55 AM
u r welcome jatin;) u can contact me with using my profile details:)

ßye..