Sophie

Sophie

distrib > Mageia > 7 > i586 > media > core-updates > by-pkgid > 5f79254211c0b7a0a116da84a157bdae > files > 47

perl-SWF-0.4.9-0.git20181112.2.1.mga7.i586.rpm

#!/usr/bin/perl
use strict;

use SWF qw(:ALL);
SWF::setScale(20.0);

print "Content-type: application/x-shockwave-flash\n\n";

my $s = new SWF::Shape();
my $b = new SWF::Bitmap('../common/flowers.jpg');

my $f = $s->addFill($b);
$s->setRightFill($f);

$s->drawLine(640, 0);
$s->drawLine(0, 480);
$s->drawLine(-640, 0);
$s->drawLine(0, -480);

my $m = new SWF::Movie();
$m->setDimension(640, 480);
$m->add($s);
# decide if its called from commandline or as cgiscript
if (exists $ENV{"REQUEST_URI"}){
	print "Content-type: application/x-shockwave-flash\n\n";
	$m->output();
}
else {
	$m->save("$0.swf");
	print "Generated file written to $0.swf\n";
}