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

use SWF qw(:ALL);

SWF::setScale(1.0);

my $b = new SWF::Bitmap("../common/backyard.jpg");
my $s = new SWF::Shape();
$s->setRightFill($s->addFill($b));
$s->drawLine($b->getWidth(), 0);
$s->drawLine(0, $b->getHeight());
$s->drawLine(-$b->getWidth(), 0);
$s->drawLine(0, -$b->getHeight());

my $m = new SWF::Movie();
$m->setDimension($b->getWidth(), $b->getHeight());

my $i = $m->add($s);

for(my $n=0; $n<20; ++$n)
{
  $i->multColor(1.0-$n/10, 1.0, 1.0);
  $i->addColor(0xff*$n/20, 0, 0);
  $m->nextFrame();
}
for(my $n=20; $n>0; --$n)
{
  $i->multColor(1.0-$n/10, 1.0, 1.0);
  $i->addColor(0xff*$n/20, 0, 0);
  $m->nextFrame();
}

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