         // 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)
 			{

import mx.controls.TextInput;
import mx.core.FlexVersion;
import mx.core.IFlexDisplayObject;
import mx.core.UIComponent;
import mx.core.mx_internal;
import mx.events.ColorPickerEvent;

			textInput.addEventListener(Event.CHANGE, textInput_changeHandler);
			textInput.addEventListener(KeyboardEvent.KEY_DOWN, textInput_keyDownHandler);
			
			addChild(DisplayObject(textInput));        
		}
        
        // Create the swatches grid
