jose3760
January 28th, 2008, 06:55 PM
Hello again!
Im having a problem running an if statement for finding out if what the user has typed into the input box matches what the cheat code actually is.
Im adding a cheat to my game, so the user needs to type it into the input box, press send, and hope it works. The input box is also inside of a move clip.
Heres the code on the send button...
on(release){
if(_root.cheats.text == "speedster"){
trace ("speedster");
}else if(_root.cheats.text == "thechosenone"){
trace ("thechosenone");
}else if(_root.cheats.text == "multiplier"){
trace ("multiplier");
}else{
trace ("**** didn't work");
}
}
basically what happens is if I copy, lets say speedster, and then paste it into the input box and press send it will come up with "**** didnt work" every time
I think its pretty simple to fix, but I cant figure out how.
Thanks! =)
Im having a problem running an if statement for finding out if what the user has typed into the input box matches what the cheat code actually is.
Im adding a cheat to my game, so the user needs to type it into the input box, press send, and hope it works. The input box is also inside of a move clip.
Heres the code on the send button...
on(release){
if(_root.cheats.text == "speedster"){
trace ("speedster");
}else if(_root.cheats.text == "thechosenone"){
trace ("thechosenone");
}else if(_root.cheats.text == "multiplier"){
trace ("multiplier");
}else{
trace ("**** didn't work");
}
}
basically what happens is if I copy, lets say speedster, and then paste it into the input box and press send it will come up with "**** didnt work" every time
I think its pretty simple to fix, but I cant figure out how.
Thanks! =)