<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Architect, Engineer, Tech Enthusiast - Hasan Otuome &#187; AIR</title>
	<atom:link href="http://technophi.com/category/adobe/air/feed/" rel="self" type="application/rss+xml" />
	<link>http://technophi.com</link>
	<description>personal weblog of a tech addict</description>
	<lastBuildDate>Wed, 18 Aug 2010 17:59:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Flex 4 &#8211; Base64 Image Decompression and Decoding</title>
		<link>http://technophi.com/2010/08/18/flex-4-base64-image-decompression-and-decoding/</link>
		<comments>http://technophi.com/2010/08/18/flex-4-base64-image-decompression-and-decoding/#comments</comments>
		<pubDate>Wed, 18 Aug 2010 12:04:11 +0000</pubDate>
		<dc:creator>Hasan Otuome</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://technophi.com/?p=536</guid>
		<description><![CDATA[If you ever run into a situation where you need/want to work with Base64-encoded images using AMF, here&#8217;s an example of the process involved in retrieving the encoded data packed with GZip compression from the backend. Source view is enabled on the SWF and the AMFPHP service used are included as well. To view the [...]]]></description>
			<content:encoded><![CDATA[<p>If you ever run into a situation where you need/want to work with Base64-encoded images using AMF, here&#8217;s an example of the process involved in retrieving the encoded data packed with GZip compression from the backend. Source view is enabled on the SWF and the AMFPHP service used are included as well. </p>
<p>To view the demo in its own window, click <a href="http://technophi.com/examples/base64/Base64Decompressor.html">here</a>.<br />
<br/></p>

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_Base64Decompressor_1490605402"
			class="flashmovie"
			width="955"
			height="600">
	<param name="movie" value="/examples/base64/Base64Decompressor.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="/examples/base64/Base64Decompressor.swf"
			name="fm_Base64Decompressor_1490605402"
			width="955"
			height="600">
	<!--<![endif]-->
		
<p><a href="http://adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>

	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
]]></content:encoded>
			<wfw:commentRss>http://technophi.com/2010/08/18/flex-4-base64-image-decompression-and-decoding/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flash Builder 4 &#8211; Java Heap Space Issues</title>
		<link>http://technophi.com/2010/08/12/flash-builder-4-java-heap-space-issues/</link>
		<comments>http://technophi.com/2010/08/12/flash-builder-4-java-heap-space-issues/#comments</comments>
		<pubDate>Fri, 13 Aug 2010 01:10:51 +0000</pubDate>
		<dc:creator>Hasan Otuome</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://technophi.com/?p=528</guid>
		<description><![CDATA[If you ever experience a message like &#8220;Error: Java Heap Space&#8221; when building, cleaning or generating a bin-release for a project in Flash Builder 4, try the following as a remedy: 1. Open the following files: a) /install_dir/sdks/3.5.0/bin/jvm.config b) /install_dir/sdks/4.0.0/bin/jvm.config 2. Locate the following line found under # Arguments to VM: java.args=-Xmx384m -Dsun.io.useCanonCaches=false 3. Increase [...]]]></description>
			<content:encoded><![CDATA[<p>If you ever experience a message like &#8220;Error: Java Heap Space&#8221; when building, cleaning or generating a bin-release for a project in Flash Builder 4, try the following as a remedy:</p>
<p>1. Open the following files:<br />
	a) /install_dir/sdks/3.5.0/bin/jvm.config<br />
	b) /install_dir/sdks/4.0.0/bin/jvm.config</p>
<p>2. Locate the following line found under # Arguments to VM:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">java.args=-Xmx384m -Dsun.io.useCanonCaches=<span style="color: #c20cb9; font-weight: bold;">false</span></pre></div></div>

<p>3. Increase the memory size to a larger value like the following example:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">java.args=-Xmx512m -Dsun.io.useCanonCaches=<span style="color: #c20cb9; font-weight: bold;">false</span></pre></div></div>

<p>The max you set this value to is determined by your available memory along with some workflow considerations but this should alleviate your heap issues and smooth out Flash Builder compilations considerably&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://technophi.com/2010/08/12/flash-builder-4-java-heap-space-issues/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Running Android on an iPhone 3G</title>
		<link>http://technophi.com/2010/06/13/running-android-on-an-iphone-3g/</link>
		<comments>http://technophi.com/2010/06/13/running-android-on-an-iphone-3g/#comments</comments>
		<pubDate>Sun, 13 Jun 2010 08:49:22 +0000</pubDate>
		<dc:creator>Hasan Otuome</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[OSX]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Flash Platform]]></category>

		<guid isPermaLink="false">http://technophi.com/?p=500</guid>
		<description><![CDATA[Ran across this video from the iDroid team @ linuxoniphone.blogspot.com that demonstrates an iPhone 3G dual-booting iOS and Android. The demo covers several typical usage scenarios like web browsing, music playback, SMS and making phone calls. Looks stable enough for me to turn my 3Gs into a pimped out iOS/Android test device in a couple [...]]]></description>
			<content:encoded><![CDATA[<p>Ran across this video from the iDroid team @ <a href="http://linuxoniphone.blogspot.com/">linuxoniphone.blogspot.com</a> that demonstrates an iPhone 3G dual-booting iOS and Android. The demo covers several typical usage scenarios like web browsing, music playback, SMS and making phone calls. Looks stable enough for me to turn my 3Gs into a pimped out iOS/Android test device in a couple of weeks. Enjoy!</p>
<p><object width="640" height="385"><param name="movie" value="http://www.youtube.com/v/5yO2KQHkt4A&#038;rel=0&#038;color1=0x3a3a3a&#038;color2=0x999999&#038;hl=fr_FR&#038;feature=player_embedded&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowScriptAccess" value="always"></param><embed src="http://www.youtube.com/v/5yO2KQHkt4A&#038;rel=0&#038;color1=0x3a3a3a&#038;color2=0x999999&#038;hl=fr_FR&#038;feature=player_embedded&#038;fs=1" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="640" height="385"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://technophi.com/2010/06/13/running-android-on-an-iphone-3g/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using a Custom AdvancedDataGridHeaderRenderer to Display a Custom Image</title>
		<link>http://technophi.com/2010/02/09/using-a-custom-advanceddatagridheaderrenderer-to-display-a-custom-image/</link>
		<comments>http://technophi.com/2010/02/09/using-a-custom-advanceddatagridheaderrenderer-to-display-a-custom-image/#comments</comments>
		<pubDate>Tue, 09 Feb 2010 18:38:07 +0000</pubDate>
		<dc:creator>Hasan Otuome</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Flash Platform]]></category>

		<guid isPermaLink="false">http://technophi.com/?p=385</guid>
		<description><![CDATA[You decide to use an AdvancedDataGrid to display your data and for one of the columns you would prefer to use an icon instead of a text label to indicate the kind of data this column represents. First step is building the renderer. You can use either MXML or ActionScript but for this example we&#8217;ll [...]]]></description>
			<content:encoded><![CDATA[<p>You decide to use an AdvancedDataGrid to display your data and for one of the columns you would prefer to use an icon instead of a text label to indicate the kind of data this column represents. </p>
<p>First step is building the renderer. You can use either MXML or ActionScript but for this example we&#8217;ll use ActionScript.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #9900cc; font-weight: bold;">package</span> labs.otuome.ui.renderers
<span style="color: #000000;">&#123;</span>
  <span style="color: #0033ff; font-weight: bold;">import</span> mx.controls.Button;
  <span style="color: #0033ff; font-weight: bold;">import</span> mx.controls.advancedDataGridClasses.AdvancedDataGridHeaderRenderer;
&nbsp;
  <span style="color: #3f5fbf;">/**
   * Custom header renderer for displaying 
   * a graphical image in the column header.
   * @author Hasan Otuome
   */</span>
  <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> StatusHeaderRenderer extends AdvancedDataGridHeaderRenderer
  <span style="color: #000000;">&#123;</span>                                                                                          
    <span style="color: #009900;">/////////////////////////////////////////////////////////////////////////////////////////</span>
    <span style="color: #009900;">// PRIVATE PROPERTIES                                                                    </span>
    <span style="color: #009900;">/////////////////////////////////////////////////////////////////////////////////////////</span>
    <span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _btn<span style="color: #000000; font-weight: bold;">:</span>Button;                                                                 
    <span style="color: #0033ff; font-weight: bold;">private</span> const LEFT_PADDING<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">int</span> = <span style="color: #000000; font-weight:bold;">12</span>;                                                     
    <span style="color: #009900;">/////////////////////////////////////////////////////////////////////////////////////////</span>
    <span style="color: #009900;">// PUBLIC PROPERTIES                                                                     </span>
    <span style="color: #009900;">/////////////////////////////////////////////////////////////////////////////////////////</span>
&nbsp;
    <span style="color: #009900;">/////////////////////////////////////////////////////////////////////////////////////////</span>
    <span style="color: #009900;">// PUBLIC METHODS                                                                        </span>
    <span style="color: #009900;">/////////////////////////////////////////////////////////////////////////////////////////</span>
    <span style="color: #3f5fbf;">/**
     * Constructor 
     */</span>		
    <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> StatusHeaderRenderer<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
    <span style="color: #000000;">&#123;</span>
      <span style="color: #0033ff; font-weight: bold;">super</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
    <span style="color: #000000;">&#125;</span>
&nbsp;
    <span style="color: #009900;">/////////////////////////////////////////////////////////////////////////////////////////</span>
    <span style="color: #009900;">// OVERRIDES</span>
    <span style="color: #009900;">/////////////////////////////////////////////////////////////////////////////////////////</span>
    <span style="color: #3f5fbf;">/**
     * Override to add the custom component. 
     */</span>		
    override <span style="color: #0033ff; font-weight: bold;">protected</span> <span style="color: #339966; font-weight: bold;">function</span> createChildren<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
    <span style="color: #000000;">&#123;</span>
      <span style="color: #0033ff; font-weight: bold;">super</span>.createChildren<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
      _btn = <span style="color: #0033ff; font-weight: bold;">new</span> Button<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
      _btn.<span style="color: #004993;">width</span> = <span style="color: #000000; font-weight:bold;">16</span>;
      _btn.<span style="color: #004993;">height</span> = <span style="color: #000000; font-weight:bold;">16</span>;
      _btn.<span style="color: #004993;">setStyle</span><span style="color: #000000;">&#40;</span> <span style="color: #990000;">'skin'</span>, StatusMarkerHeaderIconSkin <span style="color: #000000;">&#41;</span>;
&nbsp;
      <span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span> _btn <span style="color: #000000;">&#41;</span>;
    <span style="color: #000000;">&#125;</span>
    <span style="color: #3f5fbf;">/**
     * Override to layout the children 
     * @param unscaledWidth
     * @param unscaledHeight
     */</span>		
    override <span style="color: #0033ff; font-weight: bold;">protected</span> <span style="color: #339966; font-weight: bold;">function</span> updateDisplayList<span style="color: #000000;">&#40;</span> unscaledWidth<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Number</span>, 
                                                  unscaledHeight<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Number</span> <span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
    <span style="color: #000000;">&#123;</span>
      _btn.<span style="color: #004993;">x</span> = LEFT_PADDING;
&nbsp;
      <span style="color: #0033ff; font-weight: bold;">super</span>.updateDisplayList<span style="color: #000000;">&#40;</span> unscaledWidth, unscaledHeight <span style="color: #000000;">&#41;</span>;
    <span style="color: #000000;">&#125;</span>
    <span style="color: #009900;">/////////////////////////////////////////////////////////////////////////////////////////</span>
    <span style="color: #009900;">// PRIVATE METHODS</span>
    <span style="color: #009900;">/////////////////////////////////////////////////////////////////////////////////////////</span>
  <span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>Here we&#8217;ve added a 16&#215;16 button with a custom skin that will serve as our column header and we adjust the position of the custom skin so that it displays where we&#8217;d like it to.</p>
<p>Now, we can provide this class name to our AdvancedDataGridColumn that we wish to customize. We do this by assigning our custom class to the headerRenderer property of the AdvancedDataGridColumn. This property can be set via MXML or ActionScript. I&#8217;ll show an example in ActionScript as that approach is slightly more involved.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #0033ff; font-weight: bold;">import</span> mx.core.ClassFactory; 
myADGColumn.headerRenderer = <span style="color: #0033ff; font-weight: bold;">new</span> ClassFactory<span style="color: #000000;">&#40;</span> StatusHeaderRenderer <span style="color: #000000;">&#41;</span>;</pre></div></div>

<p>Here we&#8217;ve used ClassFactory to get an instance of our custom renderer and we&#8217;ve assigned that instance to our chosen data grid column. Now, all that&#8217;s left to do is compile our application to see the result.</p>
<p><a href="http://technophi.com/wp-content/uploads/olgk_custom_header.png"><img src="http://technophi.com/wp-content/uploads/olgk_custom_header-300x195.png" alt="" title="olgk_custom_header" width="300" height="195" class="aligncenter size-medium wp-image-388" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://technophi.com/2010/02/09/using-a-custom-advanceddatagridheaderrenderer-to-display-a-custom-image/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Joining the Adobe Community Professionals for 2010</title>
		<link>http://technophi.com/2010/01/18/joining-the-adobe-community-professionals-for-2010/</link>
		<comments>http://technophi.com/2010/01/18/joining-the-adobe-community-professionals-for-2010/#comments</comments>
		<pubDate>Tue, 19 Jan 2010 03:33:19 +0000</pubDate>
		<dc:creator>Hasan Otuome</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Community]]></category>

		<guid isPermaLink="false">http://technophi.com/?p=371</guid>
		<description><![CDATA[Formerly the Adobe Community Experts program, this is a collective of awesome individuals who exhibit expertise in various Adobe product areas from Acrobat to Photoshop, Flash, Cold Fusion, Flex, AIR and many, many more. Comprised of community leaders, this group has a worldwide presence and expounds the virtues of Adobe to the masses through the [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://lizfrederick.blogspot.com/2010/01/adobe-community-professionals.html">Formerly the Adobe Community Experts program</a>, this is a collective of awesome individuals who exhibit expertise in various Adobe product areas from Acrobat to Photoshop, Flash, Cold Fusion, Flex, AIR and many, many more. Comprised of community leaders, this group has a worldwide presence and expounds the virtues of Adobe to the masses through the sharing of their time and expertise.</p>
<p>I&#8217;m truly honored to have been <a href="http://lizfrederick.blogspot.com/2010/01/new-acps-for-2010.html">chosen as a member</a> of this select group and look forward to expanding my community efforts throughout this new year. Having missed FlashCamp Brasil this past weekend, this revelation makes the trip to FITC Amsterdam that much more rewarding. See you there!!</p>
]]></content:encoded>
			<wfw:commentRss>http://technophi.com/2010/01/18/joining-the-adobe-community-professionals-for-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Introducing Opticon Runtime Debugger</title>
		<link>http://technophi.com/2010/01/09/introducing-opticon-runtime-debugger/</link>
		<comments>http://technophi.com/2010/01/09/introducing-opticon-runtime-debugger/#comments</comments>
		<pubDate>Sat, 09 Jan 2010 12:49:48 +0000</pubDate>
		<dc:creator>Hasan Otuome</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://technophi.com/?p=340</guid>
		<description><![CDATA[Opticon is a runtime debugging console useful for Flash/Flex developers. It&#8217;s simple to start using in your projects. To use, follow these steps after installing the application: 1. Launch the application 2. Click the Settings button 3. Click on the SWC icon to add the OpticonConnector to your project&#8217;s build path 4. Replace your trace [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://technophi.com/wp-content/uploads/ol_opticon_adm_banner_495x250.png" alt="ol_opticon_adm_banner_495x250" title="ol_opticon_adm_banner_495x250" width="495" height="250" class="aligncenter size-full wp-image-348" /></p>
<p>Opticon is a runtime debugging console useful for Flash/Flex developers. It&#8217;s simple to start using in your projects. To use, follow these steps after installing the application:</p>
<p>1. Launch the application<br />
2. Click the Settings button<br />
3. Click on the SWC icon to add the OpticonConnector to your project&#8217;s build path<br />
4. Replace your trace statements with one of the following:</p>
<ul style="list-style-type:none">
<li> a) <font color="green">Opticon.log(&#8216;message to display&#8217;)</font></li>
<li> b) <font color="darkorange">Opticon.warning(&#8216;warning to display&#8217;)</font></li>
<li> c) <font color="#cc0000">Opticon.error(&#8216;error to display&#8217;)</font></li>
</ul>
<p>Download available from:<br />
<a href="http://www.adobe.com/cfusion/marketplace/index.cfm?event=marketplace.offering&#038;offeringid=17303">Adobe AIR Marketplace</a><br />
<a href="http://opticon.riaforge.org">RIAForge</a></p>
<p><strong><em>Some might ask why?</strong></em> This idea first appeared when AIR was Apollo and was born out of necessity (I always forget some trace statements during cleanup). Could I use global find and replace? Sure, when I&#8217;m developing with Eclipse-based IDEs but that&#8217;s not always the case.</p>
<p><strong><em>Why not use one of the other great tools out there?</strong></em> After 2 years in the shadows, it&#8217;s ready to be shared with the world and, because I have a vision of where I&#8217;d like to take this so hopefully you&#8217;ll come along for the ride.</p>
<p><strong><em>Where can I submit any bugs I find?</strong></em> I&#8217;ll have the bug reporting mechanism in place shortly. You&#8217;ll be notified via the application or you can subscribe to this post to be notified once that goes live.</p>
<p><strong><em>My version doesn&#8217;t include the connector. What can I do?</strong></em> This happened as a result of a build error. Visit this link to download the connector <a href="http://labs.otuome.com/get/OpticonConnector">Get Opticon Connector</a>. </p>
]]></content:encoded>
			<wfw:commentRss>http://technophi.com/2010/01/09/introducing-opticon-runtime-debugger/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Double-headed Arrows with GraphicsUtil</title>
		<link>http://technophi.com/2009/12/07/double-headed-arrows-with-graphicsutil/</link>
		<comments>http://technophi.com/2009/12/07/double-headed-arrows-with-graphicsutil/#comments</comments>
		<pubDate>Mon, 07 Dec 2009 20:00:03 +0000</pubDate>
		<dc:creator>Hasan Otuome</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://technophi.com/?p=333</guid>
		<description><![CDATA[I recently ran across this awesome utility class, GraphicsUtil, created by Noel Billig. It allows the ability to draw lines with an arrow on one end using the drawing API in AS3. This proved useful for a project I was working on. In addition to its default behavior however, I needed the utility class to [...]]]></description>
			<content:encoded><![CDATA[<p>I recently ran across this awesome utility class, <a href="http://www.dncompute.com/blog/2008/07/17/graphicsutil-a-utility-class-for-drawing-arrows.html">GraphicsUtil</a>, created by Noel Billig. It allows the ability to draw lines with an arrow on one end using the drawing API in AS3. This proved useful for a project I was working on. In addition to its default behavior however, I needed the utility class to provide the ability to draw lines with arrows on both ends. Well thanks to Noel&#8217;s clean code, I was able to easily modify the base class to do just that by adding the following static method:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #3f5fbf;">/**
 * Draws a double-headed arrow. Pass in ArrowStyle
 * objects for both arrows to override the default settings.
 * @param graphics
 * @param start
 * @param end
 * @param startStyle
 * @param endStyle
 */</span>
<span style="color: #0033ff; font-weight: bold;">public</span> static <span style="color: #339966; font-weight: bold;">function</span> drawArrows<span style="color: #000000;">&#40;</span> <span style="color: #004993;">graphics</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Graphics</span>,
        <span style="color: #004993;">start</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Point</span>,end<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Point</span>,
        startStyle<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Object</span>=<span style="color: #0033ff; font-weight: bold;">null</span>,
        endStyle<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Object</span>=<span style="color: #0033ff; font-weight: bold;">null</span> <span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
<span style="color: #000000;">&#123;</span>
	<span style="color: #009900;">// variables used for arrow 1</span>
	<span style="color: #6699cc; font-weight: bold;">var</span> startArrowStyle<span style="color: #000000; font-weight: bold;">:</span>ArrowStyle;
	<span style="color: #6699cc; font-weight: bold;">var</span> startHalfWidth<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Number</span>;
	<span style="color: #6699cc; font-weight: bold;">var</span> vect1<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Point</span>;
	<span style="color: #6699cc; font-weight: bold;">var</span> startNorm<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Point</span>;
	<span style="color: #6699cc; font-weight: bold;">var</span> start1<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Point</span>;
	<span style="color: #6699cc; font-weight: bold;">var</span> start2<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Point</span>;
	<span style="color: #6699cc; font-weight: bold;">var</span> end1<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Point</span>;
	<span style="color: #6699cc; font-weight: bold;">var</span> end2<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Point</span>;
	<span style="color: #6699cc; font-weight: bold;">var</span> startHeadPnt<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Point</span>;
	<span style="color: #6699cc; font-weight: bold;">var</span> startHeadPntNorm<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Point</span>;
	<span style="color: #6699cc; font-weight: bold;">var</span> startEdge1<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Point</span>;
	<span style="color: #6699cc; font-weight: bold;">var</span> startEdge2<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Point</span>;
	<span style="color: #6699cc; font-weight: bold;">var</span> startShaftCenter<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Point</span>;
	<span style="color: #6699cc; font-weight: bold;">var</span> startInter1<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Point</span>;
	<span style="color: #6699cc; font-weight: bold;">var</span> startInter2<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Point</span>;
	<span style="color: #6699cc; font-weight: bold;">var</span> startEdgeCenter<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Point</span>;
	<span style="color: #6699cc; font-weight: bold;">var</span> startEdgeNorm<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Point</span>;
	<span style="color: #6699cc; font-weight: bold;">var</span> startEdgeCntrl1<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Point</span>;
	<span style="color: #6699cc; font-weight: bold;">var</span> startEdgeCntrl2<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Point</span>;
&nbsp;
	<span style="color: #009900;">// variables used for arrow 2</span>
	<span style="color: #6699cc; font-weight: bold;">var</span> endArrowStyle<span style="color: #000000; font-weight: bold;">:</span>ArrowStyle;
	<span style="color: #6699cc; font-weight: bold;">var</span> endHalfWidth<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Number</span>;
	<span style="color: #6699cc; font-weight: bold;">var</span> vect2<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Point</span>;
	<span style="color: #6699cc; font-weight: bold;">var</span> endNorm<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Point</span>;
	<span style="color: #6699cc; font-weight: bold;">var</span> end3<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Point</span>;
	<span style="color: #6699cc; font-weight: bold;">var</span> end4<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Point</span>;
	<span style="color: #6699cc; font-weight: bold;">var</span> start3<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Point</span>;
	<span style="color: #6699cc; font-weight: bold;">var</span> start4<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Point</span>;
	<span style="color: #6699cc; font-weight: bold;">var</span> endHeadPnt<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Point</span>;
	<span style="color: #6699cc; font-weight: bold;">var</span> endHeadPntNorm<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Point</span>;
	<span style="color: #6699cc; font-weight: bold;">var</span> endEdge1<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Point</span>;
	<span style="color: #6699cc; font-weight: bold;">var</span> endEdge2<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Point</span>;
	<span style="color: #6699cc; font-weight: bold;">var</span> endShaftCenter<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Point</span>;
	<span style="color: #6699cc; font-weight: bold;">var</span> endInter1<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Point</span>;
	<span style="color: #6699cc; font-weight: bold;">var</span> endInter2<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Point</span>;
	<span style="color: #6699cc; font-weight: bold;">var</span> endEdgeCenter<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Point</span>;
	<span style="color: #6699cc; font-weight: bold;">var</span> endEdgeNorm<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Point</span>;
	<span style="color: #6699cc; font-weight: bold;">var</span> endEdgeCntrl1<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Point</span>;
	<span style="color: #6699cc; font-weight: bold;">var</span> endEdgeCntrl2<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Point</span>;
&nbsp;
	<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #004993;">start</span>.<span style="color: #004993;">equals</span><span style="color: #000000;">&#40;</span>end<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #0033ff; font-weight: bold;">return</span>;
&nbsp;
	<span style="color: #009900;">///////////////////////////////// start arrow config \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\</span>
	<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>startStyle == <span style="color: #0033ff; font-weight: bold;">null</span><span style="color: #000000;">&#41;</span>
	<span style="color: #000000;">&#123;</span>
		startArrowStyle = <span style="color: #0033ff; font-weight: bold;">new</span> ArrowStyle<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
	<span style="color: #000000;">&#125;</span>
	<span style="color: #0033ff; font-weight: bold;">else</span> <span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>startStyle <span style="color: #0033ff; font-weight: bold;">is</span> ArrowStyle<span style="color: #000000;">&#41;</span>
	<span style="color: #000000;">&#123;</span>
		startArrowStyle = startStyle <span style="color: #0033ff; font-weight: bold;">as</span> ArrowStyle;
	<span style="color: #000000;">&#125;</span>
	<span style="color: #0033ff; font-weight: bold;">else</span>
	<span style="color: #000000;">&#123;</span>
		startArrowStyle = <span style="color: #0033ff; font-weight: bold;">new</span> ArrowStyle<span style="color: #000000;">&#40;</span> startStyle <span style="color: #000000;">&#41;</span>;
	<span style="color: #000000;">&#125;</span>
&nbsp;
	vect1 = end.<span style="color: #004993;">subtract</span><span style="color: #000000;">&#40;</span> <span style="color: #004993;">start</span> <span style="color: #000000;">&#41;</span>;
	startHalfWidth = <span style="color: #000000;">&#40;</span>startArrowStyle.headWidth <span style="color: #000000; font-weight: bold;">!</span>= <span style="color: #000000; font-weight: bold;">-</span><span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">?</span> startArrowStyle.headWidth <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000; font-weight:bold;">2</span> <span style="color: #000000; font-weight: bold;">:</span> startArrowStyle.headLength <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000; font-weight:bold;">2</span>; 
&nbsp;
	<span style="color: #009900;">//Figure out the line start/end points</span>
	startNorm = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Point</span><span style="color: #000000;">&#40;</span> vect1.<span style="color: #004993;">y</span>, <span style="color: #000000; font-weight: bold;">-</span>vect1.<span style="color: #004993;">x</span> <span style="color: #000000;">&#41;</span>;
	startNorm.<span style="color: #004993;">normalize</span><span style="color: #000000;">&#40;</span> startArrowStyle.shaftThickness<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000; font-weight:bold;">2</span> <span style="color: #000000;">&#41;</span>;
	start1 = <span style="color: #004993;">start</span>.<span style="color: #004993;">add</span><span style="color: #000000;">&#40;</span> startNorm <span style="color: #000000;">&#41;</span>;
	start2 = <span style="color: #004993;">start</span>.<span style="color: #004993;">subtract</span><span style="color: #000000;">&#40;</span> startNorm <span style="color: #000000;">&#41;</span>;
	end1 = end.<span style="color: #004993;">add</span><span style="color: #000000;">&#40;</span> startNorm <span style="color: #000000;">&#41;</span>;
	end2 = end.<span style="color: #004993;">subtract</span><span style="color: #000000;">&#40;</span> startNorm <span style="color: #000000;">&#41;</span>;
&nbsp;
	<span style="color: #009900;">//figure out where the arrow head starts</span>
	startHeadPnt = vect1.<span style="color: #004993;">clone</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
	startHeadPnt.<span style="color: #004993;">normalize</span><span style="color: #000000;">&#40;</span> startHeadPnt.<span style="color: #004993;">length</span> <span style="color: #000000; font-weight: bold;">-</span> startArrowStyle.headLength <span style="color: #000000;">&#41;</span>;
	startHeadPnt = startHeadPnt.<span style="color: #004993;">add</span><span style="color: #000000;">&#40;</span> <span style="color: #004993;">start</span> <span style="color: #000000;">&#41;</span>;
&nbsp;
	<span style="color: #009900;">//calculate the arrowhead corners</span>
	startHeadPntNorm = startNorm.<span style="color: #004993;">clone</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
	startHeadPntNorm.<span style="color: #004993;">normalize</span><span style="color: #000000;">&#40;</span> startHalfWidth <span style="color: #000000;">&#41;</span>;
	startEdge1 = startHeadPnt.<span style="color: #004993;">add</span><span style="color: #000000;">&#40;</span> startHeadPntNorm <span style="color: #000000;">&#41;</span>;
	startEdge2 = startHeadPnt.<span style="color: #004993;">subtract</span><span style="color: #000000;">&#40;</span> startHeadPntNorm <span style="color: #000000;">&#41;</span>;
&nbsp;
	<span style="color: #009900;">//Figure out where the arrow connects the the shaft, then calc the intersections</span>
	startShaftCenter = <span style="color: #004993;">Point</span>.<span style="color: #004993;">interpolate</span><span style="color: #000000;">&#40;</span> end, startHeadPnt, startArrowStyle.shaftPosition <span style="color: #000000;">&#41;</span>;
	startInter1 = GeomUtil.getLineIntersection<span style="color: #000000;">&#40;</span> start1, end1, startShaftCenter, startEdge1 <span style="color: #000000;">&#41;</span>;
	startInter2 = GeomUtil.getLineIntersection<span style="color: #000000;">&#40;</span> start2, end2, startShaftCenter, startEdge2 <span style="color: #000000;">&#41;</span>;
&nbsp;
	<span style="color: #009900;">//Figure out the control points</span>
	startEdgeCenter = <span style="color: #004993;">Point</span>.<span style="color: #004993;">interpolate</span><span style="color: #000000;">&#40;</span> end, startHeadPnt, startArrowStyle.edgeControlPosition <span style="color: #000000;">&#41;</span>;
	startEdgeNorm = startNorm.<span style="color: #004993;">clone</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
	startEdgeNorm.<span style="color: #004993;">normalize</span><span style="color: #000000;">&#40;</span> startHalfWidth <span style="color: #000000; font-weight: bold;">*</span> startArrowStyle.edgeControlSize <span style="color: #000000;">&#41;</span>;
	startEdgeCntrl1 = startEdgeCenter.<span style="color: #004993;">add</span><span style="color: #000000;">&#40;</span> startEdgeNorm <span style="color: #000000;">&#41;</span>;
	startEdgeCntrl2 = startEdgeCenter.<span style="color: #004993;">subtract</span><span style="color: #000000;">&#40;</span> startEdgeNorm <span style="color: #000000;">&#41;</span>;
&nbsp;
	<span style="color: #009900;">///////////////////////////////// end arrow config \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\</span>
	<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>endStyle == <span style="color: #0033ff; font-weight: bold;">null</span><span style="color: #000000;">&#41;</span>
	<span style="color: #000000;">&#123;</span>
		endArrowStyle = <span style="color: #0033ff; font-weight: bold;">new</span> ArrowStyle<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
	<span style="color: #000000;">&#125;</span>
	<span style="color: #0033ff; font-weight: bold;">else</span> <span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>endStyle <span style="color: #0033ff; font-weight: bold;">is</span> ArrowStyle<span style="color: #000000;">&#41;</span>
	<span style="color: #000000;">&#123;</span>
		endArrowStyle = endStyle <span style="color: #0033ff; font-weight: bold;">as</span> ArrowStyle;
	<span style="color: #000000;">&#125;</span>
	<span style="color: #0033ff; font-weight: bold;">else</span>
	<span style="color: #000000;">&#123;</span>
		endArrowStyle = <span style="color: #0033ff; font-weight: bold;">new</span> ArrowStyle<span style="color: #000000;">&#40;</span> endStyle <span style="color: #000000;">&#41;</span>;
	<span style="color: #000000;">&#125;</span>
&nbsp;
	vect2 = <span style="color: #004993;">start</span>.<span style="color: #004993;">subtract</span><span style="color: #000000;">&#40;</span> end <span style="color: #000000;">&#41;</span>;
	endHalfWidth = <span style="color: #000000;">&#40;</span>endArrowStyle.headWidth <span style="color: #000000; font-weight: bold;">!</span>= <span style="color: #000000; font-weight: bold;">-</span><span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">?</span> endArrowStyle.headWidth <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000; font-weight:bold;">2</span> <span style="color: #000000; font-weight: bold;">:</span> endArrowStyle.headLength <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000; font-weight:bold;">2</span>;
&nbsp;
	<span style="color: #009900;">//Figure out the line start/end points</span>
	endNorm = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Point</span><span style="color: #000000;">&#40;</span> vect2.<span style="color: #004993;">y</span>, <span style="color: #000000; font-weight: bold;">-</span>vect2.<span style="color: #004993;">x</span> <span style="color: #000000;">&#41;</span>;
	endNorm.<span style="color: #004993;">normalize</span><span style="color: #000000;">&#40;</span> endArrowStyle.shaftThickness <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000; font-weight:bold;">2</span> <span style="color: #000000;">&#41;</span>;
	start3 = <span style="color: #004993;">start</span>.<span style="color: #004993;">add</span><span style="color: #000000;">&#40;</span> endNorm <span style="color: #000000;">&#41;</span>;
	start4 = <span style="color: #004993;">start</span>.<span style="color: #004993;">subtract</span><span style="color: #000000;">&#40;</span> endNorm <span style="color: #000000;">&#41;</span>;
	end3 = end.<span style="color: #004993;">add</span><span style="color: #000000;">&#40;</span> endNorm <span style="color: #000000;">&#41;</span>;
	end4 = end.<span style="color: #004993;">subtract</span><span style="color: #000000;">&#40;</span> endNorm <span style="color: #000000;">&#41;</span>;
&nbsp;
	<span style="color: #009900;">//figure out where the arrow head starts</span>
	endHeadPnt = vect2.<span style="color: #004993;">clone</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
	endHeadPnt.<span style="color: #004993;">normalize</span><span style="color: #000000;">&#40;</span> endHeadPnt.<span style="color: #004993;">length</span> <span style="color: #000000; font-weight: bold;">-</span> endArrowStyle.headLength <span style="color: #000000;">&#41;</span>;
	endHeadPnt = endHeadPnt.<span style="color: #004993;">add</span><span style="color: #000000;">&#40;</span> end <span style="color: #000000;">&#41;</span>;
&nbsp;
	<span style="color: #009900;">//calculate the arrowhead corners</span>
	endHeadPntNorm = endNorm.<span style="color: #004993;">clone</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
	endHeadPntNorm.<span style="color: #004993;">normalize</span><span style="color: #000000;">&#40;</span> endHalfWidth <span style="color: #000000;">&#41;</span>;
	endEdge1 = endHeadPnt.<span style="color: #004993;">add</span><span style="color: #000000;">&#40;</span> endHeadPntNorm <span style="color: #000000;">&#41;</span>;
	endEdge2 = endHeadPnt.<span style="color: #004993;">subtract</span><span style="color: #000000;">&#40;</span> endHeadPntNorm <span style="color: #000000;">&#41;</span>;
&nbsp;
	<span style="color: #009900;">//Figure out where the arrow connects the the shaft, then calc the intersections</span>
	endShaftCenter = <span style="color: #004993;">Point</span>.<span style="color: #004993;">interpolate</span><span style="color: #000000;">&#40;</span> <span style="color: #004993;">start</span>, endHeadPnt, endArrowStyle.shaftPosition <span style="color: #000000;">&#41;</span>;
	endInter1 = GeomUtil.getLineIntersection<span style="color: #000000;">&#40;</span> end3, start3, endShaftCenter, endEdge1 <span style="color: #000000;">&#41;</span>;
	endInter2 = GeomUtil.getLineIntersection<span style="color: #000000;">&#40;</span> end4, start4, endShaftCenter, endEdge2 <span style="color: #000000;">&#41;</span>;
&nbsp;
	<span style="color: #009900;">//Figure out the control points</span>
	endEdgeCenter = <span style="color: #004993;">Point</span>.<span style="color: #004993;">interpolate</span><span style="color: #000000;">&#40;</span> <span style="color: #004993;">start</span>, endHeadPnt, endArrowStyle.edgeControlPosition <span style="color: #000000;">&#41;</span>;
	endEdgeNorm = endNorm.<span style="color: #004993;">clone</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
	endEdgeNorm.<span style="color: #004993;">normalize</span><span style="color: #000000;">&#40;</span> endHalfWidth <span style="color: #000000; font-weight: bold;">*</span> endArrowStyle.edgeControlSize <span style="color: #000000;">&#41;</span>;
	endEdgeCntrl1 = endEdgeCenter.<span style="color: #004993;">add</span><span style="color: #000000;">&#40;</span> endEdgeNorm <span style="color: #000000;">&#41;</span>;
	endEdgeCntrl2 = endEdgeCenter.<span style="color: #004993;">subtract</span><span style="color: #000000;">&#40;</span> endEdgeNorm <span style="color: #000000;">&#41;</span>;
&nbsp;
	<span style="color: #009900;">///////////////////////////////// draw the graphics \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\</span>
	<span style="color: #009900;">// draw 1st arrow</span>
	<span style="color: #004993;">graphics</span>.<span style="color: #004993;">moveTo</span><span style="color: #000000;">&#40;</span> start1.<span style="color: #004993;">x</span>, start2.<span style="color: #004993;">y</span> <span style="color: #000000;">&#41;</span>;
	<span style="color: #004993;">graphics</span>.<span style="color: #004993;">lineTo</span><span style="color: #000000;">&#40;</span> startInter1.<span style="color: #004993;">x</span>, startInter1.<span style="color: #004993;">y</span> <span style="color: #000000;">&#41;</span>;
	<span style="color: #004993;">graphics</span>.<span style="color: #004993;">lineTo</span><span style="color: #000000;">&#40;</span> startEdge1.<span style="color: #004993;">x</span>, startEdge1.<span style="color: #004993;">y</span> <span style="color: #000000;">&#41;</span>;
	<span style="color: #004993;">graphics</span>.<span style="color: #004993;">curveTo</span><span style="color: #000000;">&#40;</span> startEdgeCntrl1.<span style="color: #004993;">x</span>, startEdgeCntrl1.<span style="color: #004993;">y</span>, end.<span style="color: #004993;">x</span>, end.<span style="color: #004993;">y</span> <span style="color: #000000;">&#41;</span>;
	<span style="color: #004993;">graphics</span>.<span style="color: #004993;">curveTo</span><span style="color: #000000;">&#40;</span> startEdgeCntrl2.<span style="color: #004993;">x</span>, startEdgeCntrl2.<span style="color: #004993;">y</span>, startEdge2.<span style="color: #004993;">x</span>, startEdge2.<span style="color: #004993;">y</span> <span style="color: #000000;">&#41;</span>;
	<span style="color: #004993;">graphics</span>.<span style="color: #004993;">lineTo</span><span style="color: #000000;">&#40;</span> startInter2.<span style="color: #004993;">x</span>, startInter2.<span style="color: #004993;">y</span> <span style="color: #000000;">&#41;</span>;
	<span style="color: #004993;">graphics</span>.<span style="color: #004993;">lineTo</span><span style="color: #000000;">&#40;</span> start2.<span style="color: #004993;">x</span>, start2.<span style="color: #004993;">y</span> <span style="color: #000000;">&#41;</span>;
	<span style="color: #004993;">graphics</span>.<span style="color: #004993;">lineTo</span><span style="color: #000000;">&#40;</span> start1.<span style="color: #004993;">x</span>, start1.<span style="color: #004993;">y</span> <span style="color: #000000;">&#41;</span>;
&nbsp;
	<span style="color: #009900;">// draw 2nd arrow</span>
	<span style="color: #004993;">graphics</span>.<span style="color: #004993;">moveTo</span><span style="color: #000000;">&#40;</span> end3.<span style="color: #004993;">x</span>, end4.<span style="color: #004993;">y</span> <span style="color: #000000;">&#41;</span>;
	<span style="color: #004993;">graphics</span>.<span style="color: #004993;">lineTo</span><span style="color: #000000;">&#40;</span> endInter1.<span style="color: #004993;">x</span>, endInter1.<span style="color: #004993;">y</span> <span style="color: #000000;">&#41;</span>;
	<span style="color: #004993;">graphics</span>.<span style="color: #004993;">lineTo</span><span style="color: #000000;">&#40;</span> endEdge1.<span style="color: #004993;">x</span>, endEdge1.<span style="color: #004993;">y</span> <span style="color: #000000;">&#41;</span>;
	<span style="color: #004993;">graphics</span>.<span style="color: #004993;">curveTo</span><span style="color: #000000;">&#40;</span> endEdgeCntrl1.<span style="color: #004993;">x</span>, endEdgeCntrl1.<span style="color: #004993;">y</span>, <span style="color: #004993;">start</span>.<span style="color: #004993;">x</span>, <span style="color: #004993;">start</span>.<span style="color: #004993;">y</span> <span style="color: #000000;">&#41;</span>;
	<span style="color: #004993;">graphics</span>.<span style="color: #004993;">curveTo</span><span style="color: #000000;">&#40;</span> endEdgeCntrl2.<span style="color: #004993;">x</span>, endEdgeCntrl2.<span style="color: #004993;">y</span>, endEdge2.<span style="color: #004993;">x</span>, endEdge2.<span style="color: #004993;">y</span> <span style="color: #000000;">&#41;</span>;
	<span style="color: #004993;">graphics</span>.<span style="color: #004993;">lineTo</span><span style="color: #000000;">&#40;</span> endInter2.<span style="color: #004993;">x</span>, endInter2.<span style="color: #004993;">y</span> <span style="color: #000000;">&#41;</span>;
	<span style="color: #004993;">graphics</span>.<span style="color: #004993;">lineTo</span><span style="color: #000000;">&#40;</span> end4.<span style="color: #004993;">x</span>, end4.<span style="color: #004993;">y</span> <span style="color: #000000;">&#41;</span>;
	<span style="color: #004993;">graphics</span>.<span style="color: #004993;">lineTo</span><span style="color: #000000;">&#40;</span> end3.<span style="color: #004993;">x</span>, end3.<span style="color: #004993;">y</span> <span style="color: #000000;">&#41;</span>;
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>Those are the basics. It can be tweaked to taste, etc. Kudos to Noel for such a useful class&#8230; <img src='http://technophi.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://technophi.com/2009/12/07/double-headed-arrows-with-graphicsutil/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Overlaying the Flex SDK with the AIR 2.0 SDK on OSX</title>
		<link>http://technophi.com/2009/12/04/overlaying-the-flex-sdk-with-the-air-2-0-sdk-on-osx/</link>
		<comments>http://technophi.com/2009/12/04/overlaying-the-flex-sdk-with-the-air-2-0-sdk-on-osx/#comments</comments>
		<pubDate>Fri, 04 Dec 2009 15:55:36 +0000</pubDate>
		<dc:creator>Hasan Otuome</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[OSX]]></category>
		<category><![CDATA[Mac]]></category>

		<guid isPermaLink="false">http://technophi.com/?p=300</guid>
		<description><![CDATA[Since I develop with multiple IDEs, I maintain the latest releases of the Flex and AIR SDKs in a centralized location outside of their default install locations. This made enabling the AIR 2.0 SDK simple for me as all I had to do was the following: 1. Duplicate my Flex 3 SDK path 2. Rename [...]]]></description>
			<content:encoded><![CDATA[<p>Since I develop with multiple IDEs, I maintain the latest releases of the Flex and AIR SDKs in a centralized location outside of their default install locations. This made enabling the AIR 2.0 SDK simple for me as all I had to do was the following:</p>
<p>1. Duplicate my Flex 3 SDK path<br />
2. Rename the duplicate to <strong>flex_sdk_3.x_air_sdk_2.x</strong><br />
3. Download the latest AIR 2.0 SDK (currently <strong>AIR20_mac_sdk_120209.tbz2</strong>)<br />
4. Place the AIR SDK zip in the root of the new Flex SDK directory</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>flex_sdk_3.x_air_sdk_2.x<span style="color: #000000; font-weight: bold;">/</span>AIR20_mac_sdk_120209.tbz2</pre></div></div>

<p>5. Open up Terminal in the new Flex SDK directory and execute the following command:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-xjf</span> AIR20_mac_sdk_120209.tbz2</pre></div></div>

<p>6. Open Flex Builder and add the new SDK -> <strong>Flex Builder > Preferences > Installed Flex SDKs > Add</strong></p>
<p>Now, when I want to create an AIR app that targets the 2.0 SDK all I have to do is</p>
<p>1. Update the project compiler settings to use the new SDK -> <strong>Project > Properties > Flex Compiler > Use a Specific SDK</strong><br />
2. Update the application descriptor file to use the AIR 2.0 namespace</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;application</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://ns.adobe.com/air/application/2.0beta&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span></pre></div></div>

<p>All of the above steps can be repeated for the Flex 4 SDK as well.</p>
<p>For those interested, these are the items that were updated and added to the SDK for 2.0:<br />
<em>/bin/adl<br />
/bin/adt<br />
/frameworks/libs/air<br />
/frameworks/projects/air<br />
/lib/nai<br />
/lib/adt.jar<br />
/runtimes/air<br />
/samples<br />
/templates/air<br />
/AIR SDK Readme.txt<br />
/SDK license.pdf</em></p>
<p><strong>CAVEATS:</strong></p>
<ol>
<li>There&#8217;s a <a href="http://blogs.adobe.com/simplicity/2009/11/upcoming_certificate_renewal_c.html">new certificate process started in AIR 1.5.3</a> that may disrupt your workflow if you&#8217;re creating signed applications.</li>
<li>If you want to utilize the new native process features, you&#8217;ll have to implement multi-platform builds (native installers for Win, Mac and Linux) and these must occur on the target platform (ie, can only create DMGs on Mac, etc)</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://technophi.com/2009/12/04/overlaying-the-flex-sdk-with-the-air-2-0-sdk-on-osx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AS3: LinearGradientUtil Class</title>
		<link>http://technophi.com/2009/11/20/as3-lineargradientutil-class/</link>
		<comments>http://technophi.com/2009/11/20/as3-lineargradientutil-class/#comments</comments>
		<pubDate>Fri, 20 Nov 2009 22:48:59 +0000</pubDate>
		<dc:creator>Hasan Otuome</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://technophi.com/?p=252</guid>
		<description><![CDATA[Once again, I found myself needing a utility class that would let me stop writing the same code block over and over again. And so, the LinearGradientUtil class was born. Previously, I&#8217;d have something like the following in a view class: /** * Draws the gradient background for * this component on initialize and resize. [...]]]></description>
			<content:encoded><![CDATA[<p>Once again, I found myself needing a utility class that would let me stop writing the same code block over and over again. And so, the LinearGradientUtil class was born.</p>
<p>Previously, I&#8217;d have something like the following in a view class:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #3f5fbf;">/**
 * Draws the gradient background for 
 * this component on initialize and resize.
 */</span>	
<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> _createGradientBackground<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
<span style="color: #000000;">&#123;</span>
   <span style="color: #6699cc; font-weight: bold;">var</span> fillType<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span>      = <span style="color: #004993;">GradientType</span>.<span style="color: #004993;">LINEAR</span>;
   <span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">colors</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Array</span>         = <span style="color: #000000;">&#91;</span> 0xe9e9e9, 0xc7c7c7 <span style="color: #000000;">&#93;</span>;
   <span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">alphas</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Array</span>         = <span style="color: #000000;">&#91;</span> <span style="color: #000000; font-weight:bold;">1</span>, <span style="color: #000000; font-weight:bold;">1</span> <span style="color: #000000;">&#93;</span>;
   <span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">ratios</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Array</span>         = <span style="color: #000000;">&#91;</span> <span style="color: #000000; font-weight:bold;">0</span>, <span style="color: #000000; font-weight:bold;">255</span> <span style="color: #000000;">&#93;</span>;
   <span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">matrix</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Matrix</span>        = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Matrix</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
       <span style="color: #004993;">matrix</span>.<span style="color: #004993;">createGradientBox</span><span style="color: #000000;">&#40;</span> <span style="color: #004993;">width</span>, <span style="color: #000000; font-weight:bold;">34</span>, <span style="color: #004993;">Math</span>.<span style="color: #004993;">PI</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000; font-weight:bold;">2</span>, <span style="color: #000000; font-weight:bold;">0</span>, <span style="color: #000000; font-weight:bold;">0</span> <span style="color: #000000;">&#41;</span>;
   <span style="color: #6699cc; font-weight: bold;">var</span> spreadMethod<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span> 	= <span style="color: #004993;">SpreadMethod</span>.<span style="color: #004993;">PAD</span>;
   <span style="color: #6699cc; font-weight: bold;">var</span> g<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Graphics</span>           = <span style="color: #0033ff; font-weight: bold;">this</span>.<span style="color: #004993;">graphics</span>;
       g.<span style="color: #004993;">clear</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
       g.<span style="color: #004993;">beginGradientFill</span><span style="color: #000000;">&#40;</span> fillType, <span style="color: #004993;">colors</span>, <span style="color: #004993;">alphas</span>, <span style="color: #004993;">ratios</span>, <span style="color: #004993;">matrix</span>, spreadMethod <span style="color: #000000;">&#41;</span>;
       g.<span style="color: #004993;">drawRect</span><span style="color: #000000;">&#40;</span> <span style="color: #000000; font-weight:bold;">0</span>, <span style="color: #000000; font-weight:bold;">0</span>, <span style="color: #004993;">width</span>, <span style="color: #004993;">height</span> <span style="color: #000000;">&#41;</span>;
       g.<span style="color: #004993;">endFill</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>This would be called after INITIALIZE and RESIZE events. Writing those lines over and over again prompted me to devise a more elegant solution:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #9900cc; font-weight: bold;">package</span> labs.otuome.fl.<span style="color: #004993;">graphics</span>
<span style="color: #000000;">&#123;</span>
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span>.<span style="color: #004993;">GradientType</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span>.<span style="color: #004993;">Graphics</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span>.<span style="color: #004993;">SpreadMethod</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span>.<span style="color: #004993;">Sprite</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.geom</span>.<span style="color: #004993;">Matrix</span>;
&nbsp;
	<span style="color: #3f5fbf;">/**
	 * Util class to create linear gradient fills.
	 * @author Hasan Otuome
	 */</span>
	<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> LinearGradientUtil
	<span style="color: #000000;">&#123;</span>
		<span style="color: #009900;">///////////////////////////////////////////////////////////////////////////////////////////////</span>
		<span style="color: #009900;">// PRIVATE PROPERTIES</span>
		<span style="color: #009900;">///////////////////////////////////////////////////////////////////////////////////////////////</span>
&nbsp;
		<span style="color: #009900;">///////////////////////////////////////////////////////////////////////////////////////////////</span>
		<span style="color: #009900;">// PUBLIC PROPERTIES</span>
		<span style="color: #009900;">///////////////////////////////////////////////////////////////////////////////////////////////</span>
		<span style="color: #0033ff; font-weight: bold;">public</span> static const <span style="color: #004993;">HORIZONTAL</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span> 		= <span style="color: #990000;">'horizontalLinearGradient'</span>;
		<span style="color: #0033ff; font-weight: bold;">public</span> static const <span style="color: #004993;">VERTICAL</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span> 		= <span style="color: #990000;">'verticalLinearGradient'</span>;
		<span style="color: #009900;">///////////////////////////////////////////////////////////////////////////////////////////////</span>
		<span style="color: #009900;">// PUBLIC METHODS</span>
		<span style="color: #009900;">///////////////////////////////////////////////////////////////////////////////////////////////</span>
		<span style="color: #3f5fbf;">/**
		 * Draws the linear gradient to the .graphics 
		 * property of the specified component. Defaults 
		 * to a Web 2.0 style gray gradient.
		 * 
		 * @param target The display object to apply the gradient to.
		 * @param size For a vertical gradient this is the 
		 * height of the gradient. For a horizontal gradient, 
		 * this is the width of the gradient. 
		 * @param primaryColor The top or left-most color depending on orientation.
		 * @param secondaryColor The bottom or right-most color depending on orientation.
		 * @param primaryAlpha The top or left-most color depending on orientation.
		 * @param secondaryAlpha The bottom or right-most alpha depending on orientation.
		 * @param primaryRatio The ratio of the top or left-most color depending on orientation.
		 * @param secondaryRatio The ratio of the bottom or right-most color depending on orientation.
		 * @param orientation either horizontal or vertical. defaults to vertical.
		 * @param invert Toggle that switches what the method considers primary and secondary.
		 */</span>		
		<span style="color: #0033ff; font-weight: bold;">public</span> static <span style="color: #339966; font-weight: bold;">function</span> createGradientBackground<span style="color: #000000;">&#40;</span> <span style="color: #004993;">target</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Sprite</span>, 
						<span style="color: #004993;">size</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">uint</span>=<span style="color: #000000; font-weight:bold;">34</span>, 
						cornerRadius<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">uint</span>=<span style="color: #000000; font-weight:bold;">0</span>, 
						primaryColor<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">uint</span>=0xe9e9e9, 
						secondaryColor<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">uint</span>=0xc7c7c7, 
						primaryAlpha<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">uint</span>=<span style="color: #000000; font-weight:bold;">1</span>, 
						secondaryAlpha<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">uint</span>=<span style="color: #000000; font-weight:bold;">1</span>, 
						primaryRatio<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">uint</span>=<span style="color: #000000; font-weight:bold;">0</span>, 
						secondaryRatio<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">uint</span>=<span style="color: #000000; font-weight:bold;">255</span>, 
						<span style="color: #004993;">orientation</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span>=LinearGradientUtil.<span style="color: #004993;">HORIZONTAL</span>, 
						<span style="color: #004993;">invert</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Boolean</span>=<span style="color: #0033ff; font-weight: bold;">false</span> <span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #6699cc; font-weight: bold;">var</span> fillType<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span>;
			<span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">colors</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Array</span>;
			<span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">alphas</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Array</span>;
			<span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">ratios</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Array</span>;
			<span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">matrix</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Matrix</span>;
			<span style="color: #6699cc; font-weight: bold;">var</span> spreadMethod<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span>;
			<span style="color: #6699cc; font-weight: bold;">var</span> g<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Graphics</span>;
&nbsp;
			fillType 			= <span style="color: #004993;">GradientType</span>.<span style="color: #004993;">LINEAR</span>;
			<span style="color: #004993;">colors</span> 				= _createColorsArray<span style="color: #000000;">&#40;</span> primaryColor, secondaryColor, <span style="color: #004993;">invert</span> <span style="color: #000000;">&#41;</span>;
			<span style="color: #004993;">alphas</span> 				= _createAlphasArray<span style="color: #000000;">&#40;</span> primaryAlpha, secondaryAlpha, <span style="color: #004993;">invert</span> <span style="color: #000000;">&#41;</span>;
			<span style="color: #004993;">ratios</span> 				= _createRatiosArray<span style="color: #000000;">&#40;</span> primaryRatio, secondaryRatio, <span style="color: #004993;">invert</span> <span style="color: #000000;">&#41;</span>;
			<span style="color: #004993;">matrix</span> 				= <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Matrix</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">switch</span> <span style="color: #000000;">&#40;</span><span style="color: #004993;">orientation</span><span style="color: #000000;">&#41;</span>
			<span style="color: #000000;">&#123;</span>
				<span style="color: #0033ff; font-weight: bold;">case</span> LinearGradientUtil.<span style="color: #004993;">HORIZONTAL</span><span style="color: #000000; font-weight: bold;">:</span>
					<span style="color: #004993;">matrix</span>.<span style="color: #004993;">createGradientBox</span><span style="color: #000000;">&#40;</span> <span style="color: #004993;">size</span>, <span style="color: #004993;">target</span>.<span style="color: #004993;">height</span>, <span style="color: #004993;">Math</span>.<span style="color: #004993;">PI</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000; font-weight:bold;">2</span>, <span style="color: #000000; font-weight:bold;">0</span>, <span style="color: #000000; font-weight:bold;">0</span> <span style="color: #000000;">&#41;</span>;
					<span style="color: #0033ff; font-weight: bold;">break</span>;
				<span style="color: #0033ff; font-weight: bold;">case</span> LinearGradientUtil.<span style="color: #004993;">VERTICAL</span><span style="color: #000000; font-weight: bold;">:</span>
					<span style="color: #004993;">matrix</span>.<span style="color: #004993;">createGradientBox</span><span style="color: #000000;">&#40;</span> <span style="color: #004993;">target</span>.<span style="color: #004993;">width</span>, <span style="color: #004993;">size</span>, <span style="color: #004993;">Math</span>.<span style="color: #004993;">PI</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000; font-weight:bold;">2</span>, <span style="color: #000000; font-weight:bold;">0</span>, <span style="color: #000000; font-weight:bold;">0</span> <span style="color: #000000;">&#41;</span>;
					<span style="color: #0033ff; font-weight: bold;">break</span>;
			<span style="color: #000000;">&#125;</span>
&nbsp;
			spreadMethod 		= <span style="color: #004993;">SpreadMethod</span>.<span style="color: #004993;">PAD</span>;
&nbsp;
			g 					= <span style="color: #004993;">target</span>.<span style="color: #004993;">graphics</span>;
			g.<span style="color: #004993;">clear</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			g.<span style="color: #004993;">beginGradientFill</span><span style="color: #000000;">&#40;</span> fillType, <span style="color: #004993;">colors</span>, <span style="color: #004993;">alphas</span>, <span style="color: #004993;">ratios</span>, <span style="color: #004993;">matrix</span>, spreadMethod <span style="color: #000000;">&#41;</span>;
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>cornerRadius <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000000;">&#41;</span>
			<span style="color: #000000;">&#123;</span>
				g.<span style="color: #004993;">drawRoundRect</span><span style="color: #000000;">&#40;</span> <span style="color: #000000; font-weight:bold;">0</span>, <span style="color: #000000; font-weight:bold;">0</span>, <span style="color: #004993;">target</span>.<span style="color: #004993;">width</span>, <span style="color: #004993;">target</span>.<span style="color: #004993;">height</span>, cornerRadius <span style="color: #000000;">&#41;</span>;
			<span style="color: #000000;">&#125;</span>
			<span style="color: #0033ff; font-weight: bold;">else</span>
			<span style="color: #000000;">&#123;</span>
				g.<span style="color: #004993;">drawRect</span><span style="color: #000000;">&#40;</span> <span style="color: #000000; font-weight:bold;">0</span>, <span style="color: #000000; font-weight:bold;">0</span>, <span style="color: #004993;">target</span>.<span style="color: #004993;">width</span>, <span style="color: #004993;">target</span>.<span style="color: #004993;">height</span> <span style="color: #000000;">&#41;</span>;
			<span style="color: #000000;">&#125;</span>
&nbsp;
			g.<span style="color: #004993;">endFill</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
		<span style="color: #009900;">///////////////////////////////////////////////////////////////////////////////////////////////</span>
		<span style="color: #009900;">// OVERRIDES</span>
		<span style="color: #009900;">///////////////////////////////////////////////////////////////////////////////////////////////</span>
&nbsp;
		<span style="color: #009900;">///////////////////////////////////////////////////////////////////////////////////////////////</span>
		<span style="color: #009900;">// PRIVATE METHODS</span>
		<span style="color: #009900;">///////////////////////////////////////////////////////////////////////////////////////////////</span>
		<span style="color: #3f5fbf;">/**
		 * Creates the colors array required by the main method. 
		 * @param colorOne
		 * @param colorTwo
		 * @param inverted
		 * @return The gradient colors array.
		 */</span>		
		<span style="color: #0033ff; font-weight: bold;">private</span> static <span style="color: #339966; font-weight: bold;">function</span> _createColorsArray<span style="color: #000000;">&#40;</span> colorOne<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">uint</span>, 
						colorTwo<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">uint</span>, 
						inverted<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Boolean</span>=<span style="color: #0033ff; font-weight: bold;">false</span> <span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Array</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">colors</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Array</span>;
			<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight: bold;">!</span>inverted<span style="color: #000000;">&#41;</span>
			<span style="color: #000000;">&#123;</span>
				<span style="color: #004993;">colors</span> = <span style="color: #000000;">&#91;</span> colorOne, colorTwo <span style="color: #000000;">&#93;</span>; 
			<span style="color: #000000;">&#125;</span>
			<span style="color: #0033ff; font-weight: bold;">else</span>
			<span style="color: #000000;">&#123;</span>
				<span style="color: #004993;">colors</span> = <span style="color: #000000;">&#91;</span> colorTwo, colorOne <span style="color: #000000;">&#93;</span>; 
			<span style="color: #000000;">&#125;</span>
			<span style="color: #0033ff; font-weight: bold;">return</span> <span style="color: #004993;">colors</span>;
		<span style="color: #000000;">&#125;</span>
		<span style="color: #3f5fbf;">/**
		 * Creates the alphas array required by the main method. 
		 * @param colorOneAlpha
		 * @param colorTwoAlpha
		 * @param inverted
		 * @return The gradient alphas array.
		 */</span>		
		<span style="color: #0033ff; font-weight: bold;">private</span> static <span style="color: #339966; font-weight: bold;">function</span> _createAlphasArray<span style="color: #000000;">&#40;</span> colorOneAlpha<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">uint</span>, 
						colorTwoAlpha<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">uint</span>, 
						inverted<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Boolean</span>=<span style="color: #0033ff; font-weight: bold;">false</span> <span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Array</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">alphas</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Array</span>;
			<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight: bold;">!</span>inverted<span style="color: #000000;">&#41;</span>
			<span style="color: #000000;">&#123;</span>
				<span style="color: #004993;">alphas</span> = <span style="color: #000000;">&#91;</span> colorOneAlpha, colorTwoAlpha <span style="color: #000000;">&#93;</span>; 
			<span style="color: #000000;">&#125;</span>
			<span style="color: #0033ff; font-weight: bold;">else</span>
			<span style="color: #000000;">&#123;</span>
				<span style="color: #004993;">alphas</span> = <span style="color: #000000;">&#91;</span> colorTwoAlpha, colorOneAlpha <span style="color: #000000;">&#93;</span>; 
			<span style="color: #000000;">&#125;</span>
			<span style="color: #0033ff; font-weight: bold;">return</span> <span style="color: #004993;">alphas</span>;
		<span style="color: #000000;">&#125;</span>
		<span style="color: #3f5fbf;">/**
		 * Creates the ratios array required by the main method. 
		 * @param colorOneRatio
		 * @param colorTwoRatio
		 * @param inverted
		 * @return The gradient ratios array.
		 */</span>		
		<span style="color: #0033ff; font-weight: bold;">private</span> static <span style="color: #339966; font-weight: bold;">function</span> _createRatiosArray<span style="color: #000000;">&#40;</span> colorOneRatio<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">uint</span>, 
						colorTwoRatio<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">uint</span>, 
						inverted<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Boolean</span>=<span style="color: #0033ff; font-weight: bold;">false</span> <span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Array</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">ratios</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Array</span>;
			<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight: bold;">!</span>inverted<span style="color: #000000;">&#41;</span>
			<span style="color: #000000;">&#123;</span>
				<span style="color: #004993;">ratios</span> = <span style="color: #000000;">&#91;</span> colorOneRatio, colorTwoRatio <span style="color: #000000;">&#93;</span>; 
			<span style="color: #000000;">&#125;</span>
			<span style="color: #0033ff; font-weight: bold;">else</span>
			<span style="color: #000000;">&#123;</span>
				<span style="color: #004993;">ratios</span> = <span style="color: #000000;">&#91;</span> colorTwoRatio, colorOneRatio <span style="color: #000000;">&#93;</span>; 
			<span style="color: #000000;">&#125;</span>
			<span style="color: #0033ff; font-weight: bold;">return</span> <span style="color: #004993;">ratios</span>;
		<span style="color: #000000;">&#125;</span>
	<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>Now, I can just issue the command like so:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #3f5fbf;">/**
 * Draws the gradient background for 
 * this component on initialize and resize.
 */</span>	
<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> _createGradientBackground<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
<span style="color: #000000;">&#123;</span>
<span style="color: #009900;">//	LinearGradientUtil.createGradientBackground( this, this.height, getStyle('cornerRadius'), 0xfdfeff, 0xe9e9e9 ); // changing color scheme</span>
<span style="color: #009900;">//	LinearGradientUtil.createGradientBackground( this ); // using the default color scheme</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>Less code + rich functionality = happy developer!!</p>
<p> <img src='http://technophi.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://technophi.com/2009/11/20/as3-lineargradientutil-class/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ZamfBrowser &#8211; ZendAMF Service Browser</title>
		<link>http://technophi.com/2009/11/13/zamfbrowser-zendamf-service-browser/</link>
		<comments>http://technophi.com/2009/11/13/zamfbrowser-zendamf-service-browser/#comments</comments>
		<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate>
		<dc:creator>Hasan Otuome</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[OSX Server]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[ZendAmf]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[<a href="http://www.zamfbrowser.org"><img src="http://www.zamfbrowser.org/images/zamfbrowser.png"/></a>
]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.zamfbrowser.org"><img src="http://www.zamfbrowser.org/images/zamfbrowser.png"/></a></p>
<p>One of my colleagues at <a href="http://almerblank.com"><b>Almer/Blank</b></a>, Omar Gonzalez, just released a very promising project into the open source community today, <a href="http://www.zamfbrowser.org/"><b>ZamfBrowser</b></a>. This AIR application is a lifeline for all the developers who have embraced <a href="http://framework.zend.com/manual/en/zend.amf.html"><b>ZendAMF</b></a> since its release yet have longed for that familiar service browser paradigm we grew used to with AMFPHP. Well, wait no longer. ZamfBrowser performs server introspection to give you access to your ZendAMF services and it even features test retention by remembering the last arguments used for method testing between sessions. This is definitely an application worth a look if you plan on doing any AMF development.</p>
]]></content:encoded>
			<wfw:commentRss>http://technophi.com/2009/11/13/zamfbrowser-zendamf-service-browser/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
