/ Published in: ActionScript 3

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.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
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); }
Comments
