Thursday, November 20, 2008

Loading external images and reacting to load complete and smoothing bitmap

var slideLoader:Loader=new Loader();
csHostRef.addChild(slideLoader);

slideLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, slidePreloaded);
slideLoader.load(new URLRequest(xml.slide[currentSlide].mediaURL));

function slidePreloaded(){
//do stuff here now that pict has loaded

//...and this will smooth the bitmap so it doesnt look crappy scaling
var smoother_bm=Bitmap(slideLoader.content);
smoother_bm.smoothing=true;
}


No comments: