1#!/usr/bin/perl -w
2
3=head ButtonRecord Test
4
5This test references a shape 3 times in a button as ButtonRecord and set some properties
6for each ButtonRecord.
7You should see
81 triangle by viewing the SWF,
92 triangles when hovering over the first triangle, and
103 triangles when you press the triangle button.
11
12=cut
13
14use strict;
15use SWF (':ALL');
16use SWF::Constants qw(:Button);
17my $m = new SWF::Movie;
18
19my $s = new SWF::Shape;
20#$s->addSolidFill(255, 255, 0,255);
21$s->setLine(1, 255, 0, 0, 255);
22$s->setRightFill(255, 255, 0, 255);
23$s->drawLine(100, 0);
24$s->drawLine(0, 40);
25$s->drawLineTo(0, 0);
26
27my $b = new SWF::Button;
28my $br1 = $b->addCharacter($s,
29	SWF::Constants::SWFBUTTON_HIT|SWF::Constants::SWFBUTTON_UP|SWF::Constants::SWFBUTTON_OVER|SWF::Constants::SWFBUTTON_DOWN);
30
31my $br2 = $b->addCharacter($s,
32	SWF::Constants::SWFBUTTON_OVER|SWF::Constants::SWFBUTTON_DOWN);
33$br2->rotate(10);
34$br2->move(20,0);
35
36my $br3 = $b->addCharacter($s, SWF::Constants::SWFBUTTON_DOWN);
37$br3->rotate(20);
38$br3->move(40,0);
39
40my $d = $m->add($b);
41$d->moveTo(50, 100);
42
43$m->addExport($b, "ButtonExport");
44$m->writeExports();
45
46$m->nextFrame;
47$m->save("test02.swf");
48