# CSS to external txt file tutorial

**URL:** <https://forum.kirupa.com/t/css-to-external-txt-file-tutorial/63348>\
**Category:** flash\
**Created:** [September 5, 2004, 7:21pm UTC](https://forum.kirupa.com/t/css-to-external-txt-file-tutorial/63348 "2004-09-05T19:21:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![delgar](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/delgar/32/745_2.png) [@delgar](https://forum.kirupa.com/u/delgar)\
**Post date:** [September 5, 2004, 7:21pm UTC](https://forum.kirupa.com/t/css-to-external-txt-file-tutorial/63348/1 "2004-09-05T19:21:00Z")

</div>

Hi,  
I completed the tutorial to apply CSS to externally loaded txt file. It works fine if the movie is loaded at \_level0 but not at \_level1 which is what I need. Any ideas? here is the code.

var format = new TextField.StyleSheet();  
var path = “[http://www.theconstellationgroup.com/styles.css](http://www.theconstellationgroup.com/styles.css)”;  
format.load(path);  
format.onLoad = function(loaded) {  
if (loaded) {  
output.styleSheet = format; //“output” is text field instance name  
myLoadVar = new LoadVars();  
myLoadVar.load(“the\_experience.txt”);  
myLoadVar.onLoad = function (success){  
if (success == true) {  
output.variable = “myText” //this is variable created for “output” text field  
output.htmlText=myLoadVar.myText;  
}  
}  
} else {  
output.text = “Error loading CSS file!”;  
}  
};
