Return to Snippet

Revision: 30321
at December 21, 2011 03:09 by adrianparr


Updated Code
private function showCentre($doc:DisplayObjectContainer = null, $colour:uint = 0x000000, $radius:Number = 2):void
{
	var dot:Shape = new Shape();
	dot.graphics.beginFill($colour);
	dot.graphics.drawCircle(0, 0, $radius);
	dot.graphics.endFill();
	$doc.addChild(dot);
}

Revision: 30320
at August 11, 2010 20:13 by adrianparr


Initial Code
private function showCentre():void
{
	var dot:Shape = new Shape();
	dot.graphics.beginFill(0x000000);
	dot.graphics.drawCircle(0, 0, 2);
	dot.graphics.endFill();
	addChild(dot);
}

Initial URL


Initial Description
A handy little function to dynamically draw a black dot on the stage (or displayObject). This can be useful if you want to see where 0,0 is located.

Initial Title
AS3 Draw a Dot at 0,0 to Show the Centre Of a DisplayObject

Initial Tags
center

Initial Language
ActionScript 3