<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.2.1" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: Drawing complex rectangles in Flex using the GraphicsUtil class</title>
	<link>http://blog.flexexamples.com/2007/09/16/drawing-complex-rectangles-in-flex-using-the-graphicsutil-class/</link>
	<description>A bunch of examples for Adobe Flex and ActionScript</description>
	<pubDate>Fri, 05 Dec 2008 09:13:33 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.1</generator>

	<item>
		<title>By: Priyanka Rane</title>
		<link>http://blog.flexexamples.com/2007/09/16/drawing-complex-rectangles-in-flex-using-the-graphicsutil-class/#comment-9160</link>
		<author>Priyanka Rane</author>
		<pubDate>Mon, 31 Mar 2008 06:57:29 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2007/09/16/drawing-complex-rectangles-in-flex-using-the-graphicsutil-class/#comment-9160</guid>
		<description>Hey Peter,

Thanks for giving this example of drawing rectangle using mouse....it helped me in learning drawing in my assignment....Thanks once again Peter for your great help....</description>
		<content:encoded><![CDATA[<p>Hey Peter,</p>
<p>Thanks for giving this example of drawing rectangle using mouse&#8230;.it helped me in learning drawing in my assignment&#8230;.Thanks once again Peter for your great help&#8230;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rconceiver</title>
		<link>http://blog.flexexamples.com/2007/09/16/drawing-complex-rectangles-in-flex-using-the-graphicsutil-class/#comment-7796</link>
		<author>rconceiver</author>
		<pubDate>Sat, 22 Mar 2008 07:53:09 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2007/09/16/drawing-complex-rectangles-in-flex-using-the-graphicsutil-class/#comment-7796</guid>
		<description>Thanks Peter,

At least it has given me a start...

Thanks once again...:)</description>
		<content:encoded><![CDATA[<p>Thanks Peter,</p>
<p>At least it has given me a start&#8230;</p>
<p>Thanks once again&#8230;:)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: peterd</title>
		<link>http://blog.flexexamples.com/2007/09/16/drawing-complex-rectangles-in-flex-using-the-graphicsutil-class/#comment-7725</link>
		<author>peterd</author>
		<pubDate>Thu, 20 Mar 2008 15:40:11 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2007/09/16/drawing-complex-rectangles-in-flex-using-the-graphicsutil-class/#comment-7725</guid>
		<description>rconceiver,

It has a few [major] bugs, but this may get you started:
&lt;pre class="code"&gt;
&#60;?xml version="1.0" encoding="utf-8"?&#62;
&#60;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical"&#62;
    
    &#60;mx:Script&#62;
        &#60;![CDATA[
            import mx.containers.Canvas;
        
            private var x1:uint;
            private var y1:uint;
            private var x2:uint;
            private var y2:uint;
            
            private var isDrawing:Boolean = false;
        
            private function canvas_mouseDown(evt:MouseEvent):void {
                isDrawing = true;
                x1 = evt.localX;
                y1 = evt.localY;
            }
            
            private function canvas_mouseUp(evt:MouseEvent):void {
                isDrawing = false;
                x2 = evt.localX;
                y2 = evt.localY;
                
                var w:uint = x2 - x1;
                var h:uint = y2 - y1;
                
                var can:Box = evt.currentTarget as Box;
                can.graphics.beginFill(0xFF0000, 0.4);
                can.graphics.drawRect(x1, y1, w, h);
                can.graphics.endFill();
                
                trace(x1, y1, x2, y2);
            }
        ]]&#62;
    &#60;/mx:Script&#62;
    
    &#60;mx:Canvas id="canvas"
            backgroundColor="white"
            width="100%"
            height="100%"&#62;
        &#60;mx:Box id="box"
                width="100%"
                height="100%"
                mouseDown="canvas_mouseDown(event);"
                mouseUp="canvas_mouseUp(event);" /&#62;
    &#60;/mx:Canvas&#62;
    
    
&#60;/mx:Application&#62;
&lt;/pre&gt;

Peter</description>
		<content:encoded><![CDATA[<p>rconceiver,</p>
<p>It has a few [major] bugs, but this may get you started:</p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            import mx.containers.Canvas;

            private var x1:uint;
            private var y1:uint;
            private var x2:uint;
            private var y2:uint;

            private var isDrawing:Boolean = false;

            private function canvas_mouseDown(evt:MouseEvent):void {
                isDrawing = true;
                x1 = evt.localX;
                y1 = evt.localY;
            }

            private function canvas_mouseUp(evt:MouseEvent):void {
                isDrawing = false;
                x2 = evt.localX;
                y2 = evt.localY;

                var w:uint = x2 - x1;
                var h:uint = y2 - y1;

                var can:Box = evt.currentTarget as Box;
                can.graphics.beginFill(0xFF0000, 0.4);
                can.graphics.drawRect(x1, y1, w, h);
                can.graphics.endFill();

                trace(x1, y1, x2, y2);
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:Canvas id="canvas"
            backgroundColor="white"
            width="100%"
            height="100%"&gt;
        &lt;mx:Box id="box"
                width="100%"
                height="100%"
                mouseDown="canvas_mouseDown(event);"
                mouseUp="canvas_mouseUp(event);" /&gt;
    &lt;/mx:Canvas&gt;

&lt;/mx:Application&gt;
</pre>
<p>Peter</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rconceiver</title>
		<link>http://blog.flexexamples.com/2007/09/16/drawing-complex-rectangles-in-flex-using-the-graphicsutil-class/#comment-7713</link>
		<author>rconceiver</author>
		<pubDate>Thu, 20 Mar 2008 12:01:57 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2007/09/16/drawing-complex-rectangles-in-flex-using-the-graphicsutil-class/#comment-7713</guid>
		<description>hi peter,

I could not find any example of drawing API for creating basic shapes(e.g. Rectangle) with mouse!

Or at least can you suggest any site/blog where I can learn about it or see some example.

Thanks in advance :)

rconceiver</description>
		<content:encoded><![CDATA[<p>hi peter,</p>
<p>I could not find any example of drawing API for creating basic shapes(e.g. Rectangle) with mouse!</p>
<p>Or at least can you suggest any site/blog where I can learn about it or see some example.</p>
<p>Thanks in advance :)</p>
<p>rconceiver</p>
]]></content:encoded>
	</item>
</channel>
</rss>
