Why doesnt it stop?

  • Adde
  • Beginner
  • Beginner
  • Adde
  • Posts: 47

Post 3+ Months Ago

Ive made a quiz in flash, heres the result frames code. I want it to stop but it doesnt! Why? And whats the right code?


Code: [ Select ]
if (result==10) {
    message = "WOW! ALL ANSWERS RIGHT! INCREDIBLE!";
} else if (10 && result >=7 {
  message = "Whoa!!! You got" + result+ ", so you still have something to work on!";
} else if (7 && result >=4) {
  message = "Sucker! only " + result+ "right so TRY AGAIN!";
} else {
  message = "*plum* YOU REALLY SUCK! ONLY " + result+ "ANSWERS RIGHT! SUCKING!";
}
stop();
  1. if (result==10) {
  2.     message = "WOW! ALL ANSWERS RIGHT! INCREDIBLE!";
  3. } else if (10 && result >=7 {
  4.   message = "Whoa!!! You got" + result+ ", so you still have something to work on!";
  5. } else if (7 && result >=4) {
  6.   message = "Sucker! only " + result+ "right so TRY AGAIN!";
  7. } else {
  8.   message = "*plum* YOU REALLY SUCK! ONLY " + result+ "ANSWERS RIGHT! SUCKING!";
  9. }
  10. stop();
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • digitalMedia
  • a.k.a. dM
  • Genius
  • User avatar
  • Posts: 5149
  • Loc: SC-USA

Post 3+ Months Ago

Code: [ Select ]
if (result==10) {
    message = "WOW! ALL ANSWERS RIGHT! INCREDIBLE!";
} else if (10 && result >=7 {
  message = "Whoa!!! You got" + result+ ", so you still have something to work on!";
} else if (7 && result >=4) {
  message = "Sucker! only " + result+ "right so TRY AGAIN!";
} else {
  message = "*plum* YOU REALLY SUCK! ONLY " + result+ "ANSWERS RIGHT! SUCKING!";
}
stop();
  1. if (result==10) {
  2.     message = "WOW! ALL ANSWERS RIGHT! INCREDIBLE!";
  3. } else if (10 && result >=7 {
  4.   message = "Whoa!!! You got" + result+ ", so you still have something to work on!";
  5. } else if (7 && result >=4) {
  6.   message = "Sucker! only " + result+ "right so TRY AGAIN!";
  7. } else {
  8.   message = "*plum* YOU REALLY SUCK! ONLY " + result+ "ANSWERS RIGHT! SUCKING!";
  9. }
  10. stop();


There are some errors in your code that may be causing the whole code block not to process(closing parenthesis of the first 'else if' condition). If you take out the whole "if" chain, does the stop() work then?

I think your 'esle if' conditions should be...

Code: [ Select ]
else if (result < 10 && result >=7) {....


As you have it now, it should skip the first part of the condition and only check for the second.
  • Adde
  • Beginner
  • Beginner
  • Adde
  • Posts: 47

Post 3+ Months Ago

Ok! Thx a lot! Will try it out later!

Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: No registered users and 15 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.