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 ); } }