Loading External Text with CSS

Hi guys,

I’ve been following the below tutorial after completeing Kirupa’s one but for some reason which I don’t understand why it is not picking up the kirupa.txt file that I have contained in the same folder as the .fla. Is there any reason why this is happening. The code is below

var format = new TextField.StyleSheet();
var path = "http://www.kirupa.com/developer/mx2004/code/flash.css";
format.load(path);
format.onLoad = function(success) {
    if (success) {
        output.styleSheet = format;
        myLoadVar = new LoadVars();
        myLoadVar.load("kirupa.txt");
        myLoadVar.onLoad = function(success) {
            if (success == true) {
                output.variable = "kirupa";
                output.htmlText = myLoadVar.kirupa;
            }
        };
    } else {
        output.text = "Error loading CSS file!";
    }
};

http://www.kirupa.com/developer/mx2004/cssfile.htm

Thanks

Lewny :smirk2: