Loading a bitmap at runtime
package {
import flash.display.*;
import flash.events.*;
import flash.net.*;
public class Main extends Sprite {
private var loader:Loader = new Loader( );
public function Main() {
loader.contentLoaderInfo.addEventListener(Event.INIT,initListener);
loader.load(new URLRequest("photo.jpg"));
}
private function initListener (e:Event):void {
addChild(loader.content);
trace(Bitmap(loader.content).bitmapData.getPixel(0, 0));
}
}
}
Related examples in the same category