// LOADING HTML FILE
var myVars:LoadVars = new LoadVars();
_root.myVars.load("example.htm");
_root.myVars.onData = function(content:String) {
// To add tabstops to our text we use the html tag <textformat>
/* Definition from Flash Help
The <textformat> tag lets you use a subset of paragraph formatting
properties of the TextFormat class within HTML text fields, including
line leading, indentation, margins, and tab stops. You can combine
<textformat> tags with the built-in HTML tags.
*/
// We are setting the tabstop property to a number so the first column
// displays in a single row. Try different numbers to see the effect.
htmlContent = "<textformat tabstops='[200]'>";
// The columns in our html had to be divided by some character so we can split
// it into colums. I have used "|" but you can use a character you know
// it won't be in the text of the column
var tempArray:Array = content.split("|");
// After splitting our html, we have to add the tab character (\t) to the end
// of the pieces.
for (var i = 0; i<tempArray.length; i++) {
htmlContent += tempArray[i]+"\t";
}
// Don't forget to close the textformat tag
htmlContent += "</textformat>";
mytext_txt.htmlText = htmlContent;
};