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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

If/Else Statement - Confused 1

Status
Not open for further replies.

jalbertson

Technical User
Feb 8, 2007
32
US
I am new to this if/else statement thing, and I can not seem to get this part right. Thank you in advance.

Here is my code:
if (QuizTrack.total_correct<85) {
pass_or_fail.text="Sorry, you will have to go back and take the test again.";
} else {
pass_or_fail.text="Congradulations, you passed the test.";
}

Thanks again.
 
Thanks for the fast reply!
The first if statement seems to be working fine. The else statement is the one that is not working for some odd reason, that I can not figure out. Any Ideas would be great.

Thanks again in advance
 
if "QuizTrack.total_correct" is 85 or more, the second statement is executed. If it's not working the problem lies somewhere else. Put "trace(QuizTrack.total_correct);" before the if/else statement to make sure you're getting the right number.

Kenneth Kawamoto
 
I tried that and nothing showed as being wrong. I am tryin this, just a simple color change in here and it is not working either. This is everything I have in the frame, so maybe it is somthing I have before it.


score_txt.text = (QuizTrack.total_correct/20)*100 + "%";

if ( QuizTrack.total_correct <= 84 ) {
score_txt.textColor = "0xFF66FF" ;
} else {
score_txt.textColor = "0x9999FF" ;
}
 
Forget Batman, you are my new HERO!

I do not know how I overlooked that, but thanks non the less.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top