# Q&A Game - Dynamic Text and Arrays?!

**URL:** <https://forum.kirupa.com/t/q-a-game-dynamic-text-and-arrays/219852>\
**Category:** flash\
**Created:** [March 20, 2007, 6:07pm UTC](https://forum.kirupa.com/t/q-a-game-dynamic-text-and-arrays/219852 "2007-03-20T18:07:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![fid0](https://avatars.discourse-cdn.com/v4/letter/f/9dc877/32.png) [@fid0](https://forum.kirupa.com/u/fid0)\
**Post date:** [March 20, 2007, 6:07pm UTC](https://forum.kirupa.com/t/q-a-game-dynamic-text-and-arrays/219852/1 "2007-03-20T18:07:06Z")

</div>

**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
