# Textfield.StyleSheet not working (CSS)

**URL:** <https://forum.kirupa.com/t/textfield-stylesheet-not-working-css/195124>\
**Category:** flash\
**Created:** [July 28, 2006, 3:35pm UTC](https://forum.kirupa.com/t/textfield-stylesheet-not-working-css/195124 "2006-07-28T15:35:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![takethetrain](https://avatars.discourse-cdn.com/v4/letter/t/ba8739/32.png) [@takethetrain](https://forum.kirupa.com/u/takethetrain)\
**Post date:** [July 28, 2006, 3:35pm UTC](https://forum.kirupa.com/t/textfield-stylesheet-not-working-css/195124/1 "2006-07-28T15:35:28Z")

</div>

The tutorials for using CSS in Flash seem pretty straightforward, but for some reason they just don’t work for me. I’m using this code:

```auto

this.createTextField("myText", 1, 100, 100, 300, 100);
myText.multiline = true;
myText.wordWrap = true;
myText.html = true;
var myFormat:TextField.StyleSheet = new Textfield.StyleSheet();
myFormat.onLoad = function(success) {
    trace("yay");
    if(success) {
        myText.styleSheet = myFormat;
        myText.htmlText = "<p class='big'>Yes!</p><p class='small'>It works.</p>";
    } else {
        myText.htmlText = "Aw.";
    }
}
myFormat.load("default.css");

```

This is my CSS file:

```auto

.big, .small {
        color: #000000;
        }
.big {
        font-size: 16px;
        }
.small {
        font-size: 10px;
        }

```

When I Debug\>Variables, there is one line in particular that seems to be the key:

> 

Variable \_level0.myFormat = undefined

Any ideas? I’m sure the answer must be simple, but I just can’t see it.
