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

use SWF qw(:ALL);

SWF::setScale(1.0);

my $p = new SWF::Morph();

my $s1 = $p->getShape1();
$s1->setLine(0,0,0,0);
$s1->setLeftFill($s1->addFill(0xff, 0, 0));
$s1->movePenTo(-1000,-1000);
$s1->drawLine(2000,0);
$s1->drawLine(0,2000);
$s1->drawLine(-2000,0);
$s1->drawLine(0,-2000);

my $s2 = $p->getShape2();
$s2->setLine(60,0,0,0);
$s2->setLeftFill($s2->addFill(0, 0, 0xff));
$s2->movePenTo(0,-1000);
$s2->drawLine(1000,1000);
$s2->drawLine(-1000,1000);
$s2->drawLine(-1000,-1000);
$s2->drawLine(1000,-1000);

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

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

for(my $r=0; $r<=10; ++$r)
{
  $i->setRatio($r/10);
  $m->nextFrame();
}

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