Jump to content


Basic problem


  • You cannot reply to this topic
4 replies to this topic

#1 Matt L

    Young Padawan

  • Members
  • Pip
  • 272 posts
  • Gender:Male
  • Location:Newcastle

Posted 28 March 2007 - 02:36 PM

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:
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?

Edited by Matt L, 28 March 2007 - 02:38 PM.


#2 Eibbie

    Young Padawan

  • Members
  • Pip
  • 5 posts

Posted 28 March 2007 - 03:14 PM

Shouldn't it be

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

Please ignore this code if I'm mistaken.

Edited by Eibbie, 28 March 2007 - 03:15 PM.


#3 Ben

    P2L Jedi Master

  • Publishing Betazoids
  • PipPipPipPip
  • 1,366 posts
  • Gender:Male
  • Location:VIC, Australia

Posted 28 March 2007 - 07:39 PM

View PostEibbie, on Mar 29 2007, 06:14 AM, said:

Shouldn't it be

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

Please ignore this code if I'm mistaken.
No you're right ^_^

#4 Matt L

    Young Padawan

  • Members
  • Pip
  • 272 posts
  • Gender:Male
  • Location:Newcastle

Posted 29 March 2007 - 10:04 AM

Tried that, it didn't do anything.

#5 Pax

    P2L Jedi

  • Members
  • PipPipPip
  • 911 posts
  • Gender:Male
  • Location:Windsor, ON, Canada

Posted 29 March 2007 - 11:06 AM

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.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users