You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

120 lines
2.3 KiB

  1. <?php
  2. $LINEID=1;
  3. $LINEDEPTH=50;
  4. $LINESTEPS=30;
  5. $CIRCLEID=2;
  6. $CIRCLEDEPT=100;
  7. /* stop playing */
  8. function stop()
  9. {
  10. swf_startdoaction();
  11. swf_actionStop();
  12. swf_enddoaction();
  13. }
  14. /* play stoping */
  15. function play()
  16. {
  17. swf_startdoaction();
  18. swf_actionPlay();
  19. swf_enddoaction();
  20. }
  21. /*
  22. * demonstrates:
  23. * defining and placing an object.
  24. *
  25. */
  26. function flipline()
  27. {
  28. global $LINESTEPS, $LINEID, $LINEDEPTH;
  29. swf_ortho2(-100.0,100.0,-100.0,100.0);
  30. swf_defineline($LINEID,-60.0,0.0,60.0,0.0,1.2);
  31. swf_mulcolor(1.0,1.0,1.0,1.0);
  32. swf_addcolor(0.0,0.0,0.0,0.0);
  33. for($i=0; $i<$LINESTEPS; $i++) {
  34. $p = $i/($LINESTEPS-1.0);
  35. swf_pushmatrix();
  36. swf_rotate(60.0*$p,'z');
  37. swf_translate(20.0+20.0*$p,0.0,0.0);
  38. swf_rotate(120.0*$p,'z');
  39. swf_placeobject($LINEID, $LINEDEPTH);
  40. swf_popmatrix();
  41. swf_showframe();
  42. }
  43. for($i=0; $i<$LINESTEPS; $i++) {
  44. swf_removeobject($LINEDEPTH);
  45. if(($i%4) == 0)
  46. swf_showframe();
  47. }
  48. swf_showframe();
  49. }
  50. /* growblobs follows */
  51. $NBLOBS=8;
  52. $BLOBSTEPS=20;
  53. /*
  54. * demonstrates:
  55. * shape definition
  56. * placing, and modifying objects.
  57. *
  58. */
  59. function growblobs()
  60. {
  61. global $NBLOBS, $BLOBSTEPS, $CIRCLEDEPT, $CIRCLEID;
  62. swf_ortho2(-200.0,200.0,-200.0,200.0);
  63. swf_startshape($CIRCLEID);
  64. swf_shapefillsolid(0.0,0.0,0.0,1.0);
  65. swf_shapearc(0.0,0.0,300.0,0.0,360.0);
  66. swf_endshape();
  67. swf_mulcolor(1.0,1.0,1.0,1.0);
  68. $startframe = swf_getframe();
  69. for($j=0; $j<$NBLOBS; $j++) {
  70. swf_setframe($startframe+2*$j);
  71. for($i=0; $i<$BLOBSTEPS; $i++) {
  72. $p = $i/($BLOBSTEPS-1.0);
  73. swf_pushmatrix();
  74. swf_scale($p,$p,$p);
  75. swf_addcolor($p,$p,$p,0.0);
  76. if($i== 0)
  77. swf_placeobject($CIRCLEID,$CIRCLEDEPTH+$j);
  78. else
  79. swf_modifyobject($CIRCLEDEPTH+$j,MOD_COLOR|MOD_MATRIX);
  80. swf_popmatrix();
  81. swf_showframe();
  82. }
  83. swf_removeobject($CIRCLEDEPTH+$j);
  84. }
  85. swf_showframe();
  86. }
  87. swf_openfile("test.swf",400.0,400.0,20.0,1.0,1.0,1.0);
  88. flipline();
  89. growblobs();
  90. // trytext();
  91. // makebuttons();
  92. // stop();
  93. swf_showframe();
  94. swf_closefile();
  95. // swf_openfile("images.swf",400.0,400.0,20.0,1.0,1.0,1.0);
  96. // showimages();
  97. // brushstrokes();
  98. // symboltest();
  99. // stop();
  100. // swf_showframe();
  101. // swf_closefile();
  102. // fprintf(stderr,"wrote images.swf\n");
  103. exit(0);
  104. ?>