سؤال

This is the HTML text I am adding in a text field:

<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>

I am adding that text field in a ScrollPane with the following ActionScript code:

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;

Here is the output inside the Flash Player:

enter image description here

As you can see, there is extra space before "A Boolean..." and "Whether...". I have no idea why this is happening. What am I doing wrong?

هل كانت مفيدة؟

المحلول

Actually, the problem was I didn't add the tag in the XML file from where I was reading the HTML. Apparently, if you don't write HTML inside XML using , the HTML tags will always be auto intended.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top