package com.asdia.comptest { import flash.display.Bitmap; import flash.display.Loader; import flash.display.Sprite; import flash.events.Event; import flash.net.URLRequest; import flash.system.System; public class DisplayTesting extends Sprite { public var text:String ; private static var _loader:Loader= null; public function DisplayTesting() {
} public function LoadImg():void{ //_loader=new Loader(); _loader=getLoaderIntance(); _loader.contentLoaderInfo.addEventListener(Event.COMPLETE,showImg) if(_loader.content!=null){ _loader.removeEventListener(Event.COMPLETE,showImg); _loader=null; _loader=getLoaderIntance(); } _loader.contentLoaderInfo.addEventListener(Event.COMPLETE,showImg) _loader.load(new URLRequest("http://images.sohu.com/uiue/sohu_logo/beijing2008/2008sohu.gif")); } static public function getLoaderIntance():Loader{ if(_loader==null){ _loader=new Loader(); return _loader; }else{ return _loader; } } private function showImg(event:Event):void{ var image:Bitmap=_loader.contentLoaderInfo.content as Bitmap; this.addChild(image); trace(System.totalMemory); } }
}
Copyright @ 2024 netlynx2000 Powered by .NET 9.0 on Kubernetes Powered by: .Text and ASP.NET Theme by: .NET Monster