Thanks for replying so quickly. However, this does not seem to do what I had in mind. This gave me an output like this:
arr[0].theWord = D
arr[0].theSynonym = d
arr[1].theWord = E
arr[1].theSynonym = e
and so on.. But what I was looking for is more of a MC quiz where one label displays a "Word" and the four other labels display four choices of "Synonyms" with the correct answer showing up in different labels every time. Then when the user click on the correct answer he'll get credit and when he doesn't get it right he'll get a message.
I hope I made things clearer this time.
Thanks
It was done in vb6 by randomly choosing 3 other synonyms from a text file that similarly had only two "columns" in addition to the correct answer. I can post that code if you are familiar with vb6 or if it will help develop a different approach. I am trying to avoid redoing the xml file as it is kind of long. Aother idea is to choose 4 wrong answers and then replace one label with the correct answer.
I cannot get the text displayed in the labels so far... I have 5 textfields on stage with instance names - text1through text5. Text1 is supposed to display the word or question and the rest text2 through text5 to show the synonym choices randomising in which textfield the correct answer will appear. I haven't had any success yet. Is this what this last bit of code supposed to do?
I also noticed in the output window that after I hit the nextBtn 4 times I start getting f4 incorrect answers intead of three.
After I changed the askQuestion routine, the textfields are populated with choices but there is something wrong because the correcrt answer is not appearing in the choices. Maybe it has something to do with the incorrect answers choices increasing from three to four after hitting the next button a few times.
I tried your fla with the attached test.xml file and it does the same thing where the choices of wrong answer turn into 4 instead of three and the correct answer is no longer part of the displayed choices. I wanted to try an xml that had more words and that's when the problem started. See please take alook and see what's wrong.
I made an xml with more words which demonstrates the problem more clearly. Just watch the output window when hitting the next button and you will notice that the incorrect choices no longer change. Only the question and the correct answer change.
That seem to have done it!! I will test it more thorougly with the complete xml db file. One more question if possible. Would I be able to add buttons to specify that the testing to be done only on part of the db instead of the whole thing at once. In other words, be able to add a button that specifies testing from word #1 through 100 and another to go from 101 through 200 and so on.. Is it possible to achieve such a result with this setup?
the variable id is what increments you through the questions.
you would need an if(condition) statement to detect when id==100;
when id is 100, stop the quiz and start a new quiz where id is set to 101.
When I expanded the xml to100 words and tested it seems that the randomisation moves up the list gradually. It does not go from say word #6 to word #55 and then back to #10 and up to #78 and so on...instead it goes from say #5 to 7,11,15,20 and so on up the liast. It would be better if it skips around more. Attached is the expanded file.