I have this peace of code that i write to load text from an Html file and put it on the screen.
When i use it on a empty flash movie it works fine you get to see the text and stuff.
[COLOR=Blue]// Create the new StyleSheet object.
var cssStyles:TextField.StyleSheet = new TextField.StyleSheet();
// Define the styles.
cssStyles.setStyle(“html”, {fontFamily: “_sans”});
cssStyles.setStyle(“textAlign”, “center”);
cssStyles.setStyle(".code", {marginLeft: 15, fontFamily: “_typewriter”});
cssStyles.setStyle(“h1”, {fontWeight: “bold”});
cssStyles.setStyle(“a”, {textDecoration: “underline”, color: “#0000FF”});
cssStyles.setStyle(“a:hover”, {color: “#AAAAFF”});
cssStyles.setStyle(“a:active”, {color: “#FF00FF”});
// Create the TextField object.
this.createTextField(“tOutput”, this.getNextHighestDepth(), 2, 2, 500, 300);
// Set the properties of the TextField object such that it
// has a border, renders as HTML, handles multiple lines
// of text with word wrap, and condenses whitespace.
tOutput.html = true;
tOutput.multiline = true;
tOutput.wordWrap = true;
tOutput.condenseWhite = true;
tOutput.selectable = false;
tOutput.autoSize = “left”;
tOutput.scroll = true;
// Apply the style sheet to the TextField object.
tOutput.styleSheet = cssStyles;
// Define a LoadVars object for loading the HTML.
var lvHTML:LoadVars = new LoadVars();
// When the data loads, assign the value to the htmlText
// property of the TextField object.
lvHTML.onData = function(sData:String):Void {
tOutput.htmlText = sData;
};
// Tell Flash to load the HTML.
lvHTML.load(“softrevolt.html”);
stop();
[/COLOR]
Then I copy /paste all of the code and I put it on the bigger movie and it give sme following error.
*
[COLOR=Blue]Error Scene=Scene 1, layer=softtext, frame=420:Line 2: Syntax error.
var cssStyles:TextField.StyleSheet = new TextField.StyleSheet();
Total ActionScript Errors: 1 Reported Errors: 1
[COLOR=Black]does anybody have an idea what the problem might be?
thx!!
[/COLOR][/COLOR]*