private var _bitmapData:BitmapData; private var _loader:Loader = new Loader(); private var _outline:Shape;
public function Main () { _loader.load(new URLRequest("http://www.navioo.com/samplefiles/image2.jpg")); _loader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler);
addEventListener(MouseEvent.CLICK, clickHandler);
}
private function completeHandler(event:Event):void {
var w:Number = _loader.width; var h:Number = _loader.height;
_bitmapData = new BitmapData(w, h); _bitmapData.draw(_loader);
var bitmap:Bitmap = new Bitmap(_bitmapData); var container:Sprite = new Sprite(); addChild(container); container.addChild(bitmap);
_outline = new Shape(); addChild(_outline);
}
private function clickHandler(event:MouseEvent):void {