home *** CD-ROM | disk | FTP | other *** search
- class Txt extends MovieClip
- {
- var obFormat;
- var mAni;
- var tTxt;
- var obCustom;
- var owner;
- var text;
- var sVariable;
- var __sTxt;
- var _obFormat;
- function Txt()
- {
- super();
- this.obFormat = new TextFormat();
- this.obFormat.align = "left";
- }
- function init(_sTxt)
- {
- if(_sTxt != "undefined")
- {
- this.sTxt = _sTxt;
- }
- if(this.mAni == undefined)
- {
- this.filters = this.tTxt.filters;
- this.tTxt.filters = null;
- delete this.tTxt.filters;
- }
- else
- {
- this.mAni.setMask(this.tTxt);
- }
- if(this.obCustom.bCustom)
- {
- for(var _loc2_ in this.obCustom)
- {
- if(_loc2_ != "bCustom" && this.obCustom[_loc2_] != undefined)
- {
- this.tTxt[_loc2_] = this.obCustom[_loc2_];
- }
- }
- if(this.tTxt.type == "input")
- {
- Selection.setFocus(this.tTxt);
- this.tTxt.owner = this;
- this.tTxt.onChanged = function()
- {
- this.owner.sTxt = this.text;
- };
- }
- }
- this.sVariable.length > 0 && (this.tTxt.variable = this.sVariable);
- this.replace();
- }
- function get sTxt()
- {
- return this.__sTxt;
- }
- function set sTxt(_sTxt)
- {
- this.__sTxt = _sTxt;
- this.replace();
- }
- function replace()
- {
- for(var _loc2_ in this._obFormat)
- {
- this.obFormat[_loc2_] = this._obFormat[_loc2_];
- }
- this.tTxt.autoSize = this.obFormat.align;
- if(this.obFormat.align == "right")
- {
- this.tTxt._x = - Math.floor(this.tTxt._width);
- }
- else if(this.obFormat.align == "center")
- {
- this.tTxt._x = - Math.floor(this.tTxt._width / 2);
- }
- else
- {
- this.tTxt._x = 0;
- }
- this.tTxt.setTextFormat(this.obFormat);
- if(this.mAni != undefined)
- {
- this.mAni._width = this.tTxt._width + 5;
- this.mAni._height = int(this.tTxt._height) + 5;
- this.mAni._x = this.tTxt._x;
- }
- }
- }
-