all groups > flash actionscript > february 2004 >
You're in the

flash actionscript

group:

Interactive CD - Quiz Scripting help


Interactive CD - Quiz Scripting help AFstudios
2/1/2004 11:56:11 PM
flash actionscript:
Within the CD I am designing there are three main sections and each section ends with a multiple choice quiz. The question and answer boxes are dynamix text populated by an external txt file
It appears as such:


Re:Interactive CD - Quiz Scripting help AFstudios
2/2/2004 7:26:50 AM
My bad - let's see if I can post it as I intended it to read:

Within the CD I am designing there are three main sections and each section ends with a multiple choice quiz. The question and answer boxes are dynamix text populated by an external txt file

My question is how do I get the NEXT button to point toward a 'load movie' script when the last question has been answered? (In order to load the next section of dialogue) Because of the quiz code, the button constantly looks for the next question/answer set.

Also - how can I track the results of the quiz so that I can include a printable page at the end of the CD showing a Right to Wrong ratio?

Thanks in advance.

loadVariables("quiz.txt", "/questions");
i = 1;
~~~~~~~~~~~~
questions.q = eval("/questions:q" add i);
questions.answer = eval("/questions:answer" add i);
if (eval("/questions:a" add i) ne "") {
tellTarget ("/questions/a") {
gotoAndStop(1);
}
questions.a.answer = eval("/questions:a" add i);
tellTarget ("/questions/b") {
gotoAndStop(1);
}
questions.b.answer = eval("/questions:b" add i);
tellTarget ("/questions/c") {
gotoAndStop(1);
}
questions.c.answer = eval("/questions:c" add i);
tellTarget ("/questions/d") {
gotoAndStop(1);
}
questions.d.answer = eval("/questions:d" add i);
stop();
} else {
play();
}
~~~~~~~~~~~~~
'NEXT' button code:
on (press) {
i = i + 1;
trace(i);
gotoAndPlay("set");
}


AddThis Social Bookmark Button