1#!/usr/bin/perl
2use strict;
3
4use SWF qw(:ALL);
5SWF::setScale(20.0);
6
7print "Content-type: application/x-shockwave-flash\n\n";
8
9my $s = new SWF::Shape();
10my $b = new SWF::Bitmap('../common/flowers.jpg');
11
12my $f = $s->addFill($b);
13$s->setRightFill($f);
14
15$s->drawLine(640, 0);
16$s->drawLine(0, 480);
17$s->drawLine(-640, 0);
18$s->drawLine(0, -480);
19
20my $m = new SWF::Movie();
21$m->setDimension(640, 480);
22$m->add($s);
23# decide if its called from commandline or as cgiscript
24if (exists $ENV{"REQUEST_URI"}){
25	print "Content-type: application/x-shockwave-flash\n\n";
26	$m->output();
27}
28else {
29	$m->save("$0.swf");
30	print "Generated file written to $0.swf\n";
31}
32