加载照片
private var picLoder:Loader;
private var picLoderRequest:URLRequest;
private function pictureLoder():void
{
picLoder = new Loader();
picLoderRequest = new URLRequest("resource/pic/girl.jpg");//resouce文件夹和swf文件同级
picLoder.contentLoaderInfo.addEventListener(Event.COMPLETE,loderCompleteHandler);//架设监听
picLoder.load(picLoderRequest);//开始加载
}
private function loderCompleteHandler(evt:Event):void
{
var pic:DisplayObject = LoaderInfo(evt.target).content;
pic.width = picContainer.width;
pic.height = picContainer.height;
picContainer.addChild(pic);
}