check whether the content is successfully loaded or not with UILoader using flash actionscript

Posted by Vineela | Flash, as3, utils | Saturday 6 December 2008 10:51 am

import fl.controls.TextArea;
import fl.containers.UILoader;

var uiL:UILoader = new UILoader();
uiL.addEventListener(IOErrorEvent.IO_ERROR, uiLoader_ioError);
uiL.source = "SOMETHING.jpg";
addChild(uiL);

function uiLoader_ioError(evt:IOErrorEvent):void {
    var tF:TextFormat = new TextFormat();
    tF.color = 0x0000FF;
    tF.font = "Monotype Corsiva";
    tF.bold = true;
   tF.size = 14;

   var tA:TextArea = new TextArea();
   tA.setStyle("textFormat", tF);
   tA.text = evt.text;
   tA.width = 300;
   addChild(tA);
}