# LoadHTML error test

**URL:** <https://forum.kirupa.com/t/loadhtml-error-test/302570>\
**Category:** flash\
**Created:** [January 3, 2010, 6:54pm UTC](https://forum.kirupa.com/t/loadhtml-error-test/302570 "2010-01-03T18:54:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ruiganga](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/ruiganga/32/3679_2.png) [@ruiganga](https://forum.kirupa.com/u/ruiganga)\
**Post date:** [January 3, 2010, 6:54pm UTC](https://forum.kirupa.com/t/loadhtml-error-test/302570/1 "2010-01-03T18:54:52Z")

</div>

HI

I can load HTML inside AS3. My problem is to have a way to display an error message if the path is incorrect and does not exist.

Here is my code:

var path:String = “[http://www.eyerix.net/pt/w/teste](http://www.eyerix.net/pt/w/teste)”;

// this will load the HTML page  
function textLoadComplete(event:Event):void  
{  
var xmlMenuContent:XML = new XML(textLoader.data);   
trace(xmlMenuContent);  
}

var textLoader:URLLoader = new URLLoader();  
var textReq:URLRequest = new URLRequest(path);

textLoader.addEventListener(Event.COMPLETE, textLoadComplete);

try {  
textLoader.load(textReq);  
}  
catch(err:Error) {  
trace("-- /////");  
trace(err.message);  
[//outputBox.appendText](https://outputBox.appendText)(err.message);  
//checkChances(“0”);  
trace("/////");  
}

I need help unserstanding what am I doing wrong because I can’t trace the error.

Thanks
