What's wrong with ADDED_TO_STAGE?

by nki2
What's wrong with ADDED_TO_STAGE?
I'm expexcting to get this:
lvl1 added to stage
lvl2 added to stage
lvl3 added to stage
but I don't...
ADDED_TO_STAGE gets fired several time without trigerring REMOVED_FROM_STAGE...
Am I missing something?
気になる
♥0 | Line 36 | Modified 2009-11-19 21:48:38 | MIT License
play

ActionScript3 source code

/**
 * Copyright nki2 ( http://wonderfl.net/user/nki2 )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/4JJM
 */

/*
 What's wrong with ADDED_TO_STAGE?
 I'm expexcting to get this:
  lvl1 added to stage
  lvl2 added to stage
  lvl3 added to stage
 but I don't...
 ADDED_TO_STAGE gets fired several time without trigerring REMOVED_FROM_STAGE...
 Am I missing something?
 気になる
*/

package {
	
	import flash.display.Sprite;
	import flash.text.TextField;
	import flash.text.TextFormat;
	
	
	[SWF(backgroundColor="0xf0f5e0", frameRate="30", width="465", height="465")]
	public class Index extends Sprite {
		
		public static var txt:TextField;
		
		//----------------------------------------------------------------------------------------------------
		/// init
		public function Index() {
			txt = addChild(new TextField()) as TextField;
			txt.defaultTextFormat = new TextFormat(null, 26);
			txt.width = 465;
			txt.height = 465;
			//
			var lvl3:MySprite = new MySprite("lvl3");
			var lvl2:MySprite = new MySprite("lvl2", lvl3);
			var lvl1:MySprite = new MySprite("lvl1", lvl2);
			addChild(lvl1);
			log("\n\n    ?");
		}
		
		public static function log(str:String):void {
			txt.appendText(str + "\n");
		}
	}
}


import flash.display.Sprite;
import flash.events.Event;

internal class MySprite extends Sprite {
	
	public function MySprite(name:String, futureChild:Sprite = null) {
		addEventListener(Event.ADDED_TO_STAGE, function(e:Event):void {
			Index.log(name + " added to stage");
			if(futureChild) addChild(futureChild);
		});
		addEventListener(Event.REMOVED_FROM_STAGE, function(e:Event):void {
			Index.log(name + " removed from stage");
		});
	}
}

Forked