<?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>Flassari.is &#187; Flash</title>
	<atom:link href="http://flassari.is/tag/flash/feed/" rel="self" type="application/rss+xml" />
	<link>http://flassari.is</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Mon, 19 Jul 2010 16:09:38 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Global error handling with Flash Player 10.1</title>
		<link>http://flassari.is/2010/06/global-error-handling-with-flash-player-10-1/</link>
		<comments>http://flassari.is/2010/06/global-error-handling-with-flash-player-10-1/#comments</comments>
		<pubDate>Wed, 23 Jun 2010 12:25:44 +0000</pubDate>
		<dc:creator>Flassari</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[10.1]]></category>
		<category><![CDATA[4.1]]></category>
		<category><![CDATA[as]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[exception]]></category>
		<category><![CDATA[global]]></category>
		<category><![CDATA[handler]]></category>
		<category><![CDATA[handling]]></category>
		<category><![CDATA[player]]></category>
		<category><![CDATA[SDK]]></category>
		<category><![CDATA[uncaught]]></category>
		<category><![CDATA[uncaughtError]]></category>
		<category><![CDATA[uncaughterrorhandler]]></category>

		<guid isPermaLink="false">http://flassari.is/?p=303</guid>
		<description><![CDATA[Since the official release of Flash Player 10.1 is out, now might be a good time to start implementing the global error handler.

When this is written, flash builder 4 doesn't have a native way that lets you use it, so we have to do a little mix.
The global error handler works by adding an event to the uncaughtErrorEvents property of the loaderInfo of the application.
There are currently two methods of getting it to work [...]]]></description>
			<content:encoded><![CDATA[<p>Since the official release of Flash Player 10.1 is out, now might be a good time to start implementing the global error handler.</p>
<p>When this is written, flash builder 4 doesn&#8217;t have a native way that lets you use it, so we have to do a little mix.<strong> (Update: The update is out.)</strong><br />
The global error handler works by adding an event to the uncaughtErrorEvents property of the loaderInfo of the application.<br />
There are currently two methods of getting it to work.</p>
<h3>Method 1 - The backwards compatible one:</h3>
<p>Here the code doesn&#8217;t crash in flash player 9/10, but the error handling will only work in 10.1.</p>
<pre class="brush: as3">if(loaderInfo.hasOwnProperty("uncaughtErrorEvents")){
	IEventDispatcher(loaderInfo["uncaughtErrorEvents"]) .addEventListener("uncaughtError", uncaughtErrorHandler);
}</pre>
<pre class="brush: as3">private function uncaughtErrorHandler(e:Event):void {
	trace("Global error:", e);
}</pre>
<h3>Method 2 - The type safe one:</h3>
<p>Get the <a href="http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4">Flex 4.1 SDK</a> if you haven&#8217;t already and choose that one as your project&#8217;s SDK.</p>
<p>Now you can use the new global error handling like it was meant to be used:</p>
<pre class="brush: as3">import flash.events.UncaughtErrorEvent;

loaderInfo.uncaughtErrorEvents.addEventListener( UncaughtErrorEvent.UNCAUGHT_ERROR, uncaughtErrorHandler);

private function uncaughtErrorHandler( e:UncaughtErrorEvent):void {
	trace("Global error:", e);
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://flassari.is/2010/06/global-error-handling-with-flash-player-10-1/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Flv and f4v files not found on IIS</title>
		<link>http://flassari.is/2010/05/flv-and-f4v-files-not-found-on-iis/</link>
		<comments>http://flassari.is/2010/05/flv-and-f4v-files-not-found-on-iis/#comments</comments>
		<pubDate>Wed, 05 May 2010 11:51:39 +0000</pubDate>
		<dc:creator>Flassari</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[404]]></category>
		<category><![CDATA[f4v]]></category>
		<category><![CDATA[flv]]></category>
		<category><![CDATA[IIS]]></category>
		<category><![CDATA[MIME]]></category>
		<category><![CDATA[not found]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[type]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://flassari.is/?p=291</guid>
		<description><![CDATA[If your IIS server throws a "404 not found" page every time you try to fetch a flash video file (flv or f4v), your server might be missing the MIME type declaration.
In the Internet Information Services Manager [...]]]></description>
			<content:encoded><![CDATA[<p>If your IIS server throws a &#8220;404 not found&#8221; page every time you try to fetch a flash video file (flv or f4v), your server might be missing the MIME type declaration.<br />
In the Internet Information Services Manager, right click the local computer server and select Properties, open MIME types, click New and enter the following for flv <a href="http://kb2.adobe.com/cps/194/tn_19439.html">(technote)</a>:</p>
<pre>Associated Extension box: .FLV
MIME Type box: flv-application/octet-stream</pre>
<p>and for f4v <a href="http://kb2.adobe.com/cps/402/kb402865.html">(technote)</a>:</p>
<pre>Associated Extension box: .F4V
MIME Type box: video/mp4</pre>
<p>Digging around the internet, I&#8217;ve found people reporting these MIME types working too;<br />
video/x-flv for .flv files, and<br />
video/f4v for .f4v files.</p>
<p>Be advised that you may have to restart IIS for the changes to work.</p>
]]></content:encoded>
			<wfw:commentRss>http://flassari.is/2010/05/flv-and-f4v-files-not-found-on-iis/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flash focus border in Firefox</title>
		<link>http://flassari.is/2010/03/flash-focus-border-in-firefox/</link>
		<comments>http://flassari.is/2010/03/flash-focus-border-in-firefox/#comments</comments>
		<pubDate>Mon, 22 Mar 2010 23:44:23 +0000</pubDate>
		<dc:creator>Flassari</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[1 pixel]]></category>
		<category><![CDATA[active]]></category>
		<category><![CDATA[border]]></category>
		<category><![CDATA[dotted]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[flashcomguru]]></category>
		<category><![CDATA[focus]]></category>
		<category><![CDATA[swf]]></category>

		<guid isPermaLink="false">http://flassari.is/?p=280</guid>
		<description><![CDATA[I've noticed recently that Firefox has started showing a 1px dotted border around flash objects when I click on them. It didn't bother me enough to look for a solution, but today the solution found me [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve noticed recently that Firefox has started showing a 1px dotted border around flash objects when I click on them. It didn&#8217;t bother me enough to look for a solution, but today the solution found me.<br />
In my rss reader a <a href="http://www.flashcomguru.com/index.cfm/2010/3/22/prevent-swf-border-firefox">blog post</a> from <a href="http://www.flashcomguru.com">FlashComGuru</a> pops up, showing how to get rid of this annoyance, pasted here for your convenience:</p>
<p><i>Simply add this to your page&#8217;s stylesheet:</i></p>
<pre class="brush: html">
a:focus, object:focus { outline: none; -moz-outline-style: none; }
</pre>
]]></content:encoded>
			<wfw:commentRss>http://flassari.is/2010/03/flash-focus-border-in-firefox/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wordpress replaces -- with –</title>
		<link>http://flassari.is/2009/11/wordpress-replaces-two-hyphens-with-one/</link>
		<comments>http://flassari.is/2009/11/wordpress-replaces-two-hyphens-with-one/#comments</comments>
		<pubDate>Thu, 05 Nov 2009 08:57:37 +0000</pubDate>
		<dc:creator>Flassari</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[--]]></category>
		<category><![CDATA[arrow]]></category>
		<category><![CDATA[edit]]></category>
		<category><![CDATA[formatting]]></category>
		<category><![CDATA[formatting.php]]></category>
		<category><![CDATA[hyphen]]></category>
		<category><![CDATA[hyphens]]></category>
		<category><![CDATA[line]]></category>
		<category><![CDATA[lines]]></category>
		<category><![CDATA[replace]]></category>
		<category><![CDATA[swfobject]]></category>
		<category><![CDATA[upgrade]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[–]]></category>

		<guid isPermaLink="false">http://flassari.is/?p=202</guid>
		<description><![CDATA[I just recently upgraded my wordpress system, and now it does not show my embedded flash at all. I would be surprised, but this isn't the first time this happens.
The last time I upgraded I found a blog post on how to fix it, but it's been a while and I just can't find that post any more, so I'm writing my own. [...]]]></description>
			<content:encoded><![CDATA[<p>I just recently upgraded my wordpress system, and now it does not show my embedded flash at all. I would be surprised, but this isn&#8217;t the first time this happens.<br />
The last time I upgraded I found a blog post on how to fix it, but it&#8217;s been a while and I just can&#8217;t find that post any more, so I&#8217;m writing my own.</p>
<p>So this is the deal: I always embed my flash using the html code that <a href="http://code.google.com/p/swfobject/wiki/documentation#How_to_embed_Flash_Player_content_using_SWFObject_static_publish">SWFobject recommends</a>:</p>
<pre class="brush: html">
&lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="780" height="420"&gt;
  &lt;param name="movie" value="myContent.swf" /&gt;
  &lt;!--[if !IE]&gt;--&gt;
  &lt;object type="application/x-shockwave-flash" data="myContent.swf" width="780" height="420"&gt;
  &lt;!--&lt;![endif]--&gt;
    &lt;p>Alternative content&lt;/p&gt;
  &lt;!--[if !IE]&gt;--&gt;
  &lt;/object&gt;
  &lt;!--&lt;![endif]--&gt;
&lt;/object&gt;
</pre>
<p>After the upgrade, instead of my pretty flash objects I get this funky arrow in my posts:</p>
<pre>
–&gt;
</pre>
<p>And if I look at the source, it now looks like this:</p>
<pre class="brush: html">
&lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="780" height="420"&gt;
  &lt;param name="movie" value="myContent.swf" /&gt;
  &lt;!--[if !IE]&gt;&amp;#8211;&gt;
  &lt;object type="application/x-shockwave-flash" data="myContent.swf" width="780" height="420"&gt;
  &lt;!--&lt;![endif]--&gt;
    &lt;p>Alternative content&lt;/p&gt;
  &lt;!--[if !IE]&gt;&amp;#8211;&gt;
  &lt;/object&gt;
  &lt;!--&lt;![endif]--&gt;
&lt;/object&gt;
</pre>
<p>Apparently wordpress replaces<br />
&lt;!--[if !IE]&gt;<span style="color: #006600; font-weight: bold;">--</span>&gt;<br />
with<br />
&lt;!--[if !IE]&gt;<span style="color: red; font-weight: bold;">&amp;#8211;</span>&gt;, but when I look into my post to edit it, it still looks fine there.</p>
<p>The reason is that wordpress is trying to make your writing prettier, even if you don&#8217;t use the wysiwyg editor. To stop wordpress from doing that, go into your wordpress directory and edit the file wp-includes/formatting.php. On lines 55 and 56 (for version 2.8.5) you should see this text:</p>
<pre class="brush: php">
$static_characters = array_merge(array('---', ' -- ', '--', ' - ', 'xn&amp;#8211;', '...', '``', '\'s', '\'\'', ' (tm)'), $cockney);
$static_replacements = array_merge(array('&amp;#8212;', ' &amp;#8212; ', '&amp;#8211;', ' &amp;#8211; ', 'xn--', '&amp;#8230;', $opening_quote, '&amp;#8217;s', $closing_quote, ' &amp;#8482;'),
</pre>
<p>If not, just look for it, it should be in the top page or two.<br />
Now all you have to do is comment out the array elements you don&#8217;t want wordpress to replace. My lines look like this:</p>
<pre class="brush: php">
$static_characters = array_merge(array(/*'---', ' -- ', '--', ' - ', */'xn&amp;#8211;', '...', '``', '\'s', '\'\'', ' (tm)'), $cockney);
$static_replacements = array_merge(array(/*'&amp;#8212;', ' &amp;#8212; ', '&amp;#8211;', ' &amp;#8211; ', */'xn--', '&amp;#8230;', $opening_quote, '&amp;#8217;s', $closing_quote, ' &amp;#8482;'),
</pre>
<p>Hope this helps.</p>
]]></content:encoded>
			<wfw:commentRss>http://flassari.is/2009/11/wordpress-replaces-two-hyphens-with-one/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Profiling AS3/Flex applications</title>
		<link>http://flassari.is/2009/10/profiling-as3flex-applications/</link>
		<comments>http://flassari.is/2009/10/profiling-as3flex-applications/#comments</comments>
		<pubDate>Tue, 06 Oct 2009 12:22:14 +0000</pubDate>
		<dc:creator>Flassari</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Adobe TV]]></category>
		<category><![CDATA[builder]]></category>
		<category><![CDATA[Jun Heider]]></category>
		<category><![CDATA[memory]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[profiler]]></category>
		<category><![CDATA[profiling]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://flassari.is/?p=185</guid>
		<description><![CDATA[I'm working on a big project and had some problems with memory leaks. After some google-ing around I found this great video on AdobeTV by Jun Heider where he shows you how to profile memory and performance [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m working on a big project and was having some problems with memory leaks. After some google-ing around I found this great video on <a href="http://tv.adobe.com/watch/360flex-conference/using-the-flex-builder-3-profiler-by-jun-heider/">AdobeTV</a> by <a href="http://www.iheartair.com/">Jun Heider</a> where he shows you how to profile both the memory and performance of your AS3 or Flex application.<br />
It&#8217;s pretty thorough and it is little over one hour in length.</p>
<p><object width="425" height="256"><param name="movie" value="http://images.tv.adobe.com//swf/player.swf"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><param name="FlashVars" value="fileID=2165&#038;context=141&#038;embeded=true&#038;environment=production"></param><embed src="http://images.tv.adobe.com//swf/player.swf" flashvars="fileID=2165&#038;context=141&#038;embeded=true&#038;environment=production" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="256"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://flassari.is/2009/10/profiling-as3flex-applications/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Load font dynamically on runtime</title>
		<link>http://flassari.is/2009/05/load-font-dynamically-on-runtime/</link>
		<comments>http://flassari.is/2009/05/load-font-dynamically-on-runtime/#comments</comments>
		<pubDate>Wed, 06 May 2009 15:20:20 +0000</pubDate>
		<dc:creator>Flassari</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[dynamic]]></category>
		<category><![CDATA[embed]]></category>
		<category><![CDATA[external]]></category>
		<category><![CDATA[font]]></category>
		<category><![CDATA[load]]></category>
		<category><![CDATA[runtime]]></category>

		<guid isPermaLink="false">http://flassari.is/?p=137</guid>
		<description><![CDATA[Sometimes you want to be able to keep your fonts in a seperate swf file, a "font library" if you will, that you can load dynamically on runtime. Here's how to do that in AS3: [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes you want to be able to keep your fonts in a seperate swf file, a &#8220;font library&#8221; if you will, that you can load dynamically on runtime. Here&#8217;s how to do that in AS3:</p>
<p>The first thing you have to do is create a new flash file to store the font(s). Then, right click the library and select &#8220;New Font&#8230;&#8221;.<br />
<img src="http://flassari.is/wp-content/uploads/2009/05/newfont.png" alt="newfont" title="newfont" width="373" height="296" class="aligncenter size-full wp-image-138" /></p>
<p>Choose the font you want to embed and give it a name. Any name will do here, as this is only the library name and will not affect our code in any way. I prefer to name the font with the same name as the linkage name I plan to give it.<br />
<img src="http://flassari.is/wp-content/uploads/2009/05/myfont.png" alt="myfont" title="myfont" width="417" height="144" class="aligncenter size-full wp-image-141" /></p>
<p>Click ok, and then right click the font in the library and select &#8220;Linkage&#8230;&#8221;. Check the &#8220;Export for ActionScript&#8221; and &#8220;Export in first frame&#8221; options, give your font the linkage name of your own liking and click OK.<br />
<img src="http://flassari.is/wp-content/uploads/2009/05/linkage.png" alt="linkage" title="linkage" width="447" height="231" class="aligncenter size-full wp-image-140" /></p>
<p>And now you&#8217;re ready. Export the file to swf and there&#8217;s your font resource file.</p>
<p>If you want to use that font, you first have to load it into the application domain, and then register it on the global font list using the Font.registerFont function. The textfield can&#8217;t display it until it has the embedFonts property set to true and the font name in its textformat.<br />
You can see an example in the following code, ready to be pasted into your frame:</p>
<pre class="brush: as">var l:Loader = new Loader();
l.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoaded);
l.load(new URLRequest("MyFont.swf"), new LoaderContext(false, ApplicationDomain.currentDomain));

function onLoaded(e:Event):void {
	// Register the font to the global font list
	Font.registerFont( Class( ApplicationDomain.currentDomain.getDefinition("MyFont")));

	myTextField.embedFonts = true;
	// instantiate the font just to get the real font name, or if you know the name before hand you can just hard-code it in here
	var fontName:String = new (ApplicationDomain.currentDomain.getDefinition("MyFont"))().fontName;
	var tf:TextFormat = new TextFormat(fontName);
	// Set the text format for the text already in the text field
	myTextField.setTextFormat(tf);
	// and for future changes
	myTextField.defaultTextFormat = tf;
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://flassari.is/2009/05/load-font-dynamically-on-runtime/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
