         // Create the hex text field  
         if (!textInput)
 		{			
-			textInput = new TextInput();    
+            // Mechanism to use TLFTextInput. 
+            var textInputClass:Class = getStyle("textInputClass");            
+            if (!textInputClass || 
+                FlexVersion.compatibilityVersion < FlexVersion.VERSION_4_0)
+            {
+                textInput = new TextInput();
+            }
+            else
+            {
+                textInput = new textInputClass();
+            }
 			
 			if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0)
 			{

    /**
     *  @private
     */    
    mx_internal var textInput:TextInput;

    /**
     *  @private

package mx.controls.colorPickerClasses
{

import flash.display.DisplayObject;
import flash.events.Event;
import flash.events.EventPhase;
import flash.events.KeyboardEvent;
