<?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: Image smoothing in Flex</title>
	<atom:link href="https://www.craftymind.com/image-smoothing-in-flex/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.craftymind.com/image-smoothing-in-flex/</link>
	<description>Hacking away at UI development</description>
	<lastBuildDate>Tue, 14 Oct 2014 06:31:19 +0000</lastBuildDate>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.0.38</generator>
	<item>
		<title>By: Alex K</title>
		<link>https://www.craftymind.com/image-smoothing-in-flex/comment-page-1/#comment-23291</link>
		<dc:creator><![CDATA[Alex K]]></dc:creator>
		<pubDate>Thu, 22 Sep 2011 20:04:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.craftymind.com/?p=13#comment-23291</guid>
		<description><![CDATA[I&#039;ve used this approach for a while now, but just discovered that it will throw security errors if the image being loaded is coming from a different domain than the SWF. A typical error is:

SecurityError: Error #2122: Security sandbox violation: Loader.content: [SWF_LOCATION] cannot access [IMAGE_LOCATION]. A policy file is required, but the checkPolicyFile flag was not set when this media was loaded.

A simple solution is to wrap the conditional statement inside of a try...catch block:

			try {
				if (this.content is Bitmap) {
					
					var bitmap:Bitmap = Bitmap(this.content);
					
					if (bitmap &amp;&amp; !bitmap.smoothing) {
						bitmap.smoothing = true;
					}
					
				}
			}
			catch (error:Error) {
				//Alert.show(error.toString());
			}

This way if it runs into a security error, it will simply revert to loading the image without smoothing.]]></description>
		<content:encoded><![CDATA[<p>I&#8217;ve used this approach for a while now, but just discovered that it will throw security errors if the image being loaded is coming from a different domain than the SWF. A typical error is:</p>
<p>SecurityError: Error #2122: Security sandbox violation: Loader.content: [SWF_LOCATION] cannot access [IMAGE_LOCATION]. A policy file is required, but the checkPolicyFile flag was not set when this media was loaded.</p>
<p>A simple solution is to wrap the conditional statement inside of a try&#8230;catch block:</p>
<p>			try {<br />
				if (this.content is Bitmap) {</p>
<p>					var bitmap:Bitmap = Bitmap(this.content);</p>
<p>					if (bitmap &amp;&amp; !bitmap.smoothing) {<br />
						bitmap.smoothing = true;<br />
					}</p>
<p>				}<br />
			}<br />
			catch (error:Error) {<br />
				//Alert.show(error.toString());<br />
			}</p>
<p>This way if it runs into a security error, it will simply revert to loading the image without smoothing.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tatva99</title>
		<link>https://www.craftymind.com/image-smoothing-in-flex/comment-page-1/#comment-23258</link>
		<dc:creator><![CDATA[Tatva99]]></dc:creator>
		<pubDate>Thu, 08 Sep 2011 06:18:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.craftymind.com/?p=13#comment-23258</guid>
		<description><![CDATA[Very good.Nice example]]></description>
		<content:encoded><![CDATA[<p>Very good.Nice example</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: camden_kid</title>
		<link>https://www.craftymind.com/image-smoothing-in-flex/comment-page-1/#comment-22283</link>
		<dc:creator><![CDATA[camden_kid]]></dc:creator>
		<pubDate>Wed, 25 Aug 2010 20:18:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.craftymind.com/?p=13#comment-22283</guid>
		<description><![CDATA[Very good. Thanks.]]></description>
		<content:encoded><![CDATA[<p>Very good. Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tyrone Neill</title>
		<link>https://www.craftymind.com/image-smoothing-in-flex/comment-page-1/#comment-21467</link>
		<dc:creator><![CDATA[Tyrone Neill]]></dc:creator>
		<pubDate>Fri, 09 Apr 2010 08:07:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.craftymind.com/?p=13#comment-21467</guid>
		<description><![CDATA[Why are we smoothing on updatedisplaylist? this would cause smoothing to constantly be applied if the image is moved?]]></description>
		<content:encoded><![CDATA[<p>Why are we smoothing on updatedisplaylist? this would cause smoothing to constantly be applied if the image is moved?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Francisc</title>
		<link>https://www.craftymind.com/image-smoothing-in-flex/comment-page-1/#comment-20001</link>
		<dc:creator><![CDATA[Francisc]]></dc:creator>
		<pubDate>Wed, 24 Feb 2010 22:20:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.craftymind.com/?p=13#comment-20001</guid>
		<description><![CDATA[Thank you! Great component and just in time too!]]></description>
		<content:encoded><![CDATA[<p>Thank you! Great component and just in time too!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Maria</title>
		<link>https://www.craftymind.com/image-smoothing-in-flex/comment-page-1/#comment-14018</link>
		<dc:creator><![CDATA[Maria]]></dc:creator>
		<pubDate>Thu, 02 Jul 2009 17:55:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.craftymind.com/?p=13#comment-14018</guid>
		<description><![CDATA[This code worked fine for me to make images look smooth. I just wanted some of my imgages to implement this not all .Check it here :
&lt;a href=&#039;http://askmeflash.com/article_m.php?p=article&amp;id=4&#039; rel=&quot;nofollow&quot;&gt;http://askmeflash.com/article_m.php?p=article&amp;id=4&lt;/a&gt;]]></description>
		<content:encoded><![CDATA[<p>This code worked fine for me to make images look smooth. I just wanted some of my imgages to implement this not all .Check it here :<br />
<a href='http://askmeflash.com/article_m.php?p=article&amp;id=4' rel="nofollow">http://askmeflash.com/article_m.php?p=article&#038;id=4</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chetan Sachdev</title>
		<link>https://www.craftymind.com/image-smoothing-in-flex/comment-page-1/#comment-2521</link>
		<dc:creator><![CDATA[Chetan Sachdev]]></dc:creator>
		<pubDate>Sat, 02 Aug 2008 17:52:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.craftymind.com/?p=13#comment-2521</guid>
		<description><![CDATA[Very nice example..

Thanks]]></description>
		<content:encoded><![CDATA[<p>Very nice example..</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lance</title>
		<link>https://www.craftymind.com/image-smoothing-in-flex/comment-page-1/#comment-949</link>
		<dc:creator><![CDATA[Lance]]></dc:creator>
		<pubDate>Fri, 13 Jun 2008 19:27:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.craftymind.com/?p=13#comment-949</guid>
		<description><![CDATA[How would this work with an image that is being defined in the CSS file? 

This is great BTW -- something I as a designer first, seriously need to bring my artwork into flex!

Thanks]]></description>
		<content:encoded><![CDATA[<p>How would this work with an image that is being defined in the CSS file? </p>
<p>This is great BTW &#8212; something I as a designer first, seriously need to bring my artwork into flex!</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Fedlarm</title>
		<link>https://www.craftymind.com/image-smoothing-in-flex/comment-page-1/#comment-350</link>
		<dc:creator><![CDATA[Fedlarm]]></dc:creator>
		<pubDate>Fri, 09 May 2008 13:09:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.craftymind.com/?p=13#comment-350</guid>
		<description><![CDATA[very cool:)

Here is it as a class:

package ipaper.framework
{
	import mx.controls.Image;
	import flash.display.Bitmap;
	
	public class SmoothImage extends Image
	{
		override protected function updateDisplayList(unscaledWidth:Number,unscaledHeight:Number):void
		{
			super.updateDisplayList(unscaledWidth, unscaledHeight);
			if(content is Bitmap)
			{
				var bmp:Bitmap = Bitmap(content);
				if(bmp &amp;&amp; bmp.smoothing == false)
					bmp.smoothing = true;
			}
		}
	}
}]]></description>
		<content:encoded><![CDATA[<p>very cool:)</p>
<p>Here is it as a class:</p>
<p>package ipaper.framework<br />
{<br />
	import mx.controls.Image;<br />
	import flash.display.Bitmap;</p>
<p>	public class SmoothImage extends Image<br />
	{<br />
		override protected function updateDisplayList(unscaledWidth:Number,unscaledHeight:Number):void<br />
		{<br />
			super.updateDisplayList(unscaledWidth, unscaledHeight);<br />
			if(content is Bitmap)<br />
			{<br />
				var bmp:Bitmap = Bitmap(content);<br />
				if(bmp &amp;&amp; bmp.smoothing == false)<br />
					bmp.smoothing = true;<br />
			}<br />
		}<br />
	}<br />
}</p>
]]></content:encoded>
	</item>
</channel>
</rss>
