PDA

View Full Version : problem with scoring in flash mx



rmoore
October 21st, 2004, 02:48 PM
I have a bunch of textboxes that they have to click a button to check to see if their entry is correct. I have this code within the buttons

on(release) {
if(_root.q5answer == "2") {
_root.correctmovie.gotoAndPlay(2);
_root.total = _root.total + 5;
}
}
on(release) {
if(_root.q5answer !== "2"){
_root.wrongmovie.gotoAndPlay(2);
}
}


it adds 5 every time to the dynamic text box...I have this within the correctmovie (which is checked after each question):

if (_root.total(Number(100))) {
tellTarget("allcorrect") {
gotoAndStop(2);
}
}

it adds up correctly, but when it gets to 100, it doesn't play the allcorrect movie..any ideas?

thanks

JUD
October 21st, 2004, 03:23 PM
Try this:

on(release){
if_root.q5answer == "2"){
_root.correctmovie.gotoAndPlay(2);
_root.total += 5;
}else{
_root.wrongmovie.gotoAndPlay(2)
}

if(_root.total >= 100){
_root.correctmovie.allcorrect.gotoAndStop(2);
}
}
//This is assuming that your "allcorrect" movie is inside your correctmovie