<?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/"
	>

<channel>
	<title>The Keunster Mash</title>
	<atom:link href="http://thekeunster.com/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://thekeunster.com</link>
	<description>Entrepreneur, IPhone Developer Extraordinaire, Adobe Flex Wizkid</description>
	<pubDate>Mon, 19 Dec 2011 23:42:35 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Something to keep in mind&#8230;</title>
		<link>http://thekeunster.com/?p=240</link>
		<comments>http://thekeunster.com/?p=240#comments</comments>
		<pubDate>Mon, 19 Dec 2011 23:42:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://thekeunster.com/?p=240</guid>
		<description><![CDATA[Something the to keep in mind with the slew of javascript frameworks out there in the wild. 
http://www.google.com/trends?q=jquery%2Cdojo%2Cmootools%2Cyui%2Cextjs&#038;ctab=0&#038;geo=all&#038;date=all&#038;sort=0
]]></description>
			<content:encoded><![CDATA[<p>Something the to keep in mind with the slew of javascript frameworks out there in the wild. </p>
<p>http://www.google.com/trends?q=jquery%2Cdojo%2Cmootools%2Cyui%2Cextjs&#038;ctab=0&#038;geo=all&#038;date=all&#038;sort=0</p>
]]></content:encoded>
			<wfw:commentRss>http://thekeunster.com/?feed=rss2&amp;p=240</wfw:commentRss>
		</item>
		<item>
		<title>QueueTip #006 - Persisting State w/ NSUserDefaults</title>
		<link>http://thekeunster.com/?p=204</link>
		<comments>http://thekeunster.com/?p=204#comments</comments>
		<pubDate>Sat, 21 Mar 2009 22:14:10 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[IPhone]]></category>

		<category><![CDATA[QueueTip]]></category>

		<guid isPermaLink="false">http://thekeunster.com/?p=204</guid>
		<description><![CDATA[Did you know&#8230;
You can persist application data using NSUserDefaults in your iPhone application? What are we referring to when we mention &#8220;persistence&#8221;? Basically, we mean that we&#8217;re going to allow your app to save data locally onto your iPhone and then later recall that saved data when your application requests that data. 
Here&#8217;s the pertinent [...]]]></description>
			<content:encoded><![CDATA[<p>Did you know&#8230;</p>
<p>You can persist application data using NSUserDefaults in your iPhone application? What are we referring to when we mention &#8220;persistence&#8221;? Basically, we mean that we&#8217;re going to allow your app to save data locally onto your iPhone and then later recall that saved data when your application requests that data. </p>
<p>Here&#8217;s the pertinent code you&#8217;ll need to familiarize self in order to use NSUserDefaults</p>
<p><script src="http://gist.github.com/82993.js"></script></p>
<p>These values are stored/recalled as key-value pairs. When you store a value using NSUserDefaults, you can recall a value even after shutting down and restarting an application. </p>
<p>This is one way of saving application related data, however, for data intensive applications, you may decide to offload that using sqlite or a combination of that and utilizing a backend service tier.  </p>
]]></content:encoded>
			<wfw:commentRss>http://thekeunster.com/?feed=rss2&amp;p=204</wfw:commentRss>
		</item>
		<item>
		<title>Protected: How To Create a Navigation-Based Application</title>
		<link>http://thekeunster.com/?p=117</link>
		<comments>http://thekeunster.com/?p=117#comments</comments>
		<pubDate>Tue, 10 Mar 2009 00:52:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[IPhone]]></category>

		<guid isPermaLink="false">http://weblogs.thekeunster.com/?p=117</guid>
		<description><![CDATA[There is no excerpt because this is a protected post.]]></description>
			<content:encoded><![CDATA[<form action="http://thekeunster.com/wp-pass.php" method="post">
<p>This post is password protected. To view it please enter your password below:</p>
<p><label for="pwbox-117">Password:<br />
<input name="post_password" id="pwbox-117" type="password" size="20" /></label><br />
<input type="submit" name="Submit" value="Submit" /></p></form>
]]></content:encoded>
			<wfw:commentRss>http://thekeunster.com/?feed=rss2&amp;p=117</wfw:commentRss>
		</item>
		<item>
		<title>QueueTip #005 - Color Channel Extraction : 24bit and 32bit Colors</title>
		<link>http://thekeunster.com/?p=111</link>
		<comments>http://thekeunster.com/?p=111#comments</comments>
		<pubDate>Sat, 17 Jan 2009 22:41:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Flex]]></category>

		<category><![CDATA[QueueTip]]></category>

		<category><![CDATA[Color Channels]]></category>

		<guid isPermaLink="false">http://weblogs.thekeunster.com/?p=111</guid>
		<description><![CDATA[Did you know&#8230;
You can extract the alpha, red, blue, and green channels of a hexadecimal color with simple bit shift and logical AND operations? Below are the operations to extract these channels from RGB and ARGB color formats.
RGB Channel Extraction - 24 bits
// 24 bit color
var color : uint = 0xff0000;

var R : Number = [...]]]></description>
			<content:encoded><![CDATA[<p>Did you know&#8230;</p>
<p>You can extract the alpha, red, blue, and green channels of a hexadecimal color with simple bit shift and logical AND operations? Below are the operations to extract these channels from RGB and ARGB color formats.</p>
<p><b>RGB Channel Extraction - 24 bits</b></p>
<pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"><code>// 24 bit color
var color : uint = 0xff0000;

var R : Number = color &gt;&gt; 16;
var G : Number = ( color &gt;&gt; 8 ) &amp; 0xff;
var B : Number = color &amp; 0xff;
</code></pre>
<p><b>ARBG Channel Extraction - 32 bits</b></p>
<pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"><code>// 32 bit color with alpha channel
var color : uint = 0xffc7c8c9;

var A : Number = ( color &gt;&gt; 24 ) &amp; 0xff;
var R : Number = ( color &gt;&gt; 16 ) &amp; 0xff;
var G : Number = ( color &gt;&gt; 8 ) &amp; 0xff;
var B : Number = color &amp; 0xff;
</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://thekeunster.com/?feed=rss2&amp;p=111</wfw:commentRss>
		</item>
		<item>
		<title>Show and Tell #001 - Animating Gradients in Adobe Flex</title>
		<link>http://thekeunster.com/?p=49</link>
		<comments>http://thekeunster.com/?p=49#comments</comments>
		<pubDate>Thu, 01 Jan 2009 13:22:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Flex]]></category>

		<category><![CDATA[Show and Tell]]></category>

		<category><![CDATA[Animated Gradients]]></category>

		<guid isPermaLink="false">http://weblogs.thekeunster.com/?p=49</guid>
		<description><![CDATA[Hello there! Welcome to our first exciting issue of Show and Tell!
First things first, I credit inspiration for the creation of this article to our fellow blogger of the community at www.somerandomdude.net ( google-cached link here). This particular article provided a great means for expediting the process of what I am currently working on. Before [...]]]></description>
			<content:encoded><![CDATA[<p>Hello there! Welcome to our first exciting issue of Show and Tell!</p>
<p>First things first, I credit inspiration for the creation of this article to our fellow blogger of the community at <a target="_blank" href="http://www.somerandomdude.net/blog/flash/actionscript-animating-gradient">www.somerandomdude.net</a> ( google-cached link <a target="_blank" href="http://74.125.45.132/search?q=cache:zQdGFrHggugJ:www.somerandomdude.net/blog/flash/actionscript-animating-gradient/+animating+gradient&#038;hl=en&#038;ct=clnk&#038;cd=1&#038;gl=us" >here</a>). This particular article provided a great means for expediting the process of what I am currently working on. Before stumbling upon this, I had thought at first to maybe tackle this as an Effect and EffectInstance class pair. However, the more I thought about this, it started to make more sense to me to create as a stand alone UIComponent. </p>
<p>In return, I&#8217;ve been meaning to do a &#8220;Show and Tell&#8221; for taking this Animated Gradient control a little further and so here it is ^_^ </p>
<p>Here are the following features that are offered in this package:</p>
<ul>
<li>Subclassed from UIComponent, hence you can choose to use directly in markup or via &#8220;AddChild&#8221;</li>
<li>Animate gradient fillColors</li>
<li>Animate gradient ratios</li>
<li>Animate gradient angles</li>
<li>Specify gradient attributes as style attributes and/or through a metadata class</li>
<li>Specify the number of tween frames to animate as &#8220;durationSteps&#8221;</li>
<p></ui></p>
<p><center><object width="350" height="300"><param name="movie" value="http://articles.thekeunster.com/animated-gradients/AnimatingGradients.swf"><embed src="http://articles.thekeunster.com/animated-gradients/AnimatingGradients.swf" width="350" height="300"></embed></object></center></p>
<p>Click <a href="http://articles.thekeunster.com/animated-gradients/AnimatingGradients.html" target="_blank">here</a> to open in a new window.<br />
Click <a href="http://articles.thekeunster.com/animated-gradients/srcview/index.html" target="_blank">here</a> to download the source code.</p>
<p>Here are few suggestions you might want to try this against:</p>
<ul>
<li>Use as part of an application&#8217;s background and trigger an animation on the gradient from a UI transition</li>
<li>Use as a mask for other controls. i.e. try simulating a metallic/shining effect over a Label for cool text effects</li>
<p></ui></p>
<p>If you have any questions and/or comments, by all means, please ask away in the comments section.</p>
<p>Cheers and Enjoy! </p>
]]></content:encoded>
			<wfw:commentRss>http://thekeunster.com/?feed=rss2&amp;p=49</wfw:commentRss>
		</item>
		<item>
		<title>&#8220;Show and Tell&#8221;</title>
		<link>http://thekeunster.com/?p=103</link>
		<comments>http://thekeunster.com/?p=103#comments</comments>
		<pubDate>Thu, 01 Jan 2009 08:31:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Flex]]></category>

		<category><![CDATA[Show and Tell]]></category>

		<guid isPermaLink="false">http://weblogs.thekeunster.com/?p=103</guid>
		<description><![CDATA[Back in the hey-days of childhood, I remember something in the classroom called &#8220;Show and Tell&#8221;. It&#8217;s a simple concept. I &#8220;show&#8221; you something of possible interest and &#8220;tell&#8221; you about it. Simple.
Here, &#8220;Show and Tell&#8221; is intended for the community and is presented to you in the form of an article focused around application [...]]]></description>
			<content:encoded><![CDATA[<p>Back in the hey-days of childhood, I remember something in the classroom called &#8220;Show and Tell&#8221;. It&#8217;s a simple concept. I &#8220;show&#8221; you something of possible interest and &#8220;tell&#8221; you about it. Simple.</p>
<p>Here, &#8220;Show and Tell&#8221; is intended for the community and is presented to you in the form of an article focused around application development. In each upcoming article, you can expect a bit more substance than what we get from our standard <a href="http://weblogs.thekeunster.com/?p=21">QueueTip</a>. Each article will be geared towards providing you with something that you may add to your own arsenal, at your own discretion, that is. </p>
<p>These are contributions to the community, and will ,in most cases, remain open source. Watch out for content coming this way soon.</p>
<p>Peace and a Happy New Year to all ^_^</p>
]]></content:encoded>
			<wfw:commentRss>http://thekeunster.com/?feed=rss2&amp;p=103</wfw:commentRss>
		</item>
		<item>
		<title>QueueTip #004 - Ranged Random Number Generation</title>
		<link>http://thekeunster.com/?p=43</link>
		<comments>http://thekeunster.com/?p=43#comments</comments>
		<pubDate>Mon, 29 Dec 2008 03:00:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Flex]]></category>

		<category><![CDATA[QueueTip]]></category>

		<category><![CDATA[random numbers]]></category>

		<guid isPermaLink="false">http://weblogs.thekeunster.com/?p=43</guid>
		<description><![CDATA[Did you know&#8230;
In one line of code in conjunction with the Math.random() method, you can generate a ranged random number as illustrated below:
Math.random() * ( max - min ) + min;

This will generate a random float between the values &#8220;min&#8221; and &#8220;max&#8221;
]]></description>
			<content:encoded><![CDATA[<p>Did you know&#8230;</p>
<p>In one line of code in conjunction with the Math.random() method, you can generate a ranged random number as illustrated below:</p>
<pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"><code>Math.random() * ( max - min ) + min;
</code></pre>
<p>This will generate a random float between the values &#8220;min&#8221; and &#8220;max&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://thekeunster.com/?feed=rss2&amp;p=43</wfw:commentRss>
		</item>
		<item>
		<title>QueueTip #003 - Programmatic Bindings</title>
		<link>http://thekeunster.com/?p=40</link>
		<comments>http://thekeunster.com/?p=40#comments</comments>
		<pubDate>Sat, 27 Dec 2008 01:09:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Flex]]></category>

		<category><![CDATA[QueueTip]]></category>

		<category><![CDATA[Binding]]></category>

		<category><![CDATA[BindingUtils]]></category>

		<category><![CDATA[ChangeWatcher]]></category>

		<guid isPermaLink="false">http://weblogs.thekeunster.com/?p=40</guid>
		<description><![CDATA[Did you know&#8230;
You can achieve binding programmatically with the &#8220;ChangeWatcher&#8221;? The following example illustrates various methods for achieving binding. 
The first method simply binds the labels text property to the text property of the text input. This is probably the most straightforward method for achieving binding. 
The second method binds via the ChangeWatcher. Using the [...]]]></description>
			<content:encoded><![CDATA[<p>Did you know&#8230;</p>
<p>You can achieve binding programmatically with the &#8220;ChangeWatcher&#8221;? The following example illustrates various methods for achieving binding. </p>
<p>The first method simply binds the labels text property to the text property of the text input. This is probably the most straightforward method for achieving binding. </p>
<p>The second method binds via the ChangeWatcher. Using the change watcher, you need to explicitly specify the target and target&#8217;s property that you want to bind on as well as the action that you&#8217;d like to take place in the form of an event handler. You achieve binding by calling the &#8220;watch&#8221; method of the ChangeWatcher. You can also choose to remove bindings by calling &#8220;unwatch&#8221;. For this example, we could&#8217;ve utilized the TextInputs &#8220;change&#8221; event to establish the same intent.</p>
<p>The third method binds via the BindingUtils facility, which is available right out of the box. BindingUtils essentially utilizes the ChangeWatcher under the hood to achieve binding. If you look at the return value of the method &#8220;bindProperty&#8221; on BindingUtils, you&#8217;ll see that it&#8217;s return type is of a ChangeWatcher. </p>
<pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;mx:Application xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot; layout=&quot;absolute&quot; creationComplete=&quot;{ onCreationComplete( event ) }&quot;&gt;
    &lt;mx:Script&gt;
        &lt;![CDATA[
            import mx.binding.utils.BindingUtils;
            import mx.binding.utils.ChangeWatcher;

            private function onCreationComplete( event : Event ) : void
            {
                // utilizing the watch method of the ChangeWatcher to illustrate programmatic binding
                ChangeWatcher.watch( txtInput2, &quot;text&quot;, onInputChange );

                // utilizing the bindProperty method of the BindingUtils facility to illustration binding
                // if you look at the return type of &quot;bindProperty&quot;, you'll see that it also returns an
                // instance of a ChangeWatcher
                BindingUtils.bindProperty( lblBinding3, &quot;text&quot;, txtInput3, &quot;text&quot; );

                // Notes: if you want to unbind on the ChangeWatcher, utilize the &quot;unwatch&quot; method of the ChangeWatcher
            }

            private function onInputChange( event : Event ) : void
            {
                var txtInputTarget : TextInput = event.currentTarget as TextInput;
                lblBinding2.text = txtInputTarget.text;
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:VBox left=&quot;10&quot; right=&quot;10&quot; bottom=&quot;10&quot; top=&quot;10&quot;&gt;
        &lt;mx:Form&gt;
            &lt;mx:FormHeading label=&quot;Non Programmatic Binding&quot; /&gt;
            &lt;mx:FormItem label=&quot;Input:&quot;&gt;
                &lt;mx:TextInput id=&quot;txtInput1&quot; /&gt;
            &lt;/mx:FormItem&gt;
            &lt;mx:FormItem label=&quot;Binding On Text:&quot;&gt;
                &lt;mx:Label id=&quot;lblBinding1&quot; text=&quot;{ txtInput1.text }&quot; /&gt;
            &lt;/mx:FormItem&gt;
        &lt;/mx:Form&gt;
        &lt;mx:Form&gt;
            &lt;mx:FormHeading label=&quot;Programmatic Binding via Change Watcher&quot; /&gt;
            &lt;mx:FormItem label=&quot;Input:&quot;&gt;
                &lt;mx:TextInput id=&quot;txtInput2&quot; /&gt;
            &lt;/mx:FormItem&gt;
            &lt;mx:FormItem label=&quot;Binding On Text:&quot;&gt;
                &lt;mx:Label id=&quot;lblBinding2&quot; /&gt;
            &lt;/mx:FormItem&gt;
        &lt;/mx:Form&gt;
        &lt;mx:Form&gt;
            &lt;mx:FormHeading label=&quot;Programmatic Binding via BindingUtils.bindProperty()&quot; /&gt;
            &lt;mx:FormItem label=&quot;Input:&quot;&gt;
                &lt;mx:TextInput id=&quot;txtInput3&quot; /&gt;
            &lt;/mx:FormItem&gt;
            &lt;mx:FormItem label=&quot;Binding On Text:&quot;&gt;
                &lt;mx:Label id=&quot;lblBinding3&quot; /&gt;
            &lt;/mx:FormItem&gt;
        &lt;/mx:Form&gt;
    &lt;/mx:VBox&gt;
&lt;/mx:Application&gt;

</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://thekeunster.com/?feed=rss2&amp;p=40</wfw:commentRss>
		</item>
		<item>
		<title>QueueTip #002 - Weak References and Cleanup Strategies</title>
		<link>http://thekeunster.com/?p=32</link>
		<comments>http://thekeunster.com/?p=32#comments</comments>
		<pubDate>Fri, 26 Dec 2008 23:48:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Flex]]></category>

		<category><![CDATA[QueueTip]]></category>

		<category><![CDATA[memory management]]></category>

		<category><![CDATA[weak references]]></category>

		<guid isPermaLink="false">http://weblogs.thekeunster.com/?p=32</guid>
		<description><![CDATA[Did you know&#8230;
Event listeners and Dictionary&#8217;s support weak referencing facilities in Actionscript 3.0? Why the need for weak referencing? 

potential performance gains
promote best practices in application cleanup strategies ( i.e. prevent memory leaks )

Utilizing weak references does not necessarily mean that your application will be free from memory leaks. You, as the developer, are still [...]]]></description>
			<content:encoded><![CDATA[<p>Did you know&#8230;</p>
<p>Event listeners and Dictionary&#8217;s support weak referencing facilities in Actionscript 3.0? Why the need for weak referencing? </p>
<ul>
<li>potential performance gains</li>
<li>promote best practices in application cleanup strategies ( i.e. prevent memory leaks )</li>
</ul>
<p>Utilizing weak references does not necessarily mean that your application will be free from memory leaks. You, as the developer, are still in charge of cleanup tasks. Weak referencing, merely promotes objects to be garbage collected, when all references to that object no longer exist. As long as the objects in your code still maintain an object reference, the memory lifespan of that object will continue to persist in your application. So it is still up to you to make sure the preparations for cleanup are there and have been acted upon. Think of it as putting the trash outside on the curb for the garbage-men to pick up ( it&#8217;s not going to get picked up if you don&#8217;t put in the work to set it aside for the pickup ) ^_^</p>
<p>Strategies which supplement good clean up tasks:</p>
<ul>
<li>set the &#8220;weakReference&#8221; flag on addEventListener to &#8220;true&#8221;</li>
<li>use &#8220;removeEventListener&#8221; if you are finished using an event callback and don&#8217;t plan on using it again. This means, that you also need to keep track of when of when utilize &#8220;addEventListener&#8221;. Utilize event targeting or some other means of getting a reference back to the event target so you can safely remove an even listener and do any necessary object cleanup. I generally refer to this as &#8220;targeting&#8221; when utilizing events</li>
<li>make use of the &#8220;delete&#8221; keyword</li>
<li>if you using a Dictionary ADT ( abstract data type ), make use of the weak reference parameter found in the constructor of the Dictionary. It is set to &#8220;false&#8221; by default. Set it to &#8220;true&#8221;</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://thekeunster.com/?feed=rss2&amp;p=32</wfw:commentRss>
		</item>
		<item>
		<title>QueueTip #001 - Dynamically Changing Style Attributes</title>
		<link>http://thekeunster.com/?p=13</link>
		<comments>http://thekeunster.com/?p=13#comments</comments>
		<pubDate>Thu, 25 Dec 2008 12:10:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Flex]]></category>

		<category><![CDATA[QueueTip]]></category>

		<category><![CDATA[Dynamic Styles]]></category>

		<guid isPermaLink="false">http://weblogs.thekeunster.com/?p=13</guid>
		<description><![CDATA[Did you know&#8230;
You can dynamically change a display elements style and attributes by utilizing custom style tags in conjunction with the setStyle/GetStyle methods of the component to which the style is applied to? Let&#8217;s walk through a simple example to illustrate.
A simple gradient border skin as illustrated below.
package com.thekeunster.skins
{
    import flash.display.Graphics;
  [...]]]></description>
			<content:encoded><![CDATA[<p>Did you know&#8230;</p>
<p>You can dynamically change a display elements style and attributes by utilizing custom style tags in conjunction with the setStyle/GetStyle methods of the component to which the style is applied to? Let&#8217;s walk through a simple example to illustrate.</p>
<p>A simple gradient border skin as illustrated below.</p>
<pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"><code>package com.thekeunster.skins
{
    import flash.display.Graphics;
    import flash.geom.Matrix;

    import mx.core.EdgeMetrics;
    import mx.skins.halo.HaloBorder;

    [Style(name=&quot;fillColors&quot;, type=&quot;Array&quot;, inherit=&quot;no&quot;)]

    public class SimpleGradientSkin extends HaloBorder
    {
        private var fillColors:Array;

        override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
        {
            super.updateDisplayList(unscaledWidth, unscaledHeight);    

            fillColors = getStyle(&quot;fillColors&quot;) as Array;
            if (!fillColors) fillColors = [0xFFFFFF, 0xFFFFFF];            

            var g:Graphics = graphics;
            var b:EdgeMetrics = borderMetrics;
            var w:Number = unscaledWidth - b.left - b.right;
            var h:Number = unscaledHeight - b.top - b.bottom;
            var m:Matrix = verticalGradientMatrix(0, 0, w, h);

            g.clear();
            g.beginGradientFill(&quot;linear&quot;, fillColors, [1, 1], [0, 255], m);
            g.drawRect(0,0,w,h);
            g.endFill();
        }
    }
}
</code></pre>
<p>Then applying that border skin to a canvas, as illustrated below. W/in the &#8220;switchGradient&#8221; method, you&#8217;ll notice that we&#8217;re switching out the gradient&#8217;s fillColors dynamically via &#8220;setStyle&#8221;. In the borderSkin, we reference the fill colors via &#8220;getStyle&#8221;.</p>
<pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;mx:Application xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot; layout=&quot;absolute&quot;&gt;
    &lt;mx:Style&gt;
        .simpleBorderSkin
        {
            fillColors : #ff0000, #0000ff;
            borderSkin : ClassReference('com.thekeunster.skins.SimpleGradientSkin');
        }
    &lt;/mx:Style&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            private function switchGradient( event : Event ) : void
            {
                // dynamically switch the border skins gradient fillColor with random color values
                content.setStyle( &quot;fillColors&quot;, [ Math.random() * 0xff0000, Math.random() * 0x00ff00 ] );
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:Button label=&quot;Switch Gradient&quot; click=&quot;{ switchGradient( event ) }&quot; /&gt;
    &lt;mx:Canvas styleName=&quot;simpleBorderSkin&quot; id=&quot;content&quot; left=&quot;30&quot; right=&quot;30&quot; bottom=&quot;30&quot; top=&quot;30&quot; /&gt;

&lt;/mx:Application&gt;
</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://thekeunster.com/?feed=rss2&amp;p=13</wfw:commentRss>
		</item>
	</channel>
</rss>

