1#!/usr/bin/perl -w
2use strict;
3
4#use lib("/home/peter/ming3/lib/perl5/site_perl");
5
6$|=1;
7use SWF qw(Movie Font TextField);
8use SWF::Constants qw(SWFTEXTFIELD_DRAWBOX);
9# Add path to your *.fdb file
10my $filename = '../common/_sans.fdb';
11
12my $f= new SWF::Font($filename);
13
14my $tf= new SWF::TextField(SWFTEXTFIELD_DRAWBOX);
15$tf->setFont($f);
16$tf->setColor(0xff, 0x0, 0);
17$tf->setHeight(20);
18$tf->addString("ming!");
19
20my $m = new SWF::Movie();
21$m->setDimension(300, 200);
22$m->setBackground(0xff, 0xff, 0x0);
23
24my $tfi=$m->add($tf);
25$tfi->moveTo(100,100);
26$m->nextFrame;
27
28# decide if its called from commandline or as cgiscript
29if (exists $ENV{"REQUEST_URI"}){
30	print "Content-type: application/x-shockwave-flash\n\n";
31	$m->output();
32}
33else {
34	$m->save("$0.swf");
35	print "Generated file written to $0.swf\n";
36}
37
38
39