displayobjectutilities.as

来自「actionscript3 cookbook 源代码S3CBLibrary」· AS 代码 · 共 21 行

AS
21
字号
package ascb.util {
	
	import flash.display.*;

	public class DisplayObjectUtilities {
		
		// Remove all of the children in a container
		public static function removeAllChildren( container:DisplayObjectContainer ):void {
			  
			// Because the numChildren value changes after every time we remove
			// a child, save the original value so we can count correctly
			var count:int = container.numChildren;
			
			// Loop over the children in the container and remove them
			for ( var i:int = 0; i < count; i++ ) {
				container.removeChildAt( 0 );
			}
		}
		
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?