<?php
include("sample_utils.php"); // provides some utils and using mk
function draw_many_stars($nmbStars){
$sc = new MKshape_container(); // the shape
$rStr = "0123456789ABCDEF";
for($i = 0; $i < $nmbStars; $i++){
$x = 14 * $i;
$rCol =
$rStr[rand(6,
15)];
$rCol .= $rCol ."0000";
$sc->add_fillStyle_solid("#" .$rCol); // fill color, max red value
$sc->add_star($x, $y, 20, "auto", 5, $i * 10); // a circle with radius, x,y
$sc->increase_shapeDepth();
}
$sd = $sc->update_tagData(); // get shape tag
$po = $sc->update_place_tagData(); // get placing data
$swf = new MKswf("test_draw03.swf"); // start a fresh swf
$swf->set_swfDir(SERVER_MKTMP); // change default working dir
$swf->add_tagData($sd); // populate with shape
$swf->add_tagData($po); // place on stage
$swf->swf_output(); // save to disk
$swfHeader = $swf->fetch_assoc();
$str = render_swf_box($swfHeader, $imgDir, false);
$str .= "<br/><strong>test_draw03.swf created in" .SERVER_MKTMP ."</strong>";
return $str;
}
$str = draw_many_stars(200);
?>