diff options
author | Uwe Steinmann <steinm@php.net> | 2000-05-17 15:45:56 +0000 |
---|---|---|
committer | Uwe Steinmann <steinm@php.net> | 2000-05-17 15:45:56 +0000 |
commit | 7bde3adbd4d5c6b863b3d1c03389ba0f7aab944a (patch) | |
tree | 33355b571c8d71e754d9c603ffc2e7f4cac575d5 /tests | |
parent | efb51322c171b2cc21c5b5cb79b07cb698e0d1ff (diff) | |
download | php-git-7bde3adbd4d5c6b863b3d1c03389ba0f7aab944a.tar.gz |
- test script to test creation of flash files
Diffstat (limited to 'tests')
-rw-r--r-- | tests/testswf | 120 |
1 files changed, 120 insertions, 0 deletions
diff --git a/tests/testswf b/tests/testswf new file mode 100644 index 0000000000..e26733237d --- /dev/null +++ b/tests/testswf @@ -0,0 +1,120 @@ +<?php + +$LINEID=1; +$LINEDEPTH=50; +$LINESTEPS=30; + +$CIRCLEID=2; +$CIRCLEDEPT=100; + +/* stop playing */ +function stop() +{ + swf_startdoaction(); + swf_actionStop(); + swf_enddoaction(); +} + +/* play stoping */ +function play() +{ + swf_startdoaction(); + swf_actionPlay(); + swf_enddoaction(); +} + +/* + * demonstrates: + * defining and placing an object. + * + */ +function flipline() +{ + global $LINESTEPS, $LINEID, $LINEDEPTH; + + swf_ortho2(-100.0,100.0,-100.0,100.0); + swf_defineline($LINEID,-60.0,0.0,60.0,0.0,1.2); + swf_mulcolor(1.0,1.0,1.0,1.0); + swf_addcolor(0.0,0.0,0.0,0.0); + for($i=0; $i<$LINESTEPS; $i++) { + $p = $i/($LINESTEPS-1.0); + swf_pushmatrix(); + swf_rotate(60.0*$p,'z'); + swf_translate(20.0+20.0*$p,0.0,0.0); + swf_rotate(120.0*$p,'z'); + swf_placeobject($LINEID, $LINEDEPTH); + swf_popmatrix(); + swf_showframe(); + } + for($i=0; $i<$LINESTEPS; $i++) { + swf_removeobject($LINEDEPTH); + if(($i%4) == 0) + swf_showframe(); + } + swf_showframe(); +} + +/* growblobs follows */ + +$NBLOBS=8; +$BLOBSTEPS=20; + +/* + * demonstrates: + * shape definition + * placing, and modifying objects. + * + */ +function growblobs() +{ + global $NBLOBS, $BLOBSTEPS, $CIRCLEDEPT, $CIRCLEID; + + swf_ortho2(-200.0,200.0,-200.0,200.0); + + swf_startshape($CIRCLEID); + swf_shapefillsolid(0.0,0.0,0.0,1.0); + swf_shapearc(0.0,0.0,300.0,0.0,360.0); + swf_endshape(); + + swf_mulcolor(1.0,1.0,1.0,1.0); + $startframe = swf_getframe(); + for($j=0; $j<$NBLOBS; $j++) { + swf_setframe($startframe+2*$j); + for($i=0; $i<$BLOBSTEPS; $i++) { + $p = $i/($BLOBSTEPS-1.0); + swf_pushmatrix(); + swf_scale($p,$p,$p); + swf_addcolor($p,$p,$p,0.0); + if($i== 0) + swf_placeobject($CIRCLEID,$CIRCLEDEPTH+$j); + else + swf_modifyobject($CIRCLEDEPTH+$j,MOD_COLOR|MOD_MATRIX); + swf_popmatrix(); + swf_showframe(); + } + swf_removeobject($CIRCLEDEPTH+$j); + } + swf_showframe(); +} + +swf_openfile("test.swf",400.0,400.0,20.0,1.0,1.0,1.0); +flipline(); +growblobs(); + +// trytext(); +// makebuttons(); +// stop(); +swf_showframe(); +swf_closefile(); + +// swf_openfile("images.swf",400.0,400.0,20.0,1.0,1.0,1.0); +// showimages(); +// brushstrokes(); +// symboltest(); +// stop(); +// swf_showframe(); +// swf_closefile(); +// fprintf(stderr,"wrote images.swf\n"); + exit(0); + +?> |