0
votes

I'm using the following:

var loader:Loader = new Loader();

function displayHTML():void {
    var request:URLRequest = new URLRequest("assets/index.html");
    loader.load(request);
    holder_mc.addChild(loader);
}

displayHTML();

I'm working with Flash. I have a main.swf movie, and the above code is in the ActionScript file mainDocument.as. I have an empty movie clip called holder_mc on my stage.

I can use the above method just fine to load a .swf, but when I try to load an HTML page, I get the following error:

Error #2044: Unhandled IOErrorEvent:. text=Error #2035: URL Not Found.

Thanks!

1

1 Answers

3
votes

The Loader class is used to load SWF files or image (JPG, PNG, or GIF) files.

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/Loader.html

If you're doing an AIR projest you can use HTMLLoader http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/html/HTMLLoader.html

Or URLLoader if not in AIR http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/URLLoader.html. But then you'll only have the source code, no html rendering.