Today i was creating my quiz and linking the pages so that my score will add up once an answer had been clicked on. i had to create each question page on the same document but on different layers.
i then had to creat an action on each layer telling the movie to stop at each page but also to help the score add up. this is the action i entered. _global.quiz_scorescore.text-quiz_scorestop()
i then had to put an action on each answer available. for the incorrect answer i entered this:
on (press){ _global.quiz_score
score.text=quiz_score question_answer.text= "Incorrect"
answer_3._visible=false;
answer_4._visible=false;
answer_5._visible=false;
}
And if the asnwer was correct i added this action:
on (press){ _global.quiz_score
quiz_score=quiz_score+1; score.text=quiz_score question_answer.text="Correct"
answer_3._visible=false;
answer_4._visible=false;
answer_5._visible=false;
}
both of these action will help to add up the total score for each question and will give a total at the end.
i also had to make the Score text box into dynamic text and named it score so that the score can be added up and will display there.
I also created arrows on each question page so that the audiance can go to the next page once they have answered the question. i changed these arrows into buttons by converting it into a symbol then i added an action to the button so that it will link to the next page. the script i added to these buttons were:
on (press){ gotoAndPlay(4);}
the number changed according to which page it was leading too.
No comments:
Post a Comment