I would like to be able to select text in a text box and change only the selected text color. There would be a selection of colors you could choose from in a listbox. So select a chunk of text and then select the color you want for the text in a listbox.
OK, I assume that by the silence of this post what I am asking cannot be done.
:sure:
So I’ll ask something slightly different.
Say I am adding text to a textplate via action script. On a button I have this;
onPress(){
textplate += “Hello”
}
This puts the word hello in the text box. Great, but it always puts the text at the very end of the text file. I would like it when you hit the button to add the word hello to the textplate, the word would appear where the curser is.
What you were first asking is definitely doable. Take a look at the AS Dictionary, textField methods. TextField.replaceSel( text ) looks nice for instance
I’ve never seen this method before, and you probably haven’t either, that’s why you NEED TO CHECK THE AS DICTIONARY AT SELECTION AND TEXTFIELD!! :beam: :beam:
Yup… I’ve been using Flash since F4, and I still got lots of places which WOWs me alot and which puzzles me many times… DO read the Flash manual as much as you can and try to understand it… You don’t have to read your car manual to drive the car, but to tweak your car, you will have to read and understand the manual… Don’t you think so??? Also, do the searching on the forum with some clues you find during the reading to get more information…
In this FLA select the text box and write something in it. Next, make sure you leave the curser at the end of your text and hit the black button.
You will notice that the text is inserted at the beginning of the text box. Even if you highlight some of the text and then hit the black button the text inserts itself at the beginning of the text box.
I think I know what the problem is, but I don’t know how to fix it.
When you leave the curser at the end of you text you will notice the output window will be >-1 ,but as soon as you hit the button to invoke the replaceSel command the output window says -1.
This means that the listbox is not selected when you hit the button.