package {
import flash.text.TextField;
import flash.text.StyleSheet;
import flash.text.TextFieldAutoSize;
public class MyTF extends TextField {
public var
color:uint,
size:int
public function MyTF( color:uint, size:int) {
super();
color = color; // setting color and size
size = size;
init(); //initialize
}
private function init():void
{
autoSize = TextFieldAutoSize.LEFT;
var style:StyleSheet = new StyleSheet();
style.setStyle('span', {color: 0xFF0000, fontSize: 24});
styleSheet = style;
htmlText = '<span>test</span>';
//after creating an object of this class the text Style is not changing
}
}
}
このクラスのインスタンスを作成した後、htmlText スタイルが変更されないのはなぜですか? 何か問題がありますか?