<?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>@Diacre &#187; flash player</title>
	<atom:link href="http://ducharme.cc/tag/flash-player/feed/" rel="self" type="application/rss+xml" />
	<link>http://ducharme.cc</link>
	<description>father, francophile, former pro wrestler, improvisational comedian, coder and all around good guy ;)</description>
	<lastBuildDate>Sun, 06 May 2012 19:26:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>Setting up Resource Bundles</title>
		<link>http://ducharme.cc/setting-up-resource-bundles/</link>
		<comments>http://ducharme.cc/setting-up-resource-bundles/#comments</comments>
		<pubDate>Fri, 13 Jan 2012 08:01:32 +0000</pubDate>
		<dc:creator>Deacon</dc:creator>
				<category><![CDATA[Flash Friday]]></category>
		<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[flash player]]></category>
		<category><![CDATA[localization]]></category>
		<category><![CDATA[resource bundles]]></category>

		<guid isPermaLink="false">http://ducharme.cc/?p=789</guid>
		<description><![CDATA[<a href="http://ducharme.cc/wp-content/uploads/2012/01/rollsOfCoins.jpg"><img src="http://ducharme.cc/wp-content/uploads/2012/01/rollsOfCoins-150x150.jpg" alt="" title="rollsOfCoins" width="150" height="150" class="alignleft size-thumbnail wp-image-803" /></a>In <a href="/?p=745">last week's Flash Friday post</a> I wrote about using resource bundles to handle embedded fonts. I also left out any instructions about how to set up your project to use resource bundles, instead telling the reader to search the interwebs. I also said I would provide one of my own instructions so here it is.]]></description>
			<content:encoded><![CDATA[<p><a href="http://ducharme.cc/wp-content/uploads/2012/01/rollsOfCoins.jpg"><img src="http://ducharme.cc/wp-content/uploads/2012/01/rollsOfCoins-150x150.jpg" alt="" title="rollsOfCoins" width="150" height="150" class="alignleft size-thumbnail wp-image-803" /></a>In <a href="http://ducharme.cc/?p=745">last week&#8217;s Flash Friday post</a> I wrote about using resource bundles to handle embedded fonts. I also left out any instructions about how to set up your project to use resource bundles, instead telling the reader to search the interwebs. I also said I would provide one of my own instructions so here it is.</p>
<h2>Project Setup</h2>
<p>Your project needs to be able to find your resource bundles so they need to live in your source path. You could place the bundles in the same folder as your source code, but I find that feels a little disorganized. Instead create a folder for your resource bundles and add it to your source path.</p>
<p>In other tutorials they talk about using resource bundles for localization. If that is the case you can add the files as follows. I&#8217;ll assume you are using the <i>en_US</i> locale, otherwise replace all instances of <i>en_US</i> with the locale you are using.</p>
<ol>
<li>create folder path in your project of: <i>locale\en_US</i></li>
<li>add the source folder <i>locale\{locale}</i></li>
<li>add the following to your compiler arguments: <i>-locale=en_US</i></li>
</ol>
<p>Now you can place your resource bundles in the <i>locale\en_US</i> folder.</p>
<h2>Property Files</h2>
<p>Resource bundles are sometimes referred to as property files because you create them in files with a <i>.properties</i> extenstion. The part before the extension is the bundle name, and you would use that to get the information you wanted. For example, you you had a bundle named <i>fonts</i> you would create a file called <i>fonts.properties</i>. If you were paying attention to <a href="http://ducharme.cc/?p=745">my previous article</a> you probably saw me use this same bundle name.</p>
<h3>Inside the property file</h3>
<p>The property file is fairly simple. It is just a key/value pair separated by an equal sign(=). A simple resource bundle that stores text strings might be called <i>text.properties</i> and look like the following.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"># <span style="color: #004993;">text</span><span style="color: #000066; font-weight: bold;">.</span>properties
&nbsp;
hello=Hello World<span style="color: #000066; font-weight: bold;">!</span>
goodbye=Good<span style="color: #000066; font-weight: bold;">-</span>bye cruel world<span style="color: #000066; font-weight: bold;">!</span></pre></div></div>

<p>You can look back at my font embedding article to see how I embedded fonts. You can use the same method to embed anything that you can embed using the <i>Embed</i> metatag.</p>
<h3>Using the properties in the file</h3>
<p>The first thing you need to do is add the <i>Resource Bundle</i> metatag somewhere in your project. You only need to use it once per project for every bundle you are going to use. However, once you do this it gets compiled into the project, even if you don&#8217;t use the resources. So I would recommend using it in the class(es) that use(s) the bundle.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;">	<span style="color: #000000;">&#91;</span>ResourceBundle<span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;fonts&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
	<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> MyFontsBundleUsingClass <span style="color: #000000;">&#123;</span>
		<span style="color: #000066; font-weight: bold;">...</span></pre></div></div>

<p>Then to use the resources you just need to get an instance of the ResourceManager use one of its functions to get the resource. Here is an example for grabbing a String from my text.properties file I created earlier.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;">	<span style="color: #6699cc; font-weight: bold;">var</span> resources<span style="color: #000066; font-weight: bold;">:</span>IResourceManager = ResourceManager<span style="color: #000066; font-weight: bold;">.</span>getInstance<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
	<span style="color: #6699cc; font-weight: bold;">var</span> hello<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">String</span> = resources<span style="color: #000066; font-weight: bold;">.</span>getString<span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;text&quot;</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #990000;">&quot;hello&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
	<span style="color: #6699cc; font-weight: bold;">var</span> goodbye<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">String</span> = resources<span style="color: #000066; font-weight: bold;">.</span>getString<span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;text&quot;</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #990000;">&quot;goodbye&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></pre></div></div>

<ul>Of course you can get more than just strings from a property file. Just choose from the following list of functions in the <i>IResourceManager</i> interface.</p>
<li>getString</li>
<li>getBoolean</li>
<li>getInt</li>
<li>getUint</li>
<li>getNumber</li>
<li>getStringArray</li>
<li>getClass</li>
<li>getObject</li>
</ul>
<p>And that is my basic primer on using ResourceBundles in actionscript projects. In the grand tradition of this line of posts I am leaving out many important bits of information. Loading resource bundles at runtime is one of them. I&#8217;ll leave that as a web search exercise for the reader until I write an article on that in the future. If there are other bits of information you would like clarity on let me know in the comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://ducharme.cc/setting-up-resource-bundles/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>wmode:gpu not a magic bullet</title>
		<link>http://ducharme.cc/wmode-gpu-not-magic-bullet/</link>
		<comments>http://ducharme.cc/wmode-gpu-not-magic-bullet/#comments</comments>
		<pubDate>Fri, 25 Dec 2009 10:00:14 +0000</pubDate>
		<dc:creator>Deacon</dc:creator>
				<category><![CDATA[Flash Friday]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[flash player]]></category>

		<guid isPermaLink="false">http://ducharme.cc/?p=328</guid>
		<description><![CDATA[At my current work, Provis Media Group, we do a lot of video for the web. We&#8217;ve had a lot of success with larger format video than is usually delivered via the internet. When Flash Player™ 9.0.115 came out allowing fullscreen h.264 video delivery things really took off. Quality went way up and we were [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft" title="Flash Player" src="http://t1.gstatic.com/images?q=tbn:y7Zh9ssPGeh5pM:http://www.photoshopfiles.com/photoshop_files/689/preview.png" alt="" width="130" height="130" />At my current work, <a href="http://provismedia.com" target="_blank">Provis Media Group</a>, we do a lot of video for the web. We&#8217;ve had a lot of success with larger format video than is usually delivered via the internet. When Flash Player™ 9.0.115 came out allowing fullscreen h.264 video delivery things really took off. Quality went way up and we were able to deliver 720p+ content over the internet. In full screen it looked great. However, when we shrunk a video smaller than its true size some artifacting would occur. Really, it wasn&#8217;t that terrible but we pride ourselves on the quality of video we deliver, especially since most of it is done in house.</p>
<p>When flash player 10 came out we noticed 2 new wmodes, direct and gpu. Both were suppose to affect drawing performance on the screen and we thought gpu mode should improve the quality of our videos. In order to be sure we had to test it and compare it to the default mode that we almost always use.</p>
<p>Test after test proved that there really wasn&#8217;t any noticeable difference. In fact, wmode=gpu didn&#8217;t provide any noticeable playback difference but it did affect the player.<br />
[ad#Adobe Banner]<br />
The more we read, the more it sounded like wmode=gpu really wouldn&#8217;t do much for most people until Flash Player™ 10.1 ( currently in beta 2 version on <a href="http://labs.adobe.com" target="_blank">Adobe labs</a> ). Installing Flash Player 10.1 did improve performance on the CPU ( which is awesome ) but their still wasn&#8217;t a difference from the default.</p>
<p>In the end the best thing to do with our video was to turn smoothing on. This actually made a dramatic improvement. In Flash Player 10.1 you get enough of a performance increase to make this work on even slower computers than before.</p>
<p>So wmode=gpu still may not be a magic bullet unless you control the playback platform but turning on smoothing gives you good performance if you are having artifacting when your videos get resized. You still need to be concerned about cpu performance ( for now ) but flash player 10.1 will really improve that.</p>
<p>If you have had different results or even the same, I&#8217;d love to hear your experiences. If you celebrate Christmas today then Merry Christmas and to everyone Seasons&#8217; Greetings and Happy Holidays.</p>
]]></content:encoded>
			<wfw:commentRss>http://ducharme.cc/wmode-gpu-not-magic-bullet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

