1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
| <?xml version="1.0" encoding="utf-8"?>
<mx:TextInput xmlns:mx="http://www.adobe.com/2006/mxml"
initialize="changeSkin(this)"
invalid="changeSkinError(this)" valid="changeSkin(this)"
maxChars="63"
>
<mx:Script>
<![CDATA[
import mx.states.SetStyle;
[Embed(source="../../../assets/textField.swf", symbol="textFieldError")]public var borderSkinError:Class;
[Embed(source="../../../assets/textField.swf", symbol="textField")]public var borderSkin:Class;
/**
* Change the borderSkin to the borderSkin error
*
*/
private function changeSkinError(textinput:TextInput) : void {
textinput.setStyle("borderSkin", borderSkinError);
}
/**
* Restaure borderSkin (without error)
*
*/
private function changeSkin(textinput:TextInput) : void {
textinput.setStyle("borderSkin", borderSkin);
}
]]>
</mx:Script>
</mx:TextInput> |
Partager