DisplayObjectContainer to MovieClip

package gameTool
{
	import flash.display.DisplayObject;
	import flash.display.DisplayObjectContainer;
	import flash.display.MovieClip;


	public class DisplayToMovieClip extends MovieClip
	{
		public function DisplayToMovieClip(display:DisplayObjectContainer)
		{
			while(display.numChildren)
			{
				var mc:DisplayObject = display.removeChildAt((0))
				this.addChild(mc);
			}						
		}	
	}
}

 

你可能感兴趣的:(Flash)