PERL   16

less6-cgi

Guest on 3rd July 2022 04:58:17 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. my $gradient1 = new SWF::Gradient();
  12.  
  13. $gradient1->addEntry(0.0,255,255,255);
  14. $gradient1->addEntry(0.2,255,255,0);
  15. $gradient1->addEntry(0.4,255,0,0);
  16. $gradient1->addEntry(0.6,255,0,255);
  17. $gradient1->addEntry(0.8,0,0,255);
  18. $gradient1->addEntry(1.0,0,0,0);
  19.  
  20. my $shape1 = new SWF::Shape();
  21. $shape1->setLine(5,0,0,255);
  22. $shape1->drawLine(440,0);
  23.  
  24. my $shape2 = new SWF::Shape();
  25. $shape2->setLine(1,0,0,0);
  26.  
  27. my $fill1 = $shape2->addFill($gradient1, SWFFILL_LINEAR_GRADIENT);
  28. $fill1->scaleTo(0.04);
  29. $fill1->moveTo(30,0);
  30.  
  31. $shape2->setRightFill($fill1);
  32. $shape2->drawLine(50,0);
  33. $shape2->drawLine(0,50);
  34. $shape2->drawLine(-50,0);
  35. $shape2->drawLine(0,-50);
  36.  
  37. my $shape3 = new SWF::Shape();
  38. $shape3->setLine(1,0,0,0);
  39.  
  40. my $fill2 = $shape3->addFill($gradient1, SWFFILL_RADIAL_GRADIENT);
  41. $fill2->scaleTo(0.1);
  42. $fill2->moveTo(10,10);
  43.  
  44. $shape3->setRightFill($fill2);
  45. my $ra = 40;
  46. my $x = 40;
  47. my $y = 40;
  48. my $a = $ra * 0.414213562; # = tan(22.5 deg)
  49. my $b = $ra * 0.707106781; # = sqrt(2)/2 = sin(45 deg)
  50. $shape3->movePenTo($x+$ra, $y);
  51. $shape3->drawCurveTo($x+$ra, $y-$a, $x+$b, $y-$b);
  52. $shape3->drawCurveTo($x+$a, $y-$ra, $x, $y-$ra);
  53. $shape3->drawCurveTo($x-$a, $y-$ra, $x-$b, $y-$b);
  54. $shape3->drawCurveTo($x-$ra, $y-$a, $x-$ra, $y);
  55. $shape3->drawCurveTo($x-$ra, $y+$a, $x-$b, $y+$b);
  56. $shape3->drawCurveTo($x-$a, $y+$ra, $x, $y+$ra);
  57. $shape3->drawCurveTo($x+$a, $y+$ra, $x+$b, $y+$b);
  58. $shape3->drawCurveTo($x+$ra, $y+$a, $x+$ra, $y);
  59.  
  60. my $font = new SWF::Font("fonts/BankGothic%20Md%20BT.fdb");
  61. my $text = new SWF::Text();
  62. $text->setFont($font);
  63. $text->setColor(255,255,0);
  64. $text->setHeight(40);
  65. $text->addString("Skovran Rulez!!");
  66.  
  67.  
  68. my $movie=new SWF::Movie();
  69. $movie->setDimension(460,80);
  70. $movie->setBackground(255,0,0);
  71.  
  72. my $firstLine = $movie->add($shape1);
  73. $firstLine->moveTo(10,10);
  74.  
  75. my $secondLine = $movie->add($shape1);
  76. $secondLine->moveTo(10,70);
  77.  
  78. my $firstSquare = $movie->add($shape2);
  79. $firstSquare->moveTo(15,15);
  80.  
  81. my $secondSquare = $movie->add($shape2);
  82. $secondSquare->moveTo(395,15);
  83.  
  84. my $firstCircle = $movie->add($shape3);
  85. $firstCircle->moveTo(190,0);
  86.  
  87. my $firstText = $movie->add($text);
  88. $firstText->moveTo((460/2-($text->getWidth(" My First Flash!"))/2)+10,50);
  89.  
  90. $movie->output();

Raw Paste


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