Swf.pl
use SWF::Builder;
- We may use a dedicated child for serving SWF requests
sub swfd { }
- Compile a SWF interface for this peer
sub swfCompile {
# Read peer.as source script my $as = readFile( my $file = 'peer.as' ); my @stat = stat( $file ); my $output = logAdd "Compiling from \"$file\" ($stat[7] bytes)\n\n";
my $swf= SWF::Builder->new( FrameRate => 50, FrameSize => [0, 0, 640, 480], BackgroundColor => 'cccccc' );
# Red triangle my $shape = $swf->new_shape ->fillstyle('ffffff') ->linestyle(1, '000000') ->moveto(0,-11) ->lineto(10,6) ->lineto(-10,6) ->lineto(0,-11); my $instance = $shape->place;
for ( my $x = 0; $x < 400; $x++ ) { $instance->rotate(15)->moveto( $x, 200 ) }
$swf->save( $file = "$::peer.swf" ); @stat = stat( $file ); $output .= logAdd "SWF Instance compiled: $file ($stat[7] bytes)\n"; return $output; }



