Hi all,
I can’t seem to figure this out. I’m trying to apply a CSS stylesheet to a dynamic textbox that is populated with a random fact pulled from a .txt file. The text loads into the textbox but I can’t get the stylesheet to apply. I’d really appreciate any help. I’ve been working on this for days. Here’s the code:
var styles = new TextField.StyleSheet();
styles.load(“http://www.ganedentestsite.com/gbc30_site/swf/fastfact.css”);
styles.onLoad = function(loaded) {
if(loaded){
output_mc.output.styleSheet = styles; [COLOR=Red]/textbox name is “output” and it lives in movie clip “output_mc” on the root level/[/COLOR]
}else{
trace(“css didn’t load”); [COLOR=Red]/this is just so I could see what’s going on/[/COLOR]
}
[COLOR=Red]/Here’s where we start loading the random text from the .txt file. This part works fine./[/COLOR]
fastfact = new LoadVars();
fastfact.onLoad=function(success){
if(success){
ranNum = Math.ceil(Math.random()*16);
ranFact = this["quote"+ranNum];
output_mc.output.htmlText = ranFact;
}
else{
output_mc.output.htmlText="text failed";
}
}
fastfact.load("http://www.ganedentestsite.com/gbc30_site/swf/fastfact.txt");
};
Thanks!