A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Error handling for file not file

  1. #1
    Senior Member
    Join Date
    Jan 2001
    Posts
    567

    [FIX-ED] Error handling for file not found

    Which I thought was going to be really easy. Then I learn the error is probably not the type to be handled by try... catch. Sooooo I try listening for the event, but it doesn't seem to care for my AsyncErrorEvent or how I've done it below with the IOErrorEvent...

    Still gives me "Error #2044: Unhandled IOErrorEvent:. text=Error #2035: URL Not Found."

    What am I doing wrong? I looked at the senocular (http://www.senocular.com/flash/tutor...?page=3#errors) tut,and thought it may be something to do with "new Loader()", bit I can't seem to comeup with a way around that.


    Code:
     
    function upHandler_SmallSite(event:MouseEvent):void {	
    	//load the image for this location
    	var pictLdr:Loader = new Loader();
    	var pictURL:String = "images/" + aList[array.indexOf(event.target)].@id + ".jpg";
    	var pictURLReq:URLRequest = new URLRequest(pictURL);
            pictLdr.load(pictURLReq);
       		pictLdr.contentLoaderInfo.addEventListener(Event.COMPLETE, imgLoaded);
    		pictLdr.addEventListener(IOErrorEvent.IO_ERROR, loadIOError);
    		mcBigInfoBox.mcBigInfo_Image.addChild(pictLdr);
       }   
       
    // Handler for IO error
    function loadIOError(event:IOErrorEvent):void {
        trace("ErroR");
    }
    Last edited by eggler; 09-13-2007 at 02:35 AM.

  2. #2
    Bearded (M|G)od MyFriendIsATaco's Avatar
    Join Date
    Dec 2002
    Location
    Awesomeville.
    Posts
    3,045
    pictLdr.addEventListener(IOErrorEvent.IO_ERROR, loadIOError);

    needs to be:

    pictLdr.contentLoaderInfo.addEventListener(IOError Event.IO_ERROR, loadIOError);

  3. #3
    Senior Member
    Join Date
    Jan 2001
    Posts
    567
    Ah.

    Thank you!


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center