I might be taking crazy pills but has anyone actually gotten the errorSkin feature to work? I am not doing anything crazy, just extending TextInput (spark) and setting the errorSkin property.
I have tried creating a skin using SparkSkin, did nothing. I have tried creating a skin using ProgrammaticSkin, did nothing.
TextInput is always a red border. I know you can set errorColor and errorString but I am obviously looking to do more than just change the color of the border. I am compiling using Flex 4.1.
Any ideas?
Implimentation:
<components:PromptedTextInput id="txt"
width="200"
horizontalCenter="0"
verticalCenter="0"
errorSkin="skins.TestSkin" />
Class
public class PromptedTextInput extends TextInput
{
public function PromptedTextInput()
{
super();
}
}
Error Skin:
<s:SparkSkin xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark">
<fx:Metadata>
<![CDATA[
[HostComponent("spark.components.TextInput")]
]]>
</fx:Metadata>
<s:states>
<s:State name="normal" />
<s:State name="disabled" />
<s:State name="error" />
</s:states>
<!-- fill -->
<s:Rect id="background"
left="1" right="1" top="1" bottom="1">
<s:fill>
<!--- Defines the background fill color. -->
<s:SolidColor id="bgFill"
color="#66CC66" />
</s:fill>
</s:Rect>
</s:SparkSkin>
Another Error Skin Attempt:
public class TestSkin extends ProgrammaticSkin
{
public function TestSkin()
{
super();
}
override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
{
super.updateDisplayList(unscaledWidth, unscaledHeight);
graphics.clear();
graphics.beginFill(0x33CC33);
graphics.drawRect(0, 0, unscaledWidth, unscaledHeight);
graphics.endFill();
}
}