# Applying CSS to Externally Loaded Text HELP!

**URL:** <https://forum.kirupa.com/t/applying-css-to-externally-loaded-text-help/169726>\
**Category:** Uncategorized\
**Created:** [November 18, 2005, 7:52pm UTC](https://forum.kirupa.com/t/applying-css-to-externally-loaded-text-help/169726 "2005-11-18T19:52:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![riceroy](https://avatars.discourse-cdn.com/v4/letter/r/dfb087/32.png) [@riceroy](https://forum.kirupa.com/u/riceroy)\
**Post date:** [November 18, 2005, 7:52pm UTC](https://forum.kirupa.com/t/applying-css-to-externally-loaded-text-help/169726/1 "2005-11-18T19:52:00Z")

</div>

Ok im stuck here. im using the “Applying CSS to Externally Loaded Text” method of loading html into my flash movie. i got it to work with 1 text field but i need it to load for 3 text fields. with 3 different external files. i already have 3 different text boxes named differently but i cant get the rest to work. i dont know much about action scripting or flash scripting so i did my cut and paste thing. heres the code:

var format = new TextField.StyleSheet();  
var test = new TextField.StyleSheet();  
var another = new TextField.StyleSheet();

var path = “whats\_gnu\_styles.css”;  
format.load(path);

format.onLoad = function(success) {  
if (success) {  
txt.styleSheet = format;  
myLoadVar = new LoadVars();  
myLoadVar.load(“whatsgnu.txt”);  
myLoadVar.onLoad = function(success) {  
if (success == true) {  
txt.variable = “whatsgnu”;  
txt.htmlText = myLoadVar.whatsgnu;  
}  
};  
}  
else {  
txt.text = “Error loading CSS file!”;  
}  
};

test.load(path);  
test.onLoad = function(success) {  
if (success) {  
testt.styleSheet = test;  
myLoadVar = new LoadVars();  
myLoadVar.load(“testtxt.txt”);  
myLoadVar.onLoad = function(success) {  
if (success == true) {  
testt.variable = “testtxt”;  
testt.htmlText = myLoadVar.testtxt;  
}  
};  
}  
else {  
testt.text = “Error loading CSS file!”;  
}

};  
another.load(path);  
another.onLoad = function(success) {  
if (success) {  
txt.styleSheet = another;  
myLoadVar = new LoadVars();  
myLoadVar.load(“whatsgnu.txt”);  
myLoadVar.onLoad = function(success) {  
if (success == true) {  
testa.variable = “anothertxt”;  
testa.htmlText = myLoadVar.anothertxt;  
}  
};  
}  
else {  
testa.text = “Error loading CSS file!”;  
}  
};
