I have the following code:
Console.Debug("SETTING VALUE: ");
Console.Debug(value);
Console.Debug("BEFORE: ");
Console.Debug(_field.htmlText);
_field.htmlText = value;
Console.Debug("AFTER: ");
Console.Debug(_field.htmlText);
(Where value is some HTML passed in, and _field is, you guessed it, a
TextField).
The output of this code is as follows:
DEBUG: SETTING VALUE:
DEBUG: <P ALIGN="LEFT" xmlns:jcfx="http://www.jcfx.eu">
<FONT FACE="MyArial" SIZE="11" COLOR="#000000">
[B]Glenn Lawrence[/B]
<FONT SIZE="7">
[B]ACIB[/B]
</FONT>
<FONT SIZE="8">Director</FONT>
</FONT>
</P>
DEBUG: BEFORE:
DEBUG: [Traces nothing, showing the field is empty]
DEBUG: AFTER:
DEBUG: <P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000"
LETTERSPACING="0" KERNING="0"></FONT></P><P ALIGN="LEFT"><FONT FACE="Times New
Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0"> <FONT
FACE="MyArial" SIZE="11"></FONT></FONT></P><P ALIGN="LEFT"><FONT FACE="MyArial"
SIZE="11" COLOR="#000000" LETTERSPACING="0" KERNING="0"> [B]Glenn
Lawrence[/B]</FONT></P><P ALIGN="LEFT"><FONT FACE="MyArial" SIZE="11"
COLOR="#000000" LETTERSPACING="0" KERNING="0"> <FONT
SIZE="7"></FONT></FONT></P><P ALIGN="LEFT"><FONT FACE="MyArial" SIZE="7"
COLOR="#000000" LETTERSPACING="0" KERNING="0"> [B]ACIB[/B]</FONT></P><P
ALIGN="LEFT"><FONT FACE="MyArial" SIZE="7" COLOR="#000000" LETTERSPACING="0"
KERNING="0"> <FONT SIZE="11"></FONT></FONT></P><P ALIGN="LEFT"><FONT
FACE="MyArial" SIZE="11" COLOR="#000000" LETTERSPACING="0" KERNING="0">
<FONT SIZE="8">Director</FONT></FONT></P><P ALIGN="LEFT"><FONT FACE="MyArial"
SIZE="11" COLOR="#000000" LETTERSPACING="0" KERNING="0"> <FONT FACE="Times New
Roman" SIZE="12"></FONT></FONT></P>
All of this is AS 3.0, building with Flex 3 and targeting FP9. My tracing
class prepends the "DEBUG: " to each line of output.
My Question: Where is all the extra Times New Roman junk coming from?
Is this the defaultTextFormat for the field being applied and if so, how to
stop it?
Or, is this some kind of whitespace issue? The text in question is loaded from
an xml file and then parsed as a string property on a business object. If I
prepend and append ">>" and "<<" to the trace of value, I can see there is no
trailing content before or after the <P> tags.
Or, finally, is it something to do with the xmlns declaration?
Any help would be much appreciated.
JcFx.Eu - 25 Jul 2008 17:07 GMT
In partial answer to myself, this may be a defaultTextFormat issue. If I set an
empty stylesheet on the textfield and then run the code above, I don't get the
junk. I don't get any display either, though (presumably vecause of the empty
stylesheet). Does anyone know how to get the textfield to not do this?