Question | Answer
------------------------------
dtext1 dtext2
dtext3 dtext4
I would like one of the dynamic text boxes (picked at random) to display the Answer and the other 3 to be filled in with (Answer+2, Answer-2, Answer*5).
My problem seems to be in picking the random box and then assigning Answer to it. Any help would be grateful. Thank you.
This is my test actionscript so far…
questionArray = [“What is 5 multiplied by 5?”];
answerArray = [“25”];
Question = (questionArray [0]);
Answer = (answerArray [0]);
//This array containing to the four dynamic text boxes
correctAnswerBox = [dtext1,dtext2,dtext3,dtext4];
//This is what I would like to do -----This returns: _level0.dtext2
(correctAnswerBox[random(3)]) = Answer