home *** CD-ROM | disk | FTP | other *** search
- package ENGINE.INTERFACE.ELEMENTS
- {
- import ENGINE.CORE.OGlobal;
- import ENGINE.DISPLAY.ODisplay;
- import flash.display.Sprite;
- import flash.events.FocusEvent;
- import flash.text.TextField;
- import flash.text.TextFieldAutoSize;
- import flash.text.TextFieldType;
- import flash.text.TextFormat;
-
- public class OInputTextField extends TextField
- {
-
-
- private var iTextFormat:TextFormat;
-
- public function OInputTextField(param1:Number, param2:Number, param3:*, param4:Number, param5:Number, param6:Boolean, param7:Array, param8:String, param9:int, param10:Number, param11:Number)
- {
- var _loc12_:Number = NaN;
- var _loc13_:Sprite = null;
- super();
- _loc12_ = OGlobal.Scale;
- this.type = TextFieldType.INPUT;
- this.autoSize = TextFieldAutoSize.NONE;
- this.embedFonts = true;
- if((_loc13_ = param3 is Sprite ? param3 as Sprite : new (param3 as Class)()).getChildAt(0) is TextField)
- {
- this.iTextFormat = (_loc13_.getChildAt(0) as TextField).getTextFormat();
- }
- else
- {
- this.iTextFormat = this.defaultTextFormat;
- }
- this.iTextFormat.size = param4 * _loc12_;
- this.iTextFormat.letterSpacing = param5 * _loc12_;
- this.iTextFormat.color = ODisplay.HSBToRGB(param7[0],param7[1],param7[2]);
- this.defaultTextFormat = this.iTextFormat;
- this.prText = param8;
- this.width = param1 * _loc12_;
- this.height = param2 * _loc12_;
- this.x = param10 * _loc12_;
- this.y = param11 * _loc12_;
- this.border = param6;
- this.maxChars = param9;
- this.restrict = "A-Za-z0-9 @._\\-";
- this.addEventListener(FocusEvent.KEY_FOCUS_CHANGE,OnFocusIn);
- }
-
- public function set prText(param1:String) : void
- {
- this.text = !param1 || param1 == "" ? " " : param1;
- }
-
- protected function OnFocusIn(param1:FocusEvent) : void
- {
- this.setTextFormat(this.iTextFormat);
- }
-
- public function set prFormat(param1:TextFormat) : void
- {
- this.iTextFormat = param1;
- this.defaultTextFormat = param1;
- this.setTextFormat(this.iTextFormat);
- }
-
- public function get prText() : String
- {
- var _loc1_:String = null;
- _loc1_ = this.text;
- while(_loc1_.charAt() == " ")
- {
- _loc1_ = _loc1_.substr(1);
- }
- while(_loc1_.charAt(_loc1_.length - 1) == " ")
- {
- _loc1_ = _loc1_.substr(0,_loc1_.length - 1);
- }
- return _loc1_;
- }
-
- public function get prFormat() : TextFormat
- {
- return this.iTextFormat;
- }
- }
- }
-