Help - Search - Members - Calendar
Full Version: Basic problem
Pixel2Life Forum > Help Section > Adobe Flash
Matt L
Okay, I've made a basic pong game. And I' m trying to add a score limit but I can't get it to work. My dynamic score counters are "leftscore" and "rightscore" and this is the code I have:
CODE
if("leftscore" == "5") {
    gotoAndStop(4);
}
if("rightscore" == "5") {
    gotoAndStop(3);
}


If I put in > it just skips right to the losing page. I've also tried "===" and ">=". Anyone have any idea?
Eibbie
Shouldn't it be

CODE
if (leftscore == 5) {
    gotoAndStop(4);
}
if (rightscore == 5) {
    gotoAndStop(3);
}


Please ignore this code if I'm mistaken.
Ben
QUOTE(Eibbie @ Mar 29 2007, 06:14 AM) *
Shouldn't it be

CODE
if (leftscore == 5) {
    gotoAndStop(4);
}
if (rightscore == 5) {
    gotoAndStop(3);
}


Please ignore this code if I'm mistaken.

No you're right bigwink.gif
Matt L
Tried that, it didn't do anything.
Pax
We are probably going to need to see some more of your code. Try doing a trace to see what leftscore and right score are equal to. Use the typeOf(); method to see what datatype the variable is. Check the scope of your variables too. You may need to add the path to the movieclip those vars are stored in.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.