/ Published in: ActionScript 3
Very simple and basic TextHandle class, extends TextField... You can extend to fit your needs.
Basic usage:
var a:TextHandle = new TextHandle("some text");
addChild(a)
Optional params:
_size: uint ( default 22 ) - size of the textfiled
_color: uint ( default 0x000000, black ) - the color of the textfield
Basic usage:
var a:TextHandle = new TextHandle("some text");
addChild(a)
Optional params:
_size: uint ( default 22 ) - size of the textfiled
_color: uint ( default 0x000000, black ) - the color of the textfield
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
package { import flash.text.TextField; import flash.text.AntiAliasType; import flash.text.Font; import flash.text.GridFitType; import flash.text.TextFieldAutoSize; import flash.text.TextFieldType; import flash.text.TextFormat; import flash.text.TextFormatAlign; public class TextHandle extends TextField{ private var _format:TextFormat; public function TextHandle(_label:String, _size:uint = 11, _color:uint = 0xFFFFFF) { _format = new TextFormat(); _format.font = "Verdana"; _format.color = _color; _format.size = _size; _format.align = TextFormatAlign.LEFT; this.embedFonts = false; this.antiAliasType = AntiAliasType.ADVANCED; this.autoSize = TextFieldAutoSize.LEFT; this.multiline = false; this.cacheAsBitmap = true; this.selectable = false; this.text = _label; this.defaultTextFormat = _format; this.setTextFormat(_format); } public function get format():TextFormat{ return _format; } public function refresh():void{ this.setTextFormat(_format); } }//end }