jeudi 9 février 2017

How to handle error dialog boxes in ActionScripts 3

I write some code to check an XML from a URL, it works when Internet connection exist, but when i manually disable internet for test an Error dialog box show, i coudn't handle it with try() catch().

try {
    var myXML: XML = new XML();
    var XML_URL: String = "";
    var myXMLURL: URLRequest = new URLRequest(XML_URL);
    var myLoader: URLLoader = new URLLoader(myXMLURL);
    myLoader.addEventListener(Event.COMPLETE, xmlLoaded);

    function xmlLoaded(event: Event): void {
        myXML = XML(;
        trace("LOCK CODE: " + myXML.LOCK);
        if (myXML.LOCK == 0) {
} catch (e: Error) {
    trace("FAILED TO CHECK LOCK.");
} finally {
    trace("FAILED TO CHECK LOCK.");

How can i hide this dialog from user?

Aucun commentaire:

Enregistrer un commentaire