関数クロージャ使えばprivateなメンバが消えてなくなるよ!
説明
http://d.hatena.ne.jp/coppieee/20090805/1249491863
/**
* Copyright coppieee ( http://wonderfl.net/user/coppieee )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/mb6M
*/
//説明
//http://d.hatena.ne.jp/coppieee/20090805/1249491863
package
{
import flash.display.Sprite;
import flash.events.Event;
import flash.text.TextField;
public class Main extends Sprite
{
public function Main()
{
var tf:TextField = new TextField();
addChild(tf);
var count:int = 60;
addEventListener(Event.ENTER_FRAME, function(e:Event):void {
tf.text = "count" + count--;
if (count < 0)
{
removeEventListener(Event.ENTER_FRAME, arguments.callee);
}
});
}
}
}