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

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

SWF::setScale(1.0);

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

my $b = new SWF::Button();
$b->addShape($s, SWFBUTTON_HIT | SWFBUTTON_UP | SWFBUTTON_DOWN | SWFBUTTON_OVER);

$b->addAction( new SWF::Action("startDrag('/test', 0);"), # '0' means don't lock to mouse
               SWFBUTTON_MOUSEDOWN);

$b->addAction( new SWF::Action("stopDrag();"),
               SWFBUTTON_MOUSEUP);

my $p = new SWF::Sprite();
$p->add($b);
$p->nextFrame();

my $m = new SWF::Movie();
my $i = $m->add($p);
$i->setName('test');
$i->moveTo(1000,1000);

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

