add:
this._parent.completeF(1)
to the last frame of a question swf when answered correctly and
this._parent.completeF(0)
to the last frame of a question swf when answered incorrectly.
and, to your main swf, add:
var scoreVar:Number=0;
completeF(scoreVar);
// create a score dynamic textfield (say score_tf) to display your score.
function completeF(n:Number):Void{
scoreVar+=n;
score_tf.text=scoreVar;
}
Ok. I'll try to apply that later. Now sir, you taught me the proper way to load external files using buttons without behaviors. Also, please teach me to make my quiz in the most systematic way. For example, when the user chooses the correct/wrong answer. How do i do the response "Correct" and "Wrong" because i want it to be animated. Like there would be lights shining when the answer is correct. Can i do that with my quiz still being systematic? And by systematic, i mean that everything is still organized. For example in question # 1 choices A B C D. The correct answer is A. When i choose letter A the screen immediately displays animated CORRECT! While choices B C and D displays animated WRONG. Will i still be able to count the scores for each subtopic this way?
Also, i'm a bit confused with this.
add:
this._parent.completeF(1)
to the last frame of a question swf when answered correctly and
this._parent.completeF(0)
to the last frame of a question swf when answered incorrectly.
DOES IT MEAN THAT MY LAST FRAME SHOULD DISPLAY "CORRECT"
if it does, then where should be my "WRONG" response be?
OR SHOULD I CHANGE MY RESPONSE LIKE THIS:
I will create two swfs. 1 CORRECT and 1 WRONG
1. When i choose A it will load the external movieclip CORRECT containing this._parent.completeF(1) and
2. When i choose B C or D it will load the external movieclip WRONG containing
this._parent.completeF(0)
The letters A B C and D are flash buttons. When the user clicks button A (Which is correct) the Screen will display "CORRECT!" (Which is animated too. Like with confettis.) When they answer B C or D the Screen will display "WRONG". the "CORRECT" and "WRONG" response maybe inside the question swf. or into an external movieclip (DEPENDS ON YOUR RECOMMENDATION) and on the top right corner of the screen, the word "Score" is visible for the user to see how he is doing along the quiz. When the user is done with the quiz, the final score will appear. When the user decides to take another quiz, the score goes back to zero. I hope I made it clear sir. It's hard to speak English. Hehe.
I'ts ok if you have MAJOR RECOMMENDATIONS. I'LL FOLLOW THEM FOR SURE. ![]()
Yes. I already created the question swfs. It depends upon the question on what the letter of the correct answer would be.
For example
.........................................................Score: 0
Question 1: What is the capacity to do work?
A. Power B Energy
C. Force D Speed
The correct answer is letter B. When the user clicks the B button, it will load the Correct swf. In the correct swf is the "next" button. When the user clicks the next button. He will load question2 swf.
.........................................................Score: 1
Question 2: What is blah blah blah?
A. Power B Energy
C. Force D Speed
Now when the user got all the way to question15 swf or whatever the last question swf is, the next swf that will appear will tell the final score of the user.
Also please give me instructions how to use this script, where to put them EXACLTY, and what are they for?
this._parent.completeF(1)
this._parent.completeF(0)
then you'll need to hardcode the correct answer into each question swf.
if your buttons are named, A,B,C,D, you can use:
for question1 swf:
var correctAns:Button = B;
A.onRelease=checkAnsF;
B.onRelease=checkAnsF;
C.onRelease=checkAnsF;
D.onRelease=checkAnsF;
function checkAnsF():void{
if(this==correctAns){
this._parent.completeF(1);
// use attachMovie to display "correct.swf"
} else {
this._parent.completeF(0);
// use attachMovie to display "wrong.swf"
}
}
what's the trace function show:
var correctAns:Button = B;
A.onRelease=checkAnsF;
B.onRelease=checkAnsF;
C.onRelease=checkAnsF;
D.onRelease=checkAnsF;
function checkAnsF():Void{
trace(this+" "+correctAns+" "+this._parent);
if(this==correctAns){
this._parent.completeF(1);
// use attachMovie to display "correct.swf"
} else {
this._parent.completeF(0);
// use attachMovie to display "wrong.swf"
}
}
var correctAns:Button = B;
A.onRelease=checkAnsF;
B.onRelease=checkAnsF;
C.onRelease=checkAnsF;
D.onRelease=checkAnsF;
function checkAnsF():Void{
trace(this+" "+correctAns+" "+this._parent);
if(this==correctAns){
this._parent.completeF(1);
// use attachMovie to display "correct.swf"
} else {
this._parent.completeF(0);
// use attachMovie to display "wrong.swf"
}
}
what's this show:
trace("test");
var correctAns:Button = B;
A.onRelease=checkAnsF;
B.onRelease=checkAnsF;
C.onRelease=checkAnsF;
D.onRelease=checkAnsF;
function checkAnsF():Void{
trace(this+" "+correctAns+" "+this._parent);
if(this==correctAns){
this._parent.completeF(1);
// use attachMovie to display "correct.swf"
} else {
this._parent.completeF(0);
// use attachMovie to display "wrong.swf"
}
}
North America
Europe, Middle East and Africa
Asia Pacific