Greetings,
So I have a scrollPane component, and I'm constantly loading a big number of files to it, so I need to check wheter this file exists or not, obviously if the file is not found, flash throws a IOErrorEvent exception, which I've tried to handle via catch method to no good. This is what I've been doing;
var req:URLRequest = new URLRequest(r);
try
{
holder.load(r);
}
catch(error:IOErrorEvent)
{
trace("lolerror");
}
And it doesn't catch it (also tried looking for error:Error type of exceptions). As far as I know, try and catch are only for synchronous errors, and IOErrorEvent seemed to be asynchronous, so I tried a different approach:
var req:URLRequest = new URLRequest(r);
function ioerror(err:IOErrorEvent)
{
trace("lolerror");
}
holder.addEventListener(IOErrorEvent.IO_ERROR,ioerror);
holder.load(r);
But still with no success. Perhaps it's not the component itself to what I have to add the listener? I've tried adding it to the "content" property, but as I thought it was useless.
Please keep in mind this is a scrollPane component, AS3.
Thanks in advance.