1#!/usr/bin/perl -w
2# Generated by swftoperl converter included with ming. Have fun.
3
4# Change this to your needs. If you installed perl-ming global you don't need this.
5#use lib("/home/peter/mystuff/lib/site_perl");
6
7# We import all because our converter is not so clever to select only needed. ;-)
8use SWF qw(:ALL);
9# Just copy from a sample, needed to use Constants like SWFFILL_RADIAL_GRADIENT
10use SWF::Constants qw(:Text :Button :DisplayItem :Fill);
11
12die "Usage: ".$0." <sourcedir>\n" unless @ARGV;
13$mediadir="$ARGV[0]/../Media";
14
15$m = SWF::Movie::newSWFMovieWithVersion(8);
16
17SWF::setScale(1.0);
18#Unknown block type 69
19
20# SWF_DEFINEBITSJPEG2
21
22# Bitmap 1 (jpeg2). To extract:
23
24# swfextract -j 1 -o character1.jpg $swf
25$character1 = new SWF::Bitmap($mediadir.'/image01.jpeg');
26
27# SWF_DEFINESHAPE3
28
29# Shape 2 (TYPE=3, RECT=-10,2010 -10,2010)
30$character2 = new SWF::Shape();
31#1 fillstyle(s)
32# BitmapID: 1
33$character2_f0 = $character2->addBitmapFill($character1,SWFFILL_TILED_BITMAP);
34$character2_f0->scaleTo(20.000000);
35#1 linestyles(s)
36$character2_l0_width = 20;
37$character2_l0_red   = 0x00;
38$character2_l0_green = 0x00;
39$character2_l0_blue  = 0x00;
40$character2_l0_alpha = 0xff;
41# StateLineStyle: 1
42$character2->setLine($character2_l0_width, $character2_l0_red, $character2_l0_green, $character2_l0_blue, $character2_l0_alpha);
43$character2->setRightFill($character2_f0);
44$character2->drawLine(2000, 0);
45$character2->drawLine(0, 2000);
46$character2->drawLine(-2000, 0);
47$character2->drawLine(0, -2000);
48
49# SWF_PLACEOBJECT2
50$i1 = $m->add($character2);
51$i1->setDepth(1);
52# PlaceFlagHasMatrix
53
54# SWF_SHOWFRAME
55$m->nextFrame(); # end of frame 1
56
57# SWF_END
58
59$m->save("test02.swf");
60