NapalmDeath
01-08-2008, 01:00 AM
Hi There,
I'm just trying to load an external html file (home.html) into my dynamic text box (hometxt) while also assigning a style sheet to it.
Now i see to remember this script was fine in flash8 but in CS3 its producing a "syntax error" for the line that is highlighted.
No matter what i change it still doesn't work. Any pointers on where I'm going wrong ?
hometxt.border = true;
hometxt.html = true;
hometxt.multiline = true;
hometxt.wordWrap = true;
var myVars_lv:LoadVars = new LoadVars();
var styles:TextField.StyleSheet = new TextField.StyleSheet();
var txt_url:String = "text_files/home.html";
var css_url:String = "text_files/jackie.css";
styles.onLoad = function(success:Boolean):Void {
if (success) {
hometxt.styleSheet = styles;
} else {
trace("Unable to load CSS file.");
}
};
styles.load(css_url);
myVars_lv.onData = function(src:String):Void {
if (src != undefined) {
hometxt.htmlText = src;
} else {
trace("Unable to load HTML file");
}
};
myVars_lv.load(txt_url);
I'm just trying to load an external html file (home.html) into my dynamic text box (hometxt) while also assigning a style sheet to it.
Now i see to remember this script was fine in flash8 but in CS3 its producing a "syntax error" for the line that is highlighted.
No matter what i change it still doesn't work. Any pointers on where I'm going wrong ?
hometxt.border = true;
hometxt.html = true;
hometxt.multiline = true;
hometxt.wordWrap = true;
var myVars_lv:LoadVars = new LoadVars();
var styles:TextField.StyleSheet = new TextField.StyleSheet();
var txt_url:String = "text_files/home.html";
var css_url:String = "text_files/jackie.css";
styles.onLoad = function(success:Boolean):Void {
if (success) {
hometxt.styleSheet = styles;
} else {
trace("Unable to load CSS file.");
}
};
styles.load(css_url);
myVars_lv.onData = function(src:String):Void {
if (src != undefined) {
hometxt.htmlText = src;
} else {
trace("Unable to load HTML file");
}
};
myVars_lv.load(txt_url);