public void Write( Stream output )
{
BitStream bits = new BitStream( output );
bits.WriteBits( 1, ( ClipEventKeyUp ? 1 : 0 ) );
bits.WriteBits( 1, ( ClipEventKeyDown ? 1 : 0 ) );
bits.WriteBits( 1, ( ClipEventMouseUp ? 1 : 0 ) );
bits.WriteBits( 1, ( ClipEventMouseDown ? 1 : 0 ) );
bits.WriteBits( 1, ( ClipEventMouseMove ? 1 : 0 ) );
bits.WriteBits( 1, ( ClipEventUnload ? 1 : 0 ) );
bits.WriteBits( 1, ( ClipEventEnterFrame ? 1 : 0 ) );
bits.WriteBits( 1, ( ClipEventLoad ? 1 : 0 ) );
if ( this.Version >= 6 )
{
// Swf6 and following
bits.WriteBits( 1, ( ClipEventDragOver ? 1 : 0 ) );
bits.WriteBits( 1, ( ClipEventRollOut ? 1 : 0 ) );
bits.WriteBits( 1, ( ClipEventRollOver ? 1 : 0 ) );
bits.WriteBits( 1, ( ClipEventReleaseOutside ? 1 : 0 ) );
bits.WriteBits( 1, ( ClipEventRelease ? 1 : 0 ) );
bits.WriteBits( 1, ( ClipEventPress ? 1 : 0 ) );
bits.WriteBits( 1, ( ClipEventInitialize ? 1 : 0 ) );
bits.WriteBits( 1, ( ClipEventData ? 1 : 0 ) );
bits.WriteBits( 5, 0 ); // reserved
// Swf6, used in Swf7
if ( this.Version >= 7 )
bits.WriteBits( 1, ( ClipEventConstruct ? 1 : 0 ) );
else
bits.WriteBits( 1, 0 );
bits.WriteBits( 1, ( ClipEventKeyPress ? 1 : 0 ) );
bits.WriteBits( 1, ( ClipEventDragOut ? 1 : 0 ) );
}
bits.WriteBits( 8, 0 ); // reserved
bits.WriteFlush();
}