Skip to content

Using xmlLoader.parseData property supresses errors in the browser #23

@BigPhilCombo

Description

@BigPhilCombo

If you set the parseData property then all subsequent errors in the browser do not get output to the console. The following example does the trick

static function main() 
{
    var a:Array<Int> = null;        

    var queue = new LoaderQueue();

    queue.maxLoading = 2; // max concurrent
    queue.ignoreFailures = true; // carry on regardless
    queue.loaded.add(function(event:LoaderEvent<Dynamic>):Void {            
        trace("Loaded");
        a.push(3);//This will not output a runtime error
    }).forType(Complete);

    var xmlLoader = new XmlLoader("xml/project.xml");
    xmlLoader.parseData = function( xmlData:Xml):Xml {          
        return xmlData;
    }

    queue.add( xmlLoader );     
    queue.load();

    a.push(10); //This generates an error as expected
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions