This content has been marked as final.
Show 5 replies
-
1. Re: Simple equality check not working
kglad Jun 10, 2014 7:21 AM (in response to basil01)change the textfield from multiline to single line.
(when a text trace look like you expect but doesn't act the way you expect, trace its length, too. that will reveal white space problems. in your case you probably have a carriage return at the end of "one". ie, "one\r".)
-
2. Re: Simple equality check not working
basil01 Jun 10, 2014 2:03 PM (in response to kglad)How do you trace the length?
-
3. Re: Simple equality check not working
kglad Jun 10, 2014 2:20 PM (in response to basil01)strings have a length property:
var x:String = "one";
btn_done.onPress = function(){
if (a.text != x){
b.text="Wrong";
trace(a.text+" "+a.text.length);
}
else{
b.text = "Right";
}
}
-
4. Re: Simple equality check not working
basil01 Jun 10, 2014 4:58 PM (in response to kglad)Thanks so much for your informative and clear replies
-
5. Re: Simple equality check not working
kglad Jun 10, 2014 4:59 PM (in response to basil01)you're welcome.


