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

use SWF qw(:ALL);
use SWF::Constants qw(:Fill);

SWF::setScale(1.0);

my $m = new SWF::Movie();
$m->setDimension(320, 240);

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

# first gradient- black to white
my $g = new SWF::Gradient();
$g->addEntry(0.0, 0, 0, 0);
$g->addEntry(1.0, 0xff, 0xff, 0xff);

my $f = $s->addFill($g, SWFFILL_LINEAR_GRADIENT);
$f->scaleTo(0.01);
$f->moveTo(160, 120);
$s->setRightFill($f);
$s->drawLine(320, 0);
$s->drawLine(0, 240);
$s->drawLine(-320, 0);
$s->drawLine(0, -240);

$m->add($s);

$s = new SWF::Shape();

# second gradient- radial gradient from white to red to transparent
$g = new SWF::Gradient();
$g->addEntry(0.0, 0xff, 0, 0, 0xff);
$g->addEntry(1.0, 0xff, 0, 0, 0);

$f = $s->addFill($g, SWFFILL_RADIAL_GRADIENT);
$f->scaleTo(0.005);
$f->moveTo(160, 120);
$s->setRightFill($f);
$s->drawLine(320, 0);
$s->drawLine(0, 240);
$s->drawLine(-320, 0);
$s->drawLine(0, -240);

$m->add($s);

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

