[ActionScript 3.0] AS3中Loader无法彻底卸载

我测试发现,实例化的Loader无法彻底卸载,同行有没有办法,求赐教!

 1 import flash.display.Loader;
 2 import flash.net.URLRequest;
 3 import flash.events.Event;
 4 
 5 var ldr:Loader = new Loader();
 6 ldr.name = "ldr_0";
 7 ldr.load(new URLRequest("D:/svn/resources/src/KioskSystem/KioskSystem_Tianjin/assets/images/weather/weather_icon/b_nothing.png"));
 8 ldr.contentLoaderInfo.addEventListener(Event.COMPLETE,onLoaded);
 9 this.addChild(ldr);
10 function onLoaded(e:Event):void
11 {
12     ldr.unloadAndStop();
13     ldr.visible = false;
14     ldr = null;
15     trace(ldr,(e.target as LoaderInfo).loader,(e.target as LoaderInfo).loader.name);//null [object Loader] ldr_0
16     
17     var temp:Loader = (e.target as LoaderInfo).loader as Loader;
18     trace(temp.name,(e.target as LoaderInfo).loader.name);//ldr_0 ldr_0
19     temp.visible = false;
20     temp = null;
21     trace((e.target as LoaderInfo).loader,(e.target as LoaderInfo).loader.name,temp);//[object Loader] ldr_0 null
22 }

 

posted on 2015-12-03 10:36  晏过留痕  阅读(648)  评论(0编辑  收藏  举报