styledtext.lzx
<library>
<class name="styledtext" extends="text">
<attribute name="style" value="null
" when="once"/>
<method name="init">
super.init();
if (this.style != null)
this._applystyle(this.style);
</method>
<method name="_applystyle" args="s">
if (s != null) {
if(s['textcolor']){
this.setAttribute("fgcolor", s.textcolor);
}
if(s['font']){
this.setAttribute("font", s.font);
}
if(s['fontsize']){
this.setAttribute("fontsize", s.fontsize);
}
if ( s['fontstyle'] ) this.setAttribute( "fontstyle", s.fontstyle );
}
</method>
</class>
</library>