Flash Ignores HTML Tags!
UPDATE: When you use the setting "multiline" you should never capitalize the "L" in that word. Too bad that neither the Flash IDE Compiler nor MTASC barks at me about this. Live and learn, people!
Normally I don't have a lot of problems with Flash. But when the LiveDocs say that the "<p>" tag works in Flash, then it should work, right?
Well, I am in a situation with some Flash code that makes no sense to me. I have some simple code that puts text into a Label (using createLabel() so that it makes a TextField) but I can't seem to load HTML into it. The "<p>" and "<br>" (and "<br />") tags are being ignored, or skipped. I am very confused.
To prove myself wrong I ceated a very simple piece of code to go into frame one of an FLA timeline and sent it to JesterXL for another diagnosis:
leif_lbl.html = true;
leif_lbl.multiLine = true;
leif_lbl.wordWrap = true;
leif_lbl.border = true;
leif_lbl.htmlText = "<P>Hello.</P><P>My name is Leif.</P><P>Why don't you say hello?</P>";
trace("leif: " + leif_lbl);
trace(" text: " + leif_lbl.htmlText);
His response: " Um... ok, that's f'd up. I'm seeing the same thing you are on my Mac."
So, in all my Model-View-Control patterned, ARP frameworked, Eclipse environment I must have forgotten something about the TextField object that makes something like this work.
The following code will output this:
leif: _level0.leif_lbl
text: <P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000">Hello.My name is Leif.Why don't you say hello?</FONT></P>
Please note that the paragraph tags have been completely removed from the string and the string is butted together. That makes no sense to me at all.
Someone, anyone out there — what the heck is going on?
3732 Views





Comments
leif_lbl.multiLine = true;
to:
leif_lbl.multiline = true;
Thanks, Jason. That looks like the very problem!
"OMG! How CUTE!!!"
"Yeah... I wanna pet it, think it'll bite?"
*MEGA-CHOMP*
The <p> tag is not supported by flash. Instead to achieve the same result use 2 <br> tags and your problem of <p> tag should be resolved.