Copy link to clipboard
Copied
I have two text boxes. An input text box you type into and then a dynamic text box that shows whatever you wrote in the Input box in a different font.
I want the output box to be in all caps. I've done some searching and it looks like there is some AS2 for this:
textOutput.writtentext.text.toUpperCase();
Where:
textOutput is the instance name of the output dynamic box
writtentext is a variable that gets passed
But it doesn't work. How can I get this UpperCase thing to work?
-Kirk
1 Correct answer
That's as simple as it needs to be, though I don't know what you're doing for the actionscript side of things. Here is a link to a file I made as an example for you as a Flash 8 file where all you need to do is type into the left (input) textfield and the right textfield converts it to all caps as you type...
Copy link to clipboard
Copied
Based on what you described, I think what you want is...
textOutput.text = String(writtentext).toUpperCase();
You could also use the "inputtextfieldname.text" in place of written text, substituting your instance name where it's hopefully obvious
Copy link to clipboard
Copied
That didn't work for me. Not sure what I am doing wrong.
Copy link to clipboard
Copied
Did you also try it using the input textfield.text instead of the variable like I explained?
Beyond what you described, I can't imagine what else you might have done. If it helps, the toUpperCase() method is a method of the String class, not a textfield method, which is why I used the String(variable).toUpperCase();... just to insure it is treated as a String.
Copy link to clipboard
Copied
I think I am doing something more basic than what you are writing.
I created two boxes on my stage, an input and dynamic. In the variable portion of the inspector I put the same name in each.
I'm assuming what you wrote is all AS. Not sure how to translate that into what I've done.
Copy link to clipboard
Copied
Maybe I can save you some anguish.... go to the properties panel and get rid of the var names you entered. They are unreliable things and are best not used. Instead, assign the textfields instance names. If you name the input texfield "inText" and the other one "outText", then you can get the output textfield to display the input textfield's text in caps using...
outText.text = String(inText.text).toUpperCase();
(I hope).
Copy link to clipboard
Copied
Sorry, that isn't working for some reason. My flash file is really simple. One frame. An action layer with your AS. Then a layer with the input and dynamic text with instance names inText outText
Copy link to clipboard
Copied
That's as simple as it needs to be, though I don't know what you're doing for the actionscript side of things. Here is a link to a file I made as an example for you as a Flash 8 file where all you need to do is type into the left (input) textfield and the right textfield converts it to all caps as you type...
Copy link to clipboard
Copied
thanks, this should let me decipher it.
Copy link to clipboard
Copied
Woohoo! it works! Thank you, thank you, thank you.
Copy link to clipboard
Copied
You're welcome

