Is there a way to control the vertical space between two HTML paragraphs, in an AS3 TextField?
I understand and have successfully applied CSS styles via AS3 and have also utilized the TextFormat class.
I am still unable to control the vertical space between a closing and an opening <p> tag:
txt.htmlText = "<p>First paragraph here.</p><p>Second paragraph here.</p>";
The example above renders with the correct font and letter-spacing, but the space between paragraphs is either two-times too tall if txt.condenseWhite = false or it is too condensed if txt.condenseWhite = true.
Since only margin-left and margin-right are available CSS attributes in AS3, and not margin-top or margin-bottom, I am at a loss.
Thanks!
I was able to get it to work by creating a new
TextFieldinstance for each HTML paragraph.Here is an abbreviated example:
I also added a TextFormat instance that controls letterspacing (
TextFormat.letterSpacing).And, to control the overall leading, I had to implement the solution listed here, where a
<textformat>tag is appended to the string which will be displayed ashtmlTextin the TextField.Example: