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

use SWF qw(:ALL);

SWF::setScale(1.0);

my $s = new SWF::Shape();
my $f = $s->addFill(0xff, 0, 0);
$s->setRightFill($f);

$s->movePenTo(-500,-500);
$s->drawLineTo(500,-500);
$s->drawLineTo(500,500);
$s->drawLineTo(-500,500);
$s->drawLineTo(-500,-500);

my $p = new SWF::Sprite();
my $i = $p->add($s);
$i->setDepth(1);
$p->nextFrame();

for(my $n=0; $n<5; ++$n)
{
  $i->rotate(-15);
  $p->nextFrame();
}

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

my $pi = $m->add($p);
$pi->setDepth(1);
$pi->moveTo(-500,2000);
$pi->setName('box');

$m->add(new SWF::Action('x=-100;'));
$m->nextFrame();
$m->add(new SWF::Action('x+=3; box._x=x;'));
$m->nextFrame();
$m->add(new SWF::Action('gotoFrame(1); play();'));
$m->nextFrame();

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

