I am publishing a flash movie for Flash Player 7 and actionscript 2.0 with the following code: this.createTextField("txt", 1, 0, 0, 230, 200); txt.type = "dynamic"; txt.autoSize = "left"; txt.align = "left"; txt.multiLine = true; txt.wordWrap = true; txt.html = true; txt.htmlText="hello<br>test<br>asdf"; I can see the text, however the <br> tags do not cause a linebreak to occur. I've tested this with other tags that should cause some sort of linebreak (<li></li> .. <p></p> .. <span> </span>) and all of the text appears on a single line, regardless. Any suggestions would be greatly appreciated....
Try using newline instead: txt.htmlText = "hello\ntest\nasdf";
That worked. However, if I am importing my HTML from a file, new-lines don't appear to cause a new line in the text field, and "\n" appears as "\n" and not as a new line. For example: item=This is a test will be displayed as "Thisisatest" in my TextField. item=This\nis\na\ntest\n will be displayed as "This\nis\na\ntest\n" I experimented with including some hex code in my text, to cause a new line, but haven't figured out the right way yet. Anyone have any ideas? Also, it seems to me this is a bug. The documentation for Actionscript says the <br> tag is supported in htmlText. Am I correct? or is this working as intended?
Oh, I found the problem. You have a simple syntax error on multiline. txt.multiline = true; // no capitals
Don't see what you're looking for? Try a search.
|