I have defined a gradient color spectrum that I would like to use to change the color of a text selection in an input textfield. This is expected to act just like the colorpicker.
Asked
Active
Viewed 364 times
-1
-
1Do you want all the symbols in textfield to be colored uniformly, or do you want to apply gradient to the text as an image? – Vesper Dec 11 '12 at 08:02
-
1Did you write any code or you want we to write it for you...? – Teejay Dec 11 '12 at 08:08
1 Answers
0
See this one Best way to get the color where a mouse was clicked in AS3 for getting the selected color.
When you have it, simply apply yourColor
to the text selection with a TextFormat
:
var myFormat = new TextFormat();
myFormat.color = yourColor;
yourTextField.setTextFormat(myFormat,
yourTextField.selectionBeginIndex,
yourTextField.selectionEndIndex);