1 package net.systemeD.controls {
2 import flexlib.controls.PromptingTextInput;
3 import flash.display.DisplayObject;
4 import mx.controls.Image;
7 * The PromptingTextInputWarning is a custom PromptingTextInput component that highlights values containing semicolons.
8 * It does so using colour and a warning icon. Simply use in place of a flexlib PromptingTextInput component.
10 * @see DataGridWarningField
12 public class PromptingTextInputWarning extends PromptingTextInput {
14 private var _image:Image;
15 [Embed(source="../../../embedded/warning.png")] private var warningIcon:Class;
17 function PromptingTextInputWarning():void {
21 override protected function createChildren():void {
22 super.createChildren();
24 _image.source = warningIcon;
27 addChild(DisplayObject(_image));
30 override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void {
31 super.updateDisplayList(unscaledWidth, unscaledHeight);
32 if (text && text.indexOf(';')>-1) {
33 setStyle('color',0xFF0000);
35 _image.x = width -_image.width -5;
36 _image.y = height-_image.height-3;
37 _image.toolTip = "The tag contains more than one value - please check";
38 textField.width = width-_image.width-5;