Difference between revisions of "Swf.pl"

From Organic Design wiki
 
(update for peer)
Line 1: Line 1:
my $movie = SWF::Builder->new(FrameRate => 15, FrameSize => [0, 0, 400, 400], BackgroundColor => 'ffffff');
+
use SWF::Builder;
my $shape = $movie->new_shape   # red triangle.
+
 
 +
my $swf= SWF::Builder->new(
 +
FrameRate => 15,
 +
FrameSize => [0, 0, 400, 400],
 +
BackgroundColor => 'ffffff'
 +
);
 +
 
 +
# Red triangle
 +
my $shape = $swf->new_shape
 
->fillstyle('ff0000')
 
->fillstyle('ff0000')
 
->linestyle(1, '000000')
 
->linestyle(1, '000000')
Line 8: Line 16:
 
->lineto(0,-11);
 
->lineto(0,-11);
 
my $instance = $shape->place;
 
my $instance = $shape->place;
for (my $x = 0; $x < 400; $x++) {$instance->rotate(15)->moveto($x,200)}
+
for ( my $x = 0; $x < 400; $x++ ) { $instance->rotate(15)->moveto( $x, 200 ) }
$movie->save('triangle.swf');
+
$swf->save( "$::peer.swf" );

Revision as of 11:29, 14 February 2006

use SWF::Builder;

my $swf= SWF::Builder->new( FrameRate => 15, FrameSize => [0, 0, 400, 400], BackgroundColor => 'ffffff' );

  1. Red triangle

my $shape = $swf->new_shape ->fillstyle('ff0000') ->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( "$::peer.swf" );