Tuesday, July 13, 2010

Circle


<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" borderStyle="solid" backgroundGradientAlphas="[1.0, 1.0]" backgroundGradientColors="[#FFFFFF, #DFDFDF]">
<mx:Script> <![CDATA[ import mx.core.Container;    private var xpos:int;    private var ypos:int;    private var rad:int; private function onMouseDown(event:MouseEvent):void { xpos=(event.currentTarget as Container).mouseX; ypos=(event.currentTarget as Container).mouseY; } private function onMouseUp(event:MouseEvent):void { rad=((event.currentTarget as Container).mouseX-xpos)/2; graphicsHolder.graphics.beginFill(0xFF8800,1); graphicsHolder.graphics.drawCircle(xpos,ypos,rad);
} ]]> </mx:Script> <mx:Canvas mouseDown="onMouseDown(event)" mouseUp="onMouseUp(event)" id="graphicsHolder" dropShadowEnabled="true" width="698" height="447" borderStyle="solid" backgroundColor="#FFFFFF" backgroundAlpha="0.5" horizontalCenter="0" top="10" borderColor="#646566"> </mx:Canvas>
</mx:Application>





OUT PUT








No comments:

Post a Comment