PERL   18

less6 new cgi

Guest on 3rd July 2022 04:59:04 PM

  1. #!/usr/bin/perl
  2. use strict;
  3.  
  4. use SWF qw(:ALL);
  5. use SWF::Constants qw(:Fill);
  6.  
  7. #SWF::setScale(1.0);
  8. #SWF::setScale(20.0);
  9. print "Content-type: application/x-shockwave-flash\n\n";
  10.  
  11.  
  12. my $gradient1 = new SWF::Gradient();
  13.  
  14. $gradient1->addEntry(0.0,255,255,255);
  15. $gradient1->addEntry(0.2,255,255,0);
  16. $gradient1->addEntry(0.4,255,0,0);
  17. $gradient1->addEntry(0.6,255,0,255);
  18. $gradient1->addEntry(0.8,0,0,255);
  19. $gradient1->addEntry(1.0,0,0,0);
  20.  
  21. my $shape1 = new SWF::Shape();
  22. $shape1->setLine(5,0,0,255);
  23. $shape1->drawLine(440,0);
  24.  
  25. my $shape2 = new SWF::Shape();
  26. $shape2->setLine(1,0,0,0);
  27.  
  28. my $fill1 = $shape2->addFill($gradient1, SWFFILL_LINEAR_GRADIENT);
  29. $fill1->scaleTo(0.04);
  30. $fill1->moveTo(30,0);
  31.  
  32. $shape2->setRightFill($fill1);
  33. $shape2->drawLine(50,0);
  34. $shape2->drawLine(0,50);
  35. $shape2->drawLine(-50,0);
  36. $shape2->drawLine(0,-50);
  37.  
  38. my $shape3 = new SWF::Shape();
  39. $shape3->setLine(1,0,0,0);
  40.  
  41. my $fill2 = $shape3->addFill($gradient1, SWFFILL_RADIAL_GRADIENT);
  42. $fill2->scaleTo(0.1);
  43. $fill2->moveTo(10,10);
  44.  
  45. $shape3->setRightFill($fill2);
  46. my $ra = 20;
  47. my $x = 0;
  48. my $y = 0;
  49. my $a = $ra * 0.414213562; # = tan(22.5 deg)
  50. my $b = $ra * 0.707106781; # = sqrt(2)/2 = sin(45 deg)
  51. $shape3->movePenTo($x+$ra, $y);
  52. $shape3->drawCurveTo($x+$ra, $y-$a,  $x+$b,  $y-$b);
  53. $shape3->drawCurveTo($x+$a,  $y-$ra, $x,     $y-$ra);
  54. $shape3->drawCurveTo($x-$a,  $y-$ra, $x-$b,  $y-$b);
  55. $shape3->drawCurveTo($x-$ra, $y-$a,  $x-$ra, $y);
  56. $shape3->drawCurveTo($x-$ra, $y+$a,  $x-$b,  $y+$b);
  57. $shape3->drawCurveTo($x-$a,  $y+$ra, $x,     $y+$ra);
  58. $shape3->drawCurveTo($x+$a,  $y+$ra, $x+$b,  $y+$b);
  59. $shape3->drawCurveTo($x+$ra, $y+$a,  $x+$ra, $y);
  60.  
  61. my $p = new SWF::MovieClip();
  62. my $i = $p->add($shape3);
  63. $i->setDepth(1);
  64. $p->nextFrame();
  65. for(my $n=0; $n<(360/5); ++$n) {
  66.   $i->rotate(-5*$n);
  67.   $i->moveTo($n,sin(3.14*$n));
  68.   $p->nextFrame();
  69. }
  70.  
  71. my $p2 = new SWF::MovieClip();
  72. my $i2 = $p2->add($shape3);
  73. $i2->setDepth(1);
  74. $p2->nextFrame();
  75. for(my $n=0; $n<(720/10); ++$n) {
  76.   $i2->rotate(-10);
  77.   $i2->moveTo($n*$n/10,$n);
  78.   $p2->nextFrame();
  79. }
  80.  
  81. my $movie=new SWF::Movie();
  82. $movie->setDimension(460,80);
  83. $movie->setBackground(255,0,0);
  84.  
  85. my $j = $movie->add($p);
  86. $j->setDepth(1);
  87. $j->moveTo(190,0);
  88. $j->setName('circle');
  89. my $j2 = $movie->add($p2);
  90. $j2->setDepth(1);
  91. $j2->moveTo(190,0);
  92.  
  93. my $firstSquare = $movie->add($shape2);
  94. $firstSquare->moveTo(15,15);
  95.  
  96. my $secondSquare = $movie->add($shape2);
  97. $secondSquare->moveTo(395,15);
  98.  
  99. #my $firstCircle = $movie->add($shape3);
  100. #$firstCircle->moveTo(190,0);
  101.  
  102. #my $firstText = $movie->add($text);
  103. #$firstText->moveTo((460/2-($text->getWidth(" My First Flash!"))/2)+10,50);
  104.  
  105. $movie->add( new SWF::Action("gotoFrame(1); play();"));
  106. $movie->nextFrame();
  107.  
  108. $movie->output();

Raw Paste


Login or Register to edit or fork this paste. It's free.