Frequently Asked Questions

How do I make the messaging at the end of the game change depending on how many questions were answered right.

Based on the original file uploaded there are a few things you need to fix in order to achieve this.

Setting up the Text Field

In the “youwin_mc” you have to make the “Good Job!” text dynamic. In the “youdidit” MovieClip (keep the instance name of “words”) be sure to make sure the textField dynamic (give it an instance name of “txt”).

You should embed “Basic Latin” for the font of your choice and make sure the text field justification is centered. All of these steps can be done in the Properties Panel

Adjusting the ActionScript

1. Add the following line of code to the quizOver function:

endMessage(clipHolder.clip);

2. Add this new function after the quizOver function:

function endMessage(mc:MovieClip){ //based on % var a_response:Array=[“0% right”,”20% right”,”40% right”,”60% right”,”80% right”,”100% right”] var perc:Number=Math.round((n_right/n_questions)100); var a_num:Number; if (perc>=0){ a_num=0; if (perc>=20){ a_num=1; if (perc>=40){ a_num=2; if (perc>=60){ a_num=3; if (perc>=80){ a_num=4; if (perc==100){ a_num=5; } } } } } } mc.words.txt.htmlText=a_response[a_num]; }

You can change the array values to represent the messaging you desire.

by
by
by
by
by
by