#!/usr/bin/perl -w
use strict;

use SWF qw(:ALL);

SWF::setScale(1.0);

sub makeRect {
  my ($r, $g, $b) = @_;

  my $s = new SWF::Shape();

  $s->setRightFill($s->addFill($r, $g, $b));
  $s->movePenTo(-500,-500);
  $s->drawLineTo(500,-500);
  $s->drawLineTo(500,500);
  $s->drawLineTo(-500,500);
  $s->drawLineTo(-500,-500);
  return $s;
}

my $b = new SWF::Button();
$b->setUp(makeRect(0xff, 0, 0));
$b->setOver(makeRect(0, 0xff, 0));
$b->setDown(makeRect(0, 0, 0xff));
$b->setHit(makeRect(0, 0, 0));

my $m = new SWF::Movie();
$m->setDimension(2000,2000);
$m->setBackground(0xff, 0xff, 0xff);

my $i = $m->add($b);
$i->moveTo(1000,1000);

$m->save("test.swf");
