Thanks guys that helped :)  I was looking at this example from the
programming in AS3

var request:URLRequest = new URLRequest("http://
www.[yourdomain].com/params.txt");
var variables:URLLoader = new URLLoader();
variables.dataFormat = URLLoaderDataFormat.VARIABLES;
variables.addEventListener(Event.COMPLETE, completeHandler);
try
{
variables.load(request);
}
catch (error:Error)
{
trace("Unable to load URL: " + error);
}

so here the trace statement would not get traced ??


firdosh



On 2/12/07, Ralf Bokelberg <[EMAIL PROTECTED]> wrote:

  Hi Firdosh,

the flash player loads things asynchronously.
This means, your try catch block is over before the error occurs.

Cheers,
Ralf.


On 2/13/07, Firdosh Tangri <[EMAIL PROTECTED]> wrote:
>
>   Hey I was playing around with error handling
>
> I did a simple external xml load
>
> var file:String=filePath +"vieweeer.xml";
> var xmlURL:URLRequest=new URLRequest(file);
> var xmlLoader:URLLoader=new URLLoader();
>
> try{
>    xmlLoader.load(xmlURL);
>
>
> }
> catch(err:IOError){
>    trace(err.message);
> }
>
>
> But It didnt catch the error, i get the error box when I run the app but
> no trace statement
>
>
> But if I do
>
> xmlLoader.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);
>
> it calls my errorHandler function
>
> Can someone please explain why the first way doesnt work ??
>
> thanks
> cheers :)
> firdosh
>
>


--
Ralf Bokelberg <[EMAIL PROTECTED]>
Flex & Flash Consultant based in Cologne/Germany
Phone +49 (0) 221 530 15 35

Reply via email to