0

TextField() が時々 ( setTextFormat () でフォーマットがリセットされた場合でも) BOLDING を保持する理由はありますか?

myFormat.bold=false;
defaultTextFormat =myFormat;  
defaultTextFormat.bold = false;
setTextFormat(myFormat);

htmlText("This text is bold even when it should not be.")

PS: TextField は編集可能であり、ユーザーが編集すると問題が発生します。

更新:不要なBOLDを避けるために、すべての書式設定を削除したいと思います。TextField には、ユーザーが太字の単語をバックスペースすると、TextField 内のすべてが永遠に太字になるというバグがあります。

4

1 に答える 1

0

TextField コントロールでは、TextFeild.styleSheet を設定して HTML スタイルを変更する必要があると思います。次のようなことを試してください:

var myText:TextField = new TextField();
var style:StyleSheet = new StyleSheet();
var fonts:String = "Helvetica Neue, Arial, _sans";
style = new StyleSheet();
style.setStyle(".body", {fontFamily:fonts, fontSize:"12", fontWeight:"normal", color:"#222222", textDecoration:"none"});
myText.styleSheet = style;
myText.htmlText = "this is bold even when should not";
于 2009-07-14T00:59:37.237 に答える