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!


Try this:

var c:Color = new Color(MyTextField);


or for a more up to date approach:

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.


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.

Here you can find a class doing the job

Need Your Help

Command/Syntax for specifying dynamic profile name in cygwin

windows bash cygwin

What is the syntax for specifying a dynamic profile name in linux command? E.g.

Visual Studio thinking that functions are already defined?

c++ visual-studio-2012 linker-error lnk2005

I have two files for a project I'm working on, one of my own writing and one written by a fellow student to serve as a sort of API. My problem is, the functions that are defined in the resource fil...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.