# Common css file for all text fields

**URL:** <https://forum.kirupa.com/t/common-css-file-for-all-text-fields/324911>\
**Category:** flash\
**Created:** [September 15, 2011, 10:17am UTC](https://forum.kirupa.com/t/common-css-file-for-all-text-fields/324911 "2011-09-15T10:17:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![warobushek](https://avatars.discourse-cdn.com/v4/letter/w/8491ac/32.png) [@warobushek](https://forum.kirupa.com/u/warobushek)\
**Post date:** [September 15, 2011, 10:17am UTC](https://forum.kirupa.com/t/common-css-file-for-all-text-fields/324911/1 "2011-09-15T10:17:04Z")

</div>

Hello. Please, help me.

I want format all textfields of my flash-app with single css;

I’ve already written this function:

```auto

function formatWithCss(field, xml_html) {
    field.html = true;
    field.wordWrap = true;
    field.multiline = true;
    field.condenseWhite = true;
    
    var css = new TextField.StyleSheet();
    css.onLoad = function(success) {
       field.styleSheet = css;
       field.htmlText = xml_html;
    };
    css.load('styles.css');
}

```

Big disadvantage of this approach is that my app opens styles.css for each textfield.  
How can I read styles.css once and use it many times?
