A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: Trap a Loader error and handle it with default

Threaded View

  1. #1
    Senior Member
    Join Date
    Dec 2006
    Location
    Jax, FL
    Posts
    110

    Trap a Loader error and handle it with default

    Hello everyone,
    I am trying to trap a Loader error and handle with a default image.
    There are multiple loaders so I need to catch and fill the one that errors.

    Code:
    var gell:Loader = new Loader();
    addChild(gell);
    gell.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, errorCatcher);
    
    function errorCatcher(e:IOErrorEvent):void{
     // This is not working. Have tried both lines.
     //gell = Loader(e.target.loader);
     var gell:Loader = LoaderInfo(e.target).loader;
     gell.load(new URLRequest('blank.jpg'));
     
    }
    
    gell.load(new URLRequest('cat.jpg'));
    Any suggestions on this will be greatly helpful.
    Last edited by imdumb; 05-28-2009 at 10:23 AM.

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