Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change TextField selection color in AS3

How can I change the select ("highlight") color of an TextField in actionscript 3? I've got an input textfield with white text on a black backdrop and as a result, selections are invisible, which is horrible for usability. Thanks!

like image 664
justinbach Avatar asked Jan 15 '10 14:01

justinbach


2 Answers

Another approach is to use the Text Layout Framework, specifically a TextFlow using a SelectionManager. With the TLF, you can directly control the SelectionFormat properties used for your text.

e.g.

TextFlow.defaultConfiguration.focusedSelectionFormat = new SelectionFormat(0x00FFFF);

There's a bit of a learning curve to pick up the TLF's way of doing things, but the payoff is significantly enhanced text customization.

like image 174
ZackBeNimble Avatar answered Sep 27 '22 22:09

ZackBeNimble


Here you can find a class doing the job

http://labs.hellokeita.com/2008/03/13/textfield-selection-color/

Reference site is down with its class :(

Here you can find something similar, although not so powerful: http://yourpalmark.com/2007/08/13/changing-selection-color-on-dynamic-textfields/

like image 43
quasi Avatar answered Sep 27 '22 21:09

quasi