# Is this possible?

**URL:** <https://forum.kirupa.com/t/is-this-possible/66598>\
**Category:** Uncategorized\
**Created:** [October 7, 2004, 7:07am UTC](https://forum.kirupa.com/t/is-this-possible/66598 "2004-10-07T07:07:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hoodz](https://avatars.discourse-cdn.com/v4/letter/h/13edae/32.png) [@hoodz](https://forum.kirupa.com/u/hoodz)\
**Post date:** [October 7, 2004, 7:07am UTC](https://forum.kirupa.com/t/is-this-possible/66598/1 "2004-10-07T07:07:32Z")

</div>

is it possible to add a css style to a textfield that loads external text files?

i tried something like this but i think im doing it all wrong

[color=red]var format = new TextField.StyleSheet();  
var path = “css.css”;  
var quick = “description”  
format.load(path);  
format.onLoad = function(loaded) {  
if (loaded) {  
description\_txt.styleSheet = format;  
description\_txt.htmlText = description;  
} else {  
description\_txt.htmlText = “Error loading CSS file!”;  
}  
};[/color]  
[color=red]var thumb\_spacing = 40;  
var description\_lv = new LoadVars();  
description\_lv.onData = function(raw\_text){  
description\_txt.htmlText = raw\_text;  
}[/color]  
[color=red][/color]  
[color=red]function GeneratePortfolio(portfolio\_xml){  
var portfolioPictures = portfolio\_xml.firstChild.childNodes;  
for (var i = 0; i \< portfolioPictures.length; i++){  
var currentPicture = portfolioPictures\*;

var currentThumb\_mc = menu\_mc.createEmptyMovieClip(“thumbnail\_mc”+i,i);  
currentThumb\_mc.\_x = i \* thumb\_spacing;

currentThumb\_mc.createEmptyMovieClip(“thumb\_container”,0);  
currentThumb\_mc.thumb\_container.loadMovie(currentPicture.attributes.thumb);

currentThumb\_mc.title = currentPicture.attributes.title;  
currentThumb\_mc.image = currentPicture.attributes.image;  
currentThumb\_mc.description = currentPicture.attributes.description;

currentThumb\_mc.onRollOver = currentThumb\_mc.onDragOver = function(){  
info\_txt.text = this.title;  
}  
currentThumb\_mc.onRollOut = currentThumb\_mc.onDragOut = function(){  
info\_txt.text = “”;  
}  
currentThumb\_mc.onRelease = function(){  
image\_mc.loadMovie(this.image);  
description\_lv.load(this.description);  
}  
}  
}[/color]  
[color=red]// xml object for xml content (defines sources for selections)  
var portfolio\_xml = new XML();  
portfolio\_xml.ignoreWhite = true;  
portfolio\_xml.onLoad = function(success){  
if (success) GeneratePortfolio(this);  
else trace(“Error loading XML file”); // no success? trace error (wont be seen on web)  
}  
// load  
portfolio\_xml.load(“webdsign.xml”);[/color]

description\_txt is the text field where i want to add a ccs style

i hope someone can help me 🙂
