codice:
<?php
function drawForm($plane)
{
swf_pushmatrix();
swf_placeobject(1, $plane);
swf_placeobject(2, $plane+1);
swf_pushmatrix();
swf_addcolor(0, 102/255, 204/255, 0);
swf_placeobject(3, $plane+2);
swf_translate(30, 30, 0);
swf_addcolor(1, 1, 1, 0);
swf_placeobject(2, $plane+3);
swf_popmatrix();
swf_showframe();
swf_popmatrix();
return 4;
}
function removeForm($plane)
{
swf_removeobject($plane);
swf_removeobject($plane+1);
swf_removeobject($plane+2);
swf_removeobject($plane+3);
}
$fileName = "swf_symbol.swf";
$shape = 100;
$symbol = 200;
$line = 10;
$rect1 = 20;
$rect2 = 30;
swf_openfile($fileName, 400, 400, 30, 0, 0, 0);
swf_ortho2(-200, 200, -200, 200);
swf_defineline($line, -10, -10, 10, 10, 3);
swf_definerect($rect1, -20, -20, -10, -10, 3); // larghezza 3
swf_definerect($rect2, 20, 20, 10, 10, 0); // pieno
swf_startsymbol($shape);
swf_pushmatrix();
swf_addcolor(1, 1, 1, 0);
swf_placeobject($line, $symbol);
swf_placeobject($rect1, $symbol);
swf_pushmatrix();
swf_addcolor(0, 102/255, 204/255, 0);
swf_placeobject($rect2, $symbol+1);
swf_translate(30, 30, 0);
swf_addcolor(1, 1, 1, 0);
swf_placeobject($rect1, $symbol+2);
swf_popmatrix();
swf_popmatrix();
swf_showframe();
swf_endsymbol();
swf_startsymbol($symbol);
for ($i = 0; $i < 360; $i+=360/36)
{
swf_pushmatrix();
swf_mulcolor(1.0, 1.0, 1.0, 0.0);
swf_addcolor(0.0, 0.0, 0.0, 1.0);
swf_rotate($i, 'z');
swf_scale($i/90, $i/90, 1);
swf_placeobject($shape, $i+1000);
swf_showframe();
swf_removeobject($i+1000);
swf_popmatrix();
}
swf_endsymbol();
$n = 36;
for ($i = 1; $i <= $n; $i++)
{
swf_pushmatrix();
swf_translate(cos((2*pi()/$n)*$i)*100, sin((2*pi()/$n)*$i)*100, 0);
swf_placeobject($symbol, 1000);
swf_showframe();
swf_popmatrix();
}
swf_startdoaction();
swf_actionstop();
swf_enddoaction();
swf_showframe();
swf_closefile();
echo "<EMBED src='$fileName' quality=high
pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash'
type='application/x-shockwave-flash'
width='800' height='600'></EMBED>";
?>
vedete di capire come funge.