I’m trying to apply CSS to text that is loaded from an external text file. Now, it works fine when I play it in the movie file “current.swf”. Here is the code as it is-
var format = new TextField.StyleSheet();
var path = "jbcss.css";
format.load(path);
format.onLoad = function(success) {
if (success) {
output.styleSheet = format;
myLoadVar = new LoadVars ();
myLoadVar.load("news.txt");
myLoadVar.onLoad = function (success){
if (success == true) {
output.variable = "news";
output.htmlText=myLoadVar.news;
}
}
} else {
output.text = "Error loading CSS file!";
}
};
Everything works great until I load “current.swf” into an empty movie clip called “contents” in my main movie timeline. When I play the main movie, I get “Error loading CSS file!”.
I’ve tried (what I feel has been) every targetting possibility to get this to work, with much frustration and no results. Any suggestions???