Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

reset variable

Status
Not open for further replies.

janet24

Technical User
Jul 22, 2003
161
US
I have a test that gives a score when people choose a true or false answer. It works fine but when I reset and go back to the beginning I need to reset the variable. If I set it to 0 I just get 0 through the test. If I don't reset it, the same score is given(I reset by going back to the beginning). How do you reset a variable without using 0.

 
can you post some code...it ought to reset to 0 without any problems.
 
I have a feeling it's not a simple answer. The problem is...it does set to 0 but then the rest of my code doesn't work.

If you answer the questions then hit submit it works, the amount of correct and incorrect answers are at the bottom. If you reset..which just goes back to frame one and do the test again, and submit the correct and incorrect comes to all 0's.

I'm not sure why it's working in the first place and not when I reset.




beginning code in the first frame

_root.onetrue._alpha=0;
_root.onefalse._alpha=0;
_root.oneincorrect._alpha=0;
_root.onecorrect._alpha=0;
var right
var wrong
right=0;
wrong=0;
play();

This code is on the square buttons

on (release) {
_root.threetrue._alpha = 0;
_root.threecorrect._alpha = 0;
_root.threefalse._alpha = 100;
_root.threeincorrect._alpha = 100;
var threet
if(threef>=1){
}
else if (threet<1){
wrong ++;
threet=+1;
}
}


I'm making sure they can't keep adding up correct and incorrect totals so only the first answer gets an correct or incorrect response.

Anyway...This might not be enough information for you to help me but let me know if you see anything....

I have a feeling it's I'm not approaching this right, I'm more of a designer not a programmer.

Thanks for anything you can see....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top