shape.as

来自「在flash里模拟出真实火焰的效果,非常真实,非常漂亮.」· AS 代码 · 共 31 行

AS
31
字号
import flash.display.BitmapData;
class de.popforge.bitmap.Shape extends MovieClip
{
	static var id: String = '__Packages.de.popforge.bitmap.Shape';
	
	static private var container: MovieClip;
	
	static public function setContainer( container: MovieClip ): Void
	{
		Shape.container = container;
		Object.registerClass( id, Shape );
	}
	
	static public function get(): Shape
	{
		if( container == undefined )
		{
			trace( 'ERROR: No container is defined. Call Shape.setContainer( timeline: MovieClip );' );
			return null;
		}
		
		var d: Number = container.getNextHighestDepth();
		
		return Shape( container.attachMovie( id, d.toString(), d ) );
	}
	
	public function rasterize( target: BitmapData ): Void
	{
		target.draw( this );
	}
}

⌨️ 快捷键说明

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