interestingly enough you can load a .htm (or .html) file into flash using the XML functions. Flash doesn't care that the extension is not .xml, it just loads the text as a generic xml document. once the html (which is really just one flavor of xml) is loaded into flash convert it to a string and display it in a variable text field with "render as html" switched on, which can either be done with script or in the flash authoring environment itself. However, be aware that flash is limited in which particular html tags it will render. code sample below, place it on the first frame of a blank fla, you will need an html file called "sample.html" as well.
/*
** set the URL from which the html will be loaded
*/
htmlURL = "sample.html";
/*
** create a text field and set it to render html
*/
this.createTextField("textBox", 1, 5, 5, 310, 230);
textBox.multiline = true;
textBox.wordWrap = true;
textBox.border = true;
textBox.html = true;
/*
** create an xml object and load an external html file into it
*/
var htmlFile:XML = new XML();
htmlFile.ignoreWhite = true;
//
htmlFile.onLoad = function(success) {
//
// this is where the xml gets inserted into the text field
//
textBox.htmlText = htmlFile.toString();
};
/*
** load the html from the external file
*/
htmlFile.load(htmlURL);
* * ** *** ***** Joseph Gray
Grauwald Creative ***** *** ** * *