Topic: Fetching HTML in Flash Document

I'm unfamiliar with flash but thought I'd still have a spin at a widget. Is there any method of implementing a web page in the widget? As in just feeding it an URL and embedding it in a window component or whatever. I'd much fancy a simple method of doing such a thing, if it is at all possible.

Re: Fetching HTML in Flash Document

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 *****     ***   **  * *

Re: Fetching HTML in Flash Document

It should be noted that Flash Lite's ability to render HTML tags is even more limited than the standard desktop Flash Player.