HTML标记在HTML文本字段中显示为字符空格

时间:2014-05-15 16:50:33

标签: actionscript-3 flash

这是我在文本字段中添加的HTML文本:

<body><h1>A Boolean value that indicates</h1>Whether the text field is selectable. The value true indicates that the text is selectable. The selectable property controls whether a text field is selectable, not whether a text field is editable. A dynamic text field can be selectable even if it is not editable. If a dynamic text field is not selectable, the user cannot select its text.

If selectable is set to false, the text in the text field does not respond to selection commands from the mouse or keyboard, and the text cannot be copied with the Copy command. If selectable is set to true, the text in the text field can be selected with the mouse or keyboard, and the text can be copied with the Copy command. You can select text this way even if the text field is a dynamic text field instead of an input text field.

A Boolean value that indicates whether the text field is selectable. The value true indicates that the text is selectable. The selectable property controls whether a text field is selectable, not whether a text field is editable. A dynamic text field can be selectable even if it is not editable. If a dynamic text field is not selectable, the user cannot select its text.

If selectable is set to false, the text in the text field does not respond to selection commands from the mouse or keyboard, and the text cannot be copied with the Copy command. If selectable is set to true, the text in the text field can be selected with the mouse or keyboard, and the text can be copied with the Copy command. You can select text this way even if the text field is a dynamic text field instead of an input text field.

The default value is true.

A Boolean value that indicates whether the text field is selectable. The value true indicates that the text is selectable. The selectable property controls whether a text field is selectable, not whether a text field is editable. A dynamic text field can be selectable even if it is not editable. If a dynamic text field is not selectable, the user cannot select its text.

If selectable is set to false, the text in the text field does not respond to selection commands from the mouse or keyboard, and the text cannot be copied with the Copy command. If selectable is set to true, the text in the text field can be selected with the mouse or keyboard, and the text can be copied with the Copy command. You can select text this way even if the text field is a dynamic text field instead of an input text field.

The default value is true.

The default value is true.
</body>

我在ScrollPane中添加了带有以下ActionScript代码的文本字段:

var scrollable_text:TextField = new TextField();


 scrollable_text.width=340;
scrollable_text.height=600;
scrollable_text.wordWrap=true;
scrollable_text.multiline=true;
scrollable_text.autoSize=TextFieldAutoSize.CENTER;

var style:StyleSheet = new StyleSheet(); 
style.parseCSS("body{font-family: Arial;} h1{font-size: 28px;font-weight: bolder;color:#87CA36;}");

scrollable_text.styleSheet=style;
scrollable_text.htmlText=hotspotWindowText[currentIndex]; //Fetching the HTML code from the array

scrollBox.source=scrollable_text;

以下是Flash Player中的输出:

enter image description here

正如您所看到的,在“布尔值...”和“是否......”之前还有额外的空格。我不知道为什么会这样。我做错了什么?

1 个答案:

答案 0 :(得分:0)

实际上,问题是我没有在我阅读HTML的XML文件中添加标记。显然,如果您不使用HTML内部编写HTML,HTML标记将始终是自动的。