# Odd behavior with htmlText, styleSheet, and \<a\>

**URL:** <https://forum.kirupa.com/t/odd-behavior-with-htmltext-stylesheet-and-a/271721>\
**Category:** flash\
**Created:** [September 26, 2008, 8:32pm UTC](https://forum.kirupa.com/t/odd-behavior-with-htmltext-stylesheet-and-a/271721 "2008-09-26T20:32:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stickeroo](https://avatars.discourse-cdn.com/v4/letter/s/e19adc/32.png) [@Stickeroo](https://forum.kirupa.com/u/Stickeroo)\
**Post date:** [September 26, 2008, 8:32pm UTC](https://forum.kirupa.com/t/odd-behavior-with-htmltext-stylesheet-and-a/271721/1 "2008-09-26T20:32:13Z")

</div>

I have a programmatically-generated text field that looks like this:

```auto

var tf:TextField=new TextField();
tf.styleSheet=styles;
tf.embedFonts=true;
tf.antiAliasType="advanced";
tf.selectable=false;
tf.width=760;
tf.multiline=true;
tf.wordWrap=true;
tf.autoSize="left";
tf.htmlText="<p>"+xmldoc.meta.welcomeText+"</p>";
tf.x=tf.y=20;

```

FYI, here’s what the styleSheet is based on:

```auto

css="p{font-family:"+(new HNC().fontName)+";font-size:16px;color:#333333} a{display:inline;color:#0000FF}";
styles=new StyleSheet();
styles.parseCSS(css);

```

(“HNC” is the identifier of a font included in the library.)

Everything appears to render properly – except (of course!) the anchor tags. Without a:hover, there’s just a weird extra space before the first instance of an anchor tag – once you mouse over it, it goes away. If I add back the a:hover style, anytime I mouse over either link, in one place, that space appears (and in another, adds a space at the end of the link!), and when I mouse off, it goes back to looking “normal.”

Has anyone else noticed this odd behavior? It’s too distracting and unprofessional-looking to leave the way it is, but I’m not sure what my alternatives are if I want to include links in the text (which is imported from an XML file).

I’d appreciate any advice! Also, this is in Flash CS3. Thanks!

EDIT: If I don’t embed the fonts, the “problem” goes away; however, I’m left with non-embedded fonts. Rarggh.
