//circles.php setline($linesize, $r, $g, $b); $a = $radius * 0.414213562; //tan(22.5deg) $b = $radius * 0.707106781; //sqrt(2)/2 = sin(45deg) $circle->movePenTo($xstart+$radius, $ystart); $circle->drawCurveTo($xstart+$radius, $ystart-$a, $xstart+$b, $ystart-$b); $circle->drawCurveTo($xstart+$a, $ystart-$radius, $xstart, $ystart-$radius); $circle->drawCurveTo($xstart-$a, $ystart-$radius, $xstart-$b, $ystart-$b); $circle->drawCurveTo($xstart-$radius, $ystart-$a, $xstart-$radius, $ystart); $circle->drawCurveTo($xstart-$radius, $ystart+$a, $xstart-$b, $ystart+$b); $circle->drawCurveTo($xstart-$a, $ystart+$radius, $xstart, $ystart+$radius); $circle->drawCurveTo($xstart+$a, $ystart+$radius, $xstart+$b, $ystart+$b); $circle->drawCurveTo($xstart+$radius, $ystart+$a, $xstart+$radius, $ystart); return $circle; } //example //$circle = drawCircle($rad+($i*2), 100, 100-($rad+$i*2), .5, 255, 255, 255); ////////////////////////////////////////////////////////////////////////////////////////// function displayHTMLpre($title, $stylesheet){ echo " ".$title." \n"; } function displayHTMLpost(){ echo "\n"; } ////////////////////////////////////////////////////////////////////////////////////////// ming_useswfversion(5); $movie= new SWFMovie(); $movie->setRate(32); $circs= array(); $handles = array(); //this is where the form is output. //it handles all the variables, pretty sweet deal. $self = "circles.php"; require("cir_vars2.php"); if($go != false){ $movie->setDimension($w, $h); $movie->setBackground($bg_red, $bg_green, $bg_blue); $drawLow = $drawStart - $drawGap; $drawHigh = $drawStart + $drawGap; ////////////////////////////////////////////////////////////////////////////////////////////////// //draw the left circles //example drawCircle call //function drawCircle($radius, $xstart, $ystart, $linesize, $r, $g, $b){ for($i=0; $i<=$num; $i+=.5){ //take its floor and mod it by 2 //if its even - draw it to the left of 0 with an increasing, //otherwise make it on the right with a decreasing radius //bottom left if ($i % 2 != 0){ $circs[($i+.5)] = drawCircle($rad-($i*$multiplier), $drawHigh-($i*$multiplier), $drawStart+($i*$multiplier), $thickness, $r, $g, $b); //upper left } else { $circs[($i+.5)] = drawCircle($rad-($i*$multiplier), $drawHigh-($i*$multiplier), $drawStart-($i*$multiplier), $thickness, $r, $g, $b); } $handles[$i] = $movie->add($circs[$i]); //if its even, move it to the left, otherwise put it on the right if($i % 2 == 0) $handles[$i]->moveTo($x0, $y0+($i*$multiplier)); else $handles[$i]->moveTo($x0, $y0-($i*$multiplier)); $handles[$i]->scale($scale, $scale); } //since the loop increments by .5, theres one circle drawn but not added. //do that here. $handles[$i] = $movie->add($circs[$i]); if($i % 2 == 0) $handles[$i]->moveTo($x0, $y0+($i*$multiplier)); else $handles[$i]->moveTo($x0, $y0-($i*$multiplier)); $handles[$i]->scale($scale, $scale); ////////////////////////////////////////////////////////////////////////////////////////////////// //draw the right circles for($i=0; $i<=$num; $i+=.5){ //lower right if ($i % 2 != 0){ $circs[($i+.5)] = drawCircle($rad-($i*$multiplier), $drawLow+($i*$multiplier), $drawStart+($i*$multiplier), $thickness, $r, $g, $b); //upper right } else { $circs[($i+.5)] = drawCircle($rad-($i*$multiplier), $drawLow+($i*$multiplier), $drawStart-($i*$multiplier), $thickness, $r, $g, $b); } $handles2[$i] = $movie->add($circs[$i]); //gotta love modular arithmetic if($i % 2 == 0){ $handles2[$i]->moveTo($x0, $y0+($i*$multiplier)); } else { $handles2[$i]->moveTo($x0, $y0-($i*$multiplier)); } $handles2[$i]->scale($scale, $scale); } //since the loop increments by .5, theres one circle drawn but not added. //do that here. $handles2[$i] = $movie->add($circs[$i]); if($i % 2 == 0) $handles2[$i]->moveTo($x0, $y0+($i*$multiplier)); else $handles2[$i]->moveTo($x0, $y0-($i*$multiplier)); $handles2[$i]->scale($scale, $scale); ////////////////////////////////////////////////////////////////////////////////////////////////// //here we fade the circles out $movie->nextFrame(); for($i=$num; $i>=0; $i--){ //you want to go from the the circle color to the background color. //this'll do it $handles[$i]->addcolor($bg_red-$r, $bg_green-$g, $bg_blue-$b); $handles2[$i]->addcolor($bg_red-$r, $bg_green-$g, $bg_blue-$b); if($i!=0) $movie->nextFrame(); } if($effect == "in_only"){ //this will create an into the screen only effect for($i=$num; $i>=0; $i--){ $handles[$i]->addcolor($r, $g, $b); $handles2[$i]->addcolor($r, $g, $b); $movie->nextFrame(); } } else { //this will create and in out effect for($i=0; $i<=$num; $i++){ $handles[$i]->addcolor($r, $g, $b); $handles2[$i]->addcolor($r, $g, $b); $movie->nextFrame(); } } //and a final pause for($i=0; $i<$pause; $i++) $movie->nextFrame(); $movie->save($name); echo "it worked.";; }//end if (go != false) displayHTMLpost(); ?> //cir_vars2.php \n"; for($m=0; $m"; for($i=1; $i ".$description[$m][$i]."\n"; } $output .= "
"; } $output .= ""; $go = false; } else { for($i=0; $i view it\n"; $go = true; } ?>