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