<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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>Comments on: How To Make an Image With Border</title>
	<atom:link href="http://www.flexer.info/2008/06/10/how-to-make-an-image-with-border/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.flexer.info/2008/06/10/how-to-make-an-image-with-border/</link>
	<description>flex developers web corner</description>
	<lastBuildDate>Wed, 18 Jan 2012 13:28:25 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Andrei Ionescu</title>
		<link>http://www.flexer.info/2008/06/10/how-to-make-an-image-with-border/comment-page-1/#comment-1882</link>
		<dc:creator>Andrei Ionescu</dc:creator>
		<pubDate>Fri, 07 May 2010 07:40:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.flexer.info/?p=201#comment-1882</guid>
		<description>Rick, thanks for comment! Did you see the next article in the series (&lt;a href=&quot;http://www.flexer.info/2008/06/12/continuing-image-with-border/&quot; rel=&quot;nofollow&quot;&gt;http://www.flexer.info/2008/06/12/continuing-image-with-border/&lt;/a&gt;)? Isn&#039;t it the same thing you wanted?
</description>
		<content:encoded><![CDATA[<p>Rick, thanks for comment! Did you see the next article in the series (<a href="http://www.flexer.info/2008/06/12/continuing-image-with-border/" rel="nofollow">http://www.flexer.info/2008/06/12/continuing-image-with-border/</a>)? Isn&#8217;t it the same thing you wanted?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rick Seeler</title>
		<link>http://www.flexer.info/2008/06/10/how-to-make-an-image-with-border/comment-page-1/#comment-1881</link>
		<dc:creator>Rick Seeler</dc:creator>
		<pubDate>Thu, 06 May 2010 15:42:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.flexer.info/?p=201#comment-1881</guid>
		<description>This post was a great help.  Thanks.
But, it doesn&#039;t deal with Images that have &lt;strong&gt;verticalAlign&lt;/strong&gt; or &lt;strong&gt;horizontalAlign&lt;/strong&gt; values set to anything other than their defaults.
I was able to fix the code by changing the call to the drawRect method to:
&lt;pre lang=&quot;actionscript&quot;&gt;graphics.drawRect(
    -getStyle(&#039;borderThickness&#039;) + contentX, 
    -getStyle(&#039;borderThickness&#039;) + contentY, ...&lt;/pre&gt;
Where contentX and contentY are:
&lt;pre lang=&quot;actionscript&quot;&gt;var contentX:Number = (w - contentWidth) * getHorizontalAlignValue();
var contentY:Number = (h - contentHeight) * getVerticalAlignValue();&lt;/pre&gt;
I had to make copies of the &lt;strong&gt;getHorizontalAlignValue()&lt;/strong&gt; and &lt;strong&gt;getVerticalAlignValue()&lt;/strong&gt; methods from the source of &lt;strong&gt;SWFLoader.as&lt;/strong&gt; as they are private.  I&#039;ll duplicate them here for completeness:
&lt;pre lang=&quot;actionscript&quot;&gt;protected function getHorizontalAlignValue():Number
{
    var horizontalAlign:String = getStyle(&quot;horizontalAlign&quot;);
				
    if (horizontalAlign == &quot;left&quot;)
        return 0;
    else if (horizontalAlign == &quot;right&quot;)
        return 1;
				
    // default = center
    return 0.5;
}

protected function getVerticalAlignValue():Number
{
    var verticalAlign:String = getStyle(&quot;verticalAlign&quot;);
			
    if (verticalAlign == &quot;top&quot;)
        return 0;
    else if (verticalAlign == &quot;bottom&quot;)
        return 1;
				
    // default = middle
    return 0.5;
}&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>This post was a great help.  Thanks.<br />
But, it doesn&#8217;t deal with Images that have <strong>verticalAlign</strong> or <strong>horizontalAlign</strong> values set to anything other than their defaults.<br />
I was able to fix the code by changing the call to the drawRect method to:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">graphics.<span style="color: #006600;">drawRect</span><span style="color: #66cc66;">&#40;</span>
    -<span style="color: #0066CC;">getStyle</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'borderThickness'</span><span style="color: #66cc66;">&#41;</span> + contentX, 
    -<span style="color: #0066CC;">getStyle</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'borderThickness'</span><span style="color: #66cc66;">&#41;</span> + contentY, ...</pre></div></div>

<p>Where contentX and contentY are:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> contentX:<span style="color: #0066CC;">Number</span> = <span style="color: #66cc66;">&#40;</span>w - contentWidth<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">*</span> getHorizontalAlignValue<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #000000; font-weight: bold;">var</span> contentY:<span style="color: #0066CC;">Number</span> = <span style="color: #66cc66;">&#40;</span>h - contentHeight<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">*</span> getVerticalAlignValue<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>I had to make copies of the <strong>getHorizontalAlignValue()</strong> and <strong>getVerticalAlignValue()</strong> methods from the source of <strong>SWFLoader.as</strong> as they are private.  I&#8217;ll duplicate them here for completeness:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">protected <span style="color: #000000; font-weight: bold;">function</span> getHorizontalAlignValue<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">Number</span>
<span style="color: #66cc66;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">var</span> horizontalAlign:<span style="color: #0066CC;">String</span> = <span style="color: #0066CC;">getStyle</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;horizontalAlign&quot;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
    <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>horizontalAlign == <span style="color: #ff0000;">&quot;left&quot;</span><span style="color: #66cc66;">&#41;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #cc66cc;">0</span>;
    <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>horizontalAlign == <span style="color: #ff0000;">&quot;right&quot;</span><span style="color: #66cc66;">&#41;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #cc66cc;">1</span>;
&nbsp;
    <span style="color: #808080; font-style: italic;">// default = center</span>
    <span style="color: #b1b100;">return</span> <span style="color: #cc66cc;">0.5</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
protected <span style="color: #000000; font-weight: bold;">function</span> getVerticalAlignValue<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">Number</span>
<span style="color: #66cc66;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">var</span> verticalAlign:<span style="color: #0066CC;">String</span> = <span style="color: #0066CC;">getStyle</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;verticalAlign&quot;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
    <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>verticalAlign == <span style="color: #ff0000;">&quot;top&quot;</span><span style="color: #66cc66;">&#41;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #cc66cc;">0</span>;
    <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>verticalAlign == <span style="color: #ff0000;">&quot;bottom&quot;</span><span style="color: #66cc66;">&#41;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #cc66cc;">1</span>;
&nbsp;
    <span style="color: #808080; font-style: italic;">// default = middle</span>
    <span style="color: #b1b100;">return</span> <span style="color: #cc66cc;">0.5</span>;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

]]></content:encoded>
	</item>
	<item>
		<title>By: qualle</title>
		<link>http://www.flexer.info/2008/06/10/how-to-make-an-image-with-border/comment-page-1/#comment-1657</link>
		<dc:creator>qualle</dc:creator>
		<pubDate>Mon, 13 Jul 2009 11:43:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.flexer.info/?p=201#comment-1657</guid>
		<description>Thanks! Great Script!</description>
		<content:encoded><![CDATA[<p>Thanks! Great Script!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: FLEX{er} &#187; Blog Archive &#187; Importing Image With Border in a Panel</title>
		<link>http://www.flexer.info/2008/06/10/how-to-make-an-image-with-border/comment-page-1/#comment-1057</link>
		<dc:creator>FLEX{er} &#187; Blog Archive &#187; Importing Image With Border in a Panel</dc:creator>
		<pubDate>Mon, 12 Jan 2009 09:04:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.flexer.info/?p=201#comment-1057</guid>
		<description>[...] of contentsHow To Make an Image With BorderContinuing Image With BorderImporting Image With Border in a [...]</description>
		<content:encoded><![CDATA[<div style="padding: 1em; background: #d3e1ef; /* border: dotted 1px #777777; */">
<p>[...] of contentsHow To Make an Image With BorderContinuing Image With BorderImporting Image With Border in a [...]</p>
</div>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrei Ionescu</title>
		<link>http://www.flexer.info/2008/06/10/how-to-make-an-image-with-border/comment-page-1/#comment-1056</link>
		<dc:creator>Andrei Ionescu</dc:creator>
		<pubDate>Mon, 12 Jan 2009 08:27:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.flexer.info/?p=201#comment-1056</guid>
		<description>Hello Mike! Thank for your interest in this component. The component in the &lt;a href=&quot;http://www.flexer.info/2008/06/12/continuing-image-with-border/&quot; rel=&quot;nofollow&quot;&gt;next article&lt;/a&gt; in this series is the complete one. I&#039;ll do an article showing how to use it in a panel.</description>
		<content:encoded><![CDATA[<p>Hello Mike! Thank for your interest in this component. The component in the <a href="http://www.flexer.info/2008/06/12/continuing-image-with-border/" rel="nofollow">next article</a> in this series is the complete one. I&#8217;ll do an article showing how to use it in a panel.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike</title>
		<link>http://www.flexer.info/2008/06/10/how-to-make-an-image-with-border/comment-page-1/#comment-1053</link>
		<dc:creator>Mike</dc:creator>
		<pubDate>Sun, 11 Jan 2009 20:22:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.flexer.info/?p=201#comment-1053</guid>
		<description>Hi,

Great tutorial, but...
I can&#039;t import this thing.
I mean: I want to import this (ImageBorder) component in an existing component (panel), which is implemented in the main program.
Any idea how to ?

Thx!</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>Great tutorial, but&#8230;<br />
I can&#8217;t import this thing.<br />
I mean: I want to import this (ImageBorder) component in an existing component (panel), which is implemented in the main program.<br />
Any idea how to ?</p>
<p>Thx!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dayg</title>
		<link>http://www.flexer.info/2008/06/10/how-to-make-an-image-with-border/comment-page-1/#comment-814</link>
		<dc:creator>dayg</dc:creator>
		<pubDate>Thu, 25 Sep 2008 06:26:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.flexer.info/?p=201#comment-814</guid>
		<description>I was looking for a way to add a border to the Image component and got to your post. However, I didn&#039;t want to write another component just to achieve this affect. In the end, I just placed my Image components inside a Box component with borders.

HTH.</description>
		<content:encoded><![CDATA[<p>I was looking for a way to add a border to the Image component and got to your post. However, I didn&#8217;t want to write another component just to achieve this affect. In the end, I just placed my Image components inside a Box component with borders.</p>
<p>HTH.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Justin Buser</title>
		<link>http://www.flexer.info/2008/06/10/how-to-make-an-image-with-border/comment-page-1/#comment-694</link>
		<dc:creator>Justin Buser</dc:creator>
		<pubDate>Sun, 31 Aug 2008 22:10:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.flexer.info/?p=201#comment-694</guid>
		<description>As with all my sample code that can be found on Adobe Livedocs I try to steer people in the right direction more than simply telling them how to do something. After all, the best way to learn something is to figure it out for yourself but with Flex sometimes it&#039;s better if you get a little push in the right direction.</description>
		<content:encoded><![CDATA[<p>As with all my sample code that can be found on Adobe Livedocs I try to steer people in the right direction more than simply telling them how to do something. After all, the best way to learn something is to figure it out for yourself but with Flex sometimes it&#8217;s better if you get a little push in the right direction.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: FLEX{er} &#187; Blog Archive &#187; Continuing Image With Border</title>
		<link>http://www.flexer.info/2008/06/10/how-to-make-an-image-with-border/comment-page-1/#comment-286</link>
		<dc:creator>FLEX{er} &#187; Blog Archive &#187; Continuing Image With Border</dc:creator>
		<pubDate>Thu, 12 Jun 2008 09:42:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.flexer.info/?p=201#comment-286</guid>
		<description>[...] &#171; How To Make an Image With Border [...]</description>
		<content:encoded><![CDATA[<div style="padding: 1em; background: #d3e1ef; /* border: dotted 1px #777777; */">
<p>[...] &laquo; How To Make an Image With Border [...]</p>
</div>
]]></content:encoded>
	</item>
</channel>
</rss>

