     private function textInput_changeHandler(event:Event):void
     {
         // Handle events from hex TextField.
-        var color:String = TextInput(event.target).text;
+        var color:String = ITextInput(event.target).text;
         if (color.charAt(0) == "#")
         {
             textInput.maxChars = 7;

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

        // Create the hex text field  
        if (!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)
			{
