Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

allowing both upper and lower case for dynamic text fields

Status
Not open for further replies.

Flashoid

Technical User
Dec 11, 2002
163
US
I have a simple dynamic text quiz created that displays either "wrong" or "correct" based on the text the user enters in the field. However, mine only works if they key in the correct text using all lower case letters. I would like them to be able to enter either upper or lower case letters and as long as they are spelled correctly (match the if_input text correctly) it will be considered correct. I have tried variations of Keyallowed with no success. There are 3 text fields, labeled input1, input2 and input3 and answer. I have attached current code I have below.

but.onRelease = function(){
if(_root.input1.text=="answerone"&& _root.input2.text=="answertwo"&& _root.input3.text=="answerthree"){
answer.text = "Correct"
}else{
answer.text = "Wrong"
}
}

thanks!
 
In other words...

Putting things in lower case or UPPER CASE - this is a relatively simple process, but is very useful when you are dealing with case sensitive stuff such as searches and replaces (which we will be covering later). You just use toLowerCase() or toUpperCase() as demonstrated here:

var example:String = "a mixture OF CASES";
trace(example.toLowerCase());//traces "a mixture of cases"
trace(example.toUpperCase());//traces "A MIXTURE OF CASES"
trace(example);//Hasn't changed
//if you want it to:
example = example.toLowerCase();
trace(example);//traces "a mixture of cases"



Regards. FLASH HELP - OPENED FOR BUSINESS!
TO GET YOUR OWN FREE WEBSITE HOSTING
 
Thanks for the reply. Are there any flash books you would recommend?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top