# creatTextField

**URL:** <https://forum.kirupa.com/t/creattextfield/94599>\
**Category:** Uncategorized\
**Created:** [November 14, 2003, 1:16pm UTC](https://forum.kirupa.com/t/creattextfield/94599 "2003-11-14T13:16:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brusca](https://avatars.discourse-cdn.com/v4/letter/b/47e85d/32.png) [@Brusca](https://forum.kirupa.com/u/Brusca)\
**Post date:** [November 14, 2003, 1:16pm UTC](https://forum.kirupa.com/t/creattextfield/94599/1 "2003-11-14T13:16:41Z")

</div>

Hi Guys,  
I am creating a textfield with AS and calling on an external HTML field to populate it. While this works fine I cannot get an external style sheet to format it. I am unsure of the problem.

If I place a dynamic textfield on the stage and target the instance the style sheet has no problem formatting the text. But created with AS I can’t get the style sheet to work. Here is my code.

//create field  
this.createTextField(“content\_txt”, 10, 0, 0, 390, 0);

//create and load styles  
var ss:TextField.StyleSheet = new TextField.StyleSheet();  
ss.load(“sample.css”);  
content\_txt.styleSheet = ss;

//text field attributes  
content\_txt.multiline= true;  
content\_txt.wordWrap = true;  
content\_txt.html = true;  
content\_txt.autoSize = true;

//load in exterrnal information  
story = new XML();  
story.ignoreWhite = true;  
story.load(“home2.html”);  
story.onLoad = function () {   
content\_txt.htmlText = story;  
}

Any clues?  
Cheers
