First letter of String to capital
Hi. Trying to get the first letter of a String to capital, and the rest of the String must be lower case. I think I am on the right tracks with the first letter, but not sure how to make everything else forced to be lowercase.
Heres a bit of info because I might need to change things.
I load in a flashvar vaiable by
var flashVar3 = root.loaderInfo.parameters.myVar2;
I am not to sure what data type this would be, not sure what flashvars comes as. I am then doing
var oldStr:String = flashVar3;
var newStr:String = oldStr.charAt(0).toUpperCase() + oldStr.substr(1);tf3.text=" "+ newStr;
I dont know if the first line is an issue, because i dont know if flashvars comes as a String. But what I have generally would work on the first letter. Not to sure how I can force the rest of the String to be lowercase though.
At this moment in time, I get the error
TypeError: Error #1010: A term is undefined and has no properties.
But I am not sure if this is because my flashvars variable is defined at runtime. Any advise on getting all of this working would be great.
cheers
