In my Flash quiz, I have a detailed results page to which I want to post all the questions, answers, and whether the user answered correctly or incorrectly. All this information is stored in a multidimensional array and its successfully showing the results via the trace method.
My question is, what is the syntax for populating a dynamic text field with these results? Do I just write out one long line of AS with the newline command to separate the data? How would I go about applying bold to certain parts of the stored data that I will be showing?
Here is current code for my detailed results page:
[COLOR=#993300]function[/COLOR] showResultsCOLOR=#000000[/COLOR][COLOR=#000000]{[/COLOR]
[COLOR=#993300]trace[/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000ff]“Now showing results”[/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#993300]for[/COLOR][COLOR=#000000]([/COLOR][COLOR=#993300]var[/COLOR] i:[COLOR=#993300]Number[/COLOR] = [COLOR=#000000]0[/COLOR]; i < NumberOfChallenges; i++[COLOR=#000000])[/COLOR][COLOR=#000000]{[/COLOR] [COLOR=#f000f0]//This calls the length of the original array (not the spliced copy)[/COLOR]
[COLOR=#f000f0]//trace(NumberOfChallenges);[/COLOR]
[COLOR=#f000f0]//Make sure that the correct answers are marked in the aShuffledChallenges array[/COLOR]
[COLOR=#993300]trace[/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000ff]“POPULATING TEXT FIELD WITH A RESULT NOW.”[/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#993300]trace[/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000ff]“QUESTION:”[/COLOR] + aShuffledChallenges[COLOR=#000000][[/COLOR]i[COLOR=#000000]][/COLOR][COLOR=#000000][[/COLOR][COLOR=#000000]0[/COLOR][COLOR=#000000]][/COLOR] + [COLOR=#993300]newline[/COLOR][COLOR=#000000])[/COLOR]; [COLOR=#f000f0]//write out the question[/COLOR]
[COLOR=#993300]trace[/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000ff]“ANSWER:”[/COLOR] + aShuffledChallenges[COLOR=#000000][[/COLOR]i[COLOR=#000000]][/COLOR][COLOR=#000000][[/COLOR][COLOR=#000000]3[/COLOR][COLOR=#000000]][/COLOR] + [COLOR=#993300]newline[/COLOR][COLOR=#000000])[/COLOR]; [COLOR=#f000f0]//write out the answer[/COLOR]
[COLOR=#993300]trace[/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000ff]“Your answer to this question was:”[/COLOR] + aShuffledChallenges[COLOR=#000000][[/COLOR]i[COLOR=#000000]][/COLOR][COLOR=#000000][[/COLOR][COLOR=#000000]2[/COLOR][COLOR=#000000]][/COLOR] + [COLOR=#993300]newline[/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#000000]}[/COLOR]
[COLOR=#000000]}[/COLOR]
showResultsCOLOR=#000000[/COLOR];