as3 垃圾回收

1. 试用弱侦:addEventListener("事件",function ,false,0,true);
2. loader.unload(); -----------    (loader.content as Bitmap).BitmapData.dispose();
3. 所有变量用完设为null
4.调用类,强制回收.
package {
import flash.net.LocalConnection;
public class MyGC
{
   public static function GC ()
   {
    try
    {
     var lc1:LocalConnection = new LocalConnection();
     var lc2:LocalConnection = new LocalConnection();
     lc1.connect ('name');
     lc2.connect ('name2');
    }
    catch (e:Error)
    {
    }
   }
}
}

你可能感兴趣的:(.net,Flash)