#!/usr/bin/perl use strict; use SWF qw(:ALL); use SWF::Constants qw(:Fill); #SWF::setScale(1.0); #SWF::setScale(20.0); print "Content-type: application/x-shockwave-flash\n\n"; my $gradient1 = new SWF::Gradient(); $gradient1->addEntry(0.0,255,255,255); $gradient1->addEntry(0.2,255,255,0); $gradient1->addEntry(0.4,255,0,0); $gradient1->addEntry(0.6,255,0,255); $gradient1->addEntry(0.8,0,0,255); $gradient1->addEntry(1.0,0,0,0); my $shape1 = new SWF::Shape(); $shape1->setLine(5,0,0,255); $shape1->drawLine(440,0); my $shape2 = new SWF::Shape(); $shape2->setLine(1,0,0,0); my $fill1 = $shape2->addFill($gradient1, SWFFILL_LINEAR_GRADIENT); $fill1->scaleTo(0.04); $fill1->moveTo(30,0); $shape2->setRightFill($fill1); $shape2->drawLine(50,0); $shape2->drawLine(0,50); $shape2->drawLine(-50,0); $shape2->drawLine(0,-50); my $shape3 = new SWF::Shape(); $shape3->setLine(1,0,0,0); my $fill2 = $shape3->addFill($gradient1, SWFFILL_RADIAL_GRADIENT); $fill2->scaleTo(0.1); $fill2->moveTo(10,10); $shape3->setRightFill($fill2); my $ra = 20; my $x = 0; my $y = 0; my $a = $ra * 0.414213562; # = tan(22.5 deg) my $b = $ra * 0.707106781; # = sqrt(2)/2 = sin(45 deg) $shape3->movePenTo($x+$ra, $y); $shape3->drawCurveTo($x+$ra, $y-$a, $x+$b, $y-$b); $shape3->drawCurveTo($x+$a, $y-$ra, $x, $y-$ra); $shape3->drawCurveTo($x-$a, $y-$ra, $x-$b, $y-$b); $shape3->drawCurveTo($x-$ra, $y-$a, $x-$ra, $y); $shape3->drawCurveTo($x-$ra, $y+$a, $x-$b, $y+$b); $shape3->drawCurveTo($x-$a, $y+$ra, $x, $y+$ra); $shape3->drawCurveTo($x+$a, $y+$ra, $x+$b, $y+$b); $shape3->drawCurveTo($x+$ra, $y+$a, $x+$ra, $y); my $p = new SWF::MovieClip(); my $i = $p->add($shape3); $i->setDepth(1); $p->nextFrame(); for(my $n=0; $n<(360/5); ++$n) { $i->rotate(-5*$n); $i->moveTo($n,sin(3.14*$n)); $p->nextFrame(); } my $p2 = new SWF::MovieClip(); my $i2 = $p2->add($shape3); $i2->setDepth(1); $p2->nextFrame(); for(my $n=0; $n<(720/10); ++$n) { $i2->rotate(-10); $i2->moveTo($n*$n/10,$n); $p2->nextFrame(); } my $movie=new SWF::Movie(); $movie->setDimension(460,80); $movie->setBackground(255,0,0); my $j = $movie->add($p); $j->setDepth(1); $j->moveTo(190,0); $j->setName('circle'); my $j2 = $movie->add($p2); $j2->setDepth(1); $j2->moveTo(190,0); my $firstSquare = $movie->add($shape2); $firstSquare->moveTo(15,15); my $secondSquare = $movie->add($shape2); $secondSquare->moveTo(395,15); #my $firstCircle = $movie->add($shape3); #$firstCircle->moveTo(190,0); #my $firstText = $movie->add($text); #$firstText->moveTo((460/2-($text->getWidth(" My First Flash!"))/2)+10,50); $movie->add( new SWF::Action("gotoFrame(1); play();")); $movie->nextFrame(); $movie->output();