码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2015-12-03 11:40:21      阅读:162      评论:0      收藏:0      [点我收藏+]

标签:

我测试发现,实例化的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 }

 

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

标签:

原文地址:http://www.cnblogs.com/frost-yen/p/5015342.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!