The radius parameter for the circle function is the width and height of the circle x2. The radius draws a circle with a radius of 40 around the center point of the circle (so ends up being 80 pixels across). The placement of the circle in this lesson is centered on the page. Looking at the size of the page and the placement of the circle:
Then you can call the function with the following code:
$LilacCircle=$myMovie->add(circle(red,green,blue,size));
$LilacCircle->moveTo(x,y);
This way, you do not have to rewrite all those lines for every different color circle you want to use on one page.
Additionally, Ming has codes for a circle shape that is simpler, but some people complained that the results were not always as expected, and prefer the circle function instead. The code is as follows:
<?
$myMovie = new SWFMovie();
$myMovie->setBackground(0x00, 0x00, 0xff);
$myMovie->setDimension(46, 46);
$circleshape = new SWFShape();
$circleshape->setRIGHTFill($circleshape->addFill(255,0,255,255));
$circleshape->setLine(5,255,255,255,255);
$circleshape->drawCircle(20);
$firstcirc=$myMovie->add($circleshape);
$firstcirc->moveTo(23,23);
header('Content-type: application/x-shockwave-flash');
$myMovie->output();
$myMovie->save("Circle.swf");
?>
Below is the simpler circle code:
Again, looking at the above code, the width and height are 46, 46. The size of the circle is 20 (which results in a circle of 40 pixels). The setline is 5 (in white), which adds another 5 pixels around the circle. Therefore, to accommodate the added pixels and to center it on the background, I needed to make the background 46, 46, and center it at 23, 23. Looking at the result, you'll notice a background that is approximately 1/2 pixel wide around the circle.