# htmlText and StyleSheet

**URL:** https://forum.kirupa.com/t/htmltext-and-stylesheet/266866
**Category:** flash
**Created:** [July 25, 2008, 1:00am UTC](https://forum.kirupa.com/t/htmltext-and-stylesheet/266866 "2008-07-25T01:00:53Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![mleep](https://avatars.discourse-cdn.com/v4/letter/m/ea5d25/32.png) [@mleep](https://forum.kirupa.com/u/mleep)
#### Post date: [July 25, 2008, 1:00am UTC](https://forum.kirupa.com/t/htmltext-and-stylesheet/266866/1 "2008-07-25T01:00:53Z")

</div>

Pretty simple code here, works just fine.

```auto
var myStyles:TextField.StyleSheet = new TextField.StyleSheet();
myStyles.setStyle("p", {color:'#808080'});
myStyles.setStyle("h1", {color:'#84ABDB'});
this.createTextField("my_txt",this.getNextHighestDepth(),20,20,260,50);
my_txt.styleSheet = myStyles;
my_txt.html = true;
my_txt.htmlText = "<p>Name: </p>";
my_txt.htmlText += "<h1>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</h1>";

```

Here is my problem - want to make a variable and put it between the style tags.

For instance:

```auto
var blah:String = "Hello there";
my_txt.htmlText = "<p>blah</p>";

```

Without it just writing “blah” I need it to get the string from the variable. How would I accomplish this?
