|
-
Senior Member
The numOfAnswers is 5, but there are only 4 answers. Since you start "i=1", the loop iterates through 5 times (1,2,3,4,5) and due to the "<=" when "i=5" the loop still runs through. So, just change the "<=" to "<", makes the loop stop at 4 iterations.
Change your for loop to the following:
for (var i=1; i<currentQuizItem.getNumOfAnswers(); i++)
{
_root["answer"+i]=currentQuizItem.getAnswer(i-1);
_root["answer"+i+"Mark"]._visible=true;
_root["answer"+i+"Textbox"]._visible=true;
_root["btn0"+i]._visible=true;
}
Hope that makes sense.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|