<?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>Web 2.1 &#187; Flash</title>
	<atom:link href="http://web.2point1.com/tag/flash/feed/" rel="self" type="application/rss+xml" />
	<link>http://web.2point1.com</link>
	<description>Tim Whitlock&#039;s home in the Blogohedron</description>
	<lastBuildDate>Thu, 13 May 2010 21:26:34 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Eulogy</title>
		<link>http://web.2point1.com/2009/01/31/eulogy/</link>
		<comments>http://web.2point1.com/2009/01/31/eulogy/#comments</comments>
		<pubDate>Sat, 31 Jan 2009 14:54:53 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[AS2]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Lingo]]></category>

		<guid isPermaLink="false">http://web.2point1.com/2009/01/31/eulogy/</guid>
		<description><![CDATA[Or, &#8220;why I haven&#8217;t done any Flash work for a year&#8221;
I effectively gave up Flash when I came to Public and it&#8217;s now a whole year since I did any significant Flash work. In this short time AS3 has really come of age, there are tonnes of serious libraries, from fractals to physics, and PaperVision [...]]]></description>
			<content:encoded><![CDATA[<h4>Or, &#8220;why I haven&#8217;t done any Flash work for a year&#8221;</h4>
<p>I effectively gave up Flash when I came to <a href="http://www.publicreative.com/" target="_blank">Public</a> and it&#8217;s now a whole year since I did any <em>significant </em>Flash work. In this short time AS3 has really come of age, there are tonnes of serious libraries, from fractals to physics, and PaperVision 3D seems almost omnipresent. The prospect of going back to the ActionScript freelance circuit after a year on the wagon would be quite daunting.<span id="more-87"></span></p>
<p>The reasons I&#8217;ve done little Flash since I&#8217;ve been at Public are perfectly sound: I work with two brilliant Flash developers who make up 50% of our development team, and rather than everyone doing a bit of everything, we all specialize quite specifically. I cover all the back end work, and do a lot of server admin; so ActionScript in my personal world is now just a fond legacy of my freelance career.</p>
<p>ActionScript is still of great interest to me &#8211; <a href="http://jaspa.org.uk/wiki/JAS_language">JASPA is closely modelled on AS3</a>, and at Public Flash makes up the majority of our projects, so I obviously stay up to date on its progress. But I&#8217;ve spent so many hours writing ActionScript that it seems a shame I won&#8217;t be so directly involved in its future. I started using Flash in version 3 and so I&#8217;ve seen ActionScript develop from nothing in real time. I remember when Flash 5 came out and we could finally write <em>real</em> code. I made a concious decision there and then to ditch <a href="http://en.wikipedia.org/wiki/Lingo_(programming_language)" target="_blank">Lingo</a>, because it was starting to become obvious that Flash had a brighter future on the web. This turned out to be a very good decision.</p>
<p>As usual with my blog posts I feel I need to write some kind of conclusion (<em>recalls GCSE English lessons</em>), but I don&#8217;t have one; except I miss Flash, it&#8217;s awesome. The end.</p>
]]></content:encoded>
			<wfw:commentRss>http://web.2point1.com/2009/01/31/eulogy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flash Media Server &amp; FLVPlayback nightmare</title>
		<link>http://web.2point1.com/2008/05/14/flash-media-server-flvplayback-nightmare/</link>
		<comments>http://web.2point1.com/2008/05/14/flash-media-server-flvplayback-nightmare/#comments</comments>
		<pubDate>Wed, 14 May 2008 23:33:51 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flash Media Server]]></category>
		<category><![CDATA[FMS]]></category>
		<category><![CDATA[RTMP]]></category>

		<guid isPermaLink="false">http://web.2point1.com/2008/05/14/flash-media-server-flvplayback-nightmare/</guid>
		<description><![CDATA[I am pretty new to Flash Media Server, but on my current project I have been charged with setting it up. Today, I ran into a thoroughly unpleasant problem, possibly a bug, which I thought I would share.
I set up our simple FMS application, which merely streams video from a three-directory-deep file structure. This means [...]]]></description>
			<content:encoded><![CDATA[<p><strong>I am pretty new to Flash Media Server</strong>, but on my current project I have been charged with setting it up. Today, I ran into a thoroughly unpleasant problem, possibly a bug, which I thought I would share.</p>
<p><span id="more-37"></span>I set up our simple FMS application, which merely streams video from a three-directory-deep file structure. This means our Flash front end must,<br />
a. connect to an instance of the application, say: <code>rtmp://mydomain.com/myApp/_definst_</code><br />
b. request the stream of an FLV resource, such as:<br />
<code>flv:ab/cd/ef/vwxyz</code>.</p>
<p>Note the explicit use of the default application instance <code>_definst_</code>, and also the odd reshuffling of the FLV path. This is how you&#8217;re supposed to do it [apparently]  and it worked just fine. Hoorah.</p>
<p>After running some successful tests with a simple front end using <a href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/net/NetConnection.html" target="_blank">NetConnection</a>, I am told that our Flash front end (actually Flex) will be using a skinned <a href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/fl/video/FLVPlayback.html" target="_blank">FLVPlayback</a> component. This component doesn&#8217;t ask you to split the resource into these two pieces; it takes a single, complete stream URL. The above example would mean passing in: <code>rtmp://mydomain.com/myApp/_definst_/ab/cd/ef/vwxyz.flv</code><br />
Note we still keep the instance name, and the flv extension is optional.<br />
This worked just fine on our dev server, and when we deployed to a live server it seemed to be ok too. Hoorah x 2!</p>
<p><strong>Anyhow, I&#8217;ll get to the &#8220;but&#8221;.</strong></p>
<p>After gong live, we received reports of videos not playing, and were unable to replicate the problem at will. Eventually I noticed in the log files that FMS was throwing 404s. On closer inspection, the 404s were for resources prefixed with our application instance name <code>_definst_</code>. The successful 200 responses were requested correctly as <code>ab/cd/ef/vwxyz</code>, but the failures were referenced as <code>_definst_/ab/cd/ef/vwxyz</code>. Most alarmingly these were sometimes for the same resources, and even from the same client.</p>
<p>It looks like under certain [unknown] circumstances, the application and the resource are not getting correctly split out of the full URL. I do not know at what point this error creeps in. I also don&#8217;t know what FLVPlayback does internally to make the stream request from the full URL you pass in. All I know is that the error appears arbitrarily, and has proved impossible to raise on purpose. Possibly a bug in FLVPlayback, or a bug in Flash Media Server?</p>
<p><strong>Solution</strong></p>
<p>A real solution I have not found, so I did a very dirty hack.<br />
As I have failed to avoid the 404s, I turned the bad paths into valid paths by sym-linking the FLV directory back to itself with the name <code>_definst_</code>, as follows:</p>
<pre class="code">cd /path/to/flvs
ln -s . _definst_</pre>
<p>Job done, but I&#8217;m not happy about it. Anyone able to offer a real solution, please post a comment!</p>
]]></content:encoded>
			<wfw:commentRss>http://web.2point1.com/2008/05/14/flash-media-server-flvplayback-nightmare/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Scale &amp; rotate around an arbitrary centre</title>
		<link>http://web.2point1.com/2008/04/13/scale-rotate-around-an-arbitrary-centre/</link>
		<comments>http://web.2point1.com/2008/04/13/scale-rotate-around-an-arbitrary-centre/#comments</comments>
		<pubDate>Sun, 13 Apr 2008 19:22:57 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[math]]></category>
		<category><![CDATA[matrix]]></category>
		<category><![CDATA[vector]]></category>

		<guid isPermaLink="false">http://web.2point1.com/2008/04/13/scale-rotate-around-an-arbitrary-centre/</guid>
		<description><![CDATA[The mini project I picked as my first dip into AS3 was a short example that I had been planning for this blog, so here it is in AS3, instead of AS2 as I had originally planned.
The South Park Chin balls Flash app required that the user drag and zoom a loaded photo. Anyone who&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>The mini project I picked as my first dip into AS3 was a short example that I had been planning for this blog, so here it is in AS3, instead of AS2 as I had originally planned.</p>
<p>The South Park <a href="http://web.2point1.com/2008/03/23/down-and-dirty/">Chin balls</a> Flash app required that the user drag and zoom a loaded photo. Anyone who&#8217;s ever done this will know that you can&#8217;t just scale the picture around it&#8217;s registration point when you zoom. <em>Why</em>? because the centre point changes as you pan the image around. So the requirement in a nutshell is &#8211; to be able to <strong>scale a <em>MovieClip</em> around an arbitrary centre</strong>.</p>
<p>Sure, you could take the <em>Russian doll</em> approach with multiple clips inside clips, but that just ain&#8217;t cool! I thought I&#8217;d share the way I did it as it&#8217;s pretty concise.<span id="more-25"></span></p>
<p>First of all here&#8217;s the principal in action. Scaling and rotation, both performed around an arbitrary centre point that you can alter by dragging that little marker around. Go on, have a go.</p>
<p>[ Update: due to a <a href="http://web.2point1.com/2009/03/21/lessons-learned-again/">nasty server crash</a> some of these files are missing.. sorry. <a href="/wp-content/uploads/2008/04/virtualcentresprite.html#scaleAround" title="scaleAround method" target="_blank">This source was rescued though</a> ]</p>
<p id="flashcontent" style="border: 1px solid #666666; padding: 0pt; display: block; width: 350px; height: 350px">Loading example SWF&#8230;</p>
<p><script type="text/javascript">  <!--     var so = new SWFObject("/wp-content/uploads/2008/04/virtualcentreexample.swf", "flashobj", "350", "350", "9", "#F0F0F0");  so.write("flashcontent");   so.addParam("wmode","opaque");  //-->   </script></p>
<p><a href="/wp-content/uploads/2008/04/virtualcentreexample.zip" title="VirtualCentreExample">Download the source files for this example</a></p>
<p>Most of the source files just serve to create the example interface. The only class we need to discuss is the one with the scale and rotating logic. The class <code><strong>VirtualCentreSprite</strong></code> is an extension of the <code>Sprite</code> class. In AS2 it would have to be an extension of the <code>MovieClip</code> class, but we don&#8217;t need a timeline. You could use this as a base class for sprites across your project to ensure they all have this capability.</p>
<p>It has two methods as follows:<br />
<code style="display: block; white-space: nowrap"><br />
void <strong>scaleAround</strong>( <strong>offsetX</strong>:Number, <strong>offsetY</strong>:Number, <strong>absScaleX</strong>:Number, <strong>absScaleY</strong>:Number )<br />
void <strong>rotateAround</strong>( <strong>offsetX</strong>:Number, <strong>offsetY</strong>:Number, <strong>toDegrees</strong>:Number )<br />
</code><br />
The scaling method is the simplest. It&#8217;s basically GCSE vector maths. We calculate the position that the clip should be at after scaling, do the scaling (which will move the clip according to the centre that Flash knows about) and then we simply reposition it to where it should be.<br />
<a href="/wp-content/uploads/2008/04/virtualcentresprite.html#scaleAround" title="scaleAround method" target="_blank">Click to see source of method <code>scaleAround</code></a></p>
<p>The rotating method is a bit more complex, because it uses a transformation matrix. But thanks to the <code>flash.geom</code> package this is short and sweet. Again the principal is that we let Flash rotate the sprite and then adjust the position.<br />
<a href="/wp-content/uploads/2008/04/virtualcentresprite.html#rotateAround" title="rotateAround method" target="_blank">Click to see source of method <code>rotateAround</code></a></p>
]]></content:encoded>
			<wfw:commentRss>http://web.2point1.com/2008/04/13/scale-rotate-around-an-arbitrary-centre/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>AS3 Migration &#8211; Day 1</title>
		<link>http://web.2point1.com/2008/04/13/as3-migration-day-1/</link>
		<comments>http://web.2point1.com/2008/04/13/as3-migration-day-1/#comments</comments>
		<pubDate>Sun, 13 Apr 2008 17:26:57 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://web.2point1.com/2008/04/12/as3-migration-day-1/</guid>
		<description><![CDATA[Much later than planned I finally got around to checking out AS3.
I was quick to upgrade to AS2 when it came out in Flash MX 2004, and  never looked back, so why so late? Well, as usual, because I&#8217;m busy. Busy on a PHP project at that, so I haven&#8217;t really had the chance. [...]]]></description>
			<content:encoded><![CDATA[<p>Much later than planned I finally got around to checking out AS3.</p>
<p>I was quick to upgrade to AS2 when it came out in Flash MX 2004, and  never looked back, so why so late? Well, as usual, because I&#8217;m busy. Busy on a PHP project at that, so I haven&#8217;t really had the chance. Plus, if I do have to write some AS on the job it&#8217;s too big a risk to start learning something new. Pressures demand that I get on with it as I know how. That&#8217;s why <a href="http://web.2point1.com/2008/03/23/down-and-dirty/">this Facebook application</a> has it&#8217;s main Flash app (Chin Balls) written in AS2. Also, I view the upgrading of a programming language as a one-way process. I didn&#8217;t upgrade to PHP5 until I was confident I would never have to write PHP4 again. And with AS3 this is an even bigger deal.<span id="more-23"></span></p>
<p>I anticipated that AS3 was going to be stricter, less forgiving, and that I&#8217;d have to get used to a few things, but I have to confess to being quite surprised at how different it is. There&#8217;s so much material on AS3 available to you that there&#8217;s no point me banging on about things you can get better information on else where. However, as an AS2 developer here&#8217;s a quick list in no particular order of the things that either surprised or pleased me in my first couple of hours of AS3 writing:</p>
<ul>
<li>The MovieClip&#8217;s inheritance chain has 5 other classes between itself and the Object class. This abstracts out various types of functionality and means you don&#8217;t have to use a fully loaded MovieClip just to display a blob.</li>
<li>Small, but caught me out &#8211; Void must be lower case as a return type, e.g.  <code>function():void{ }</code> My bad.</li>
<li>Watch out; Ctrl-t <strong>only</strong> <strong>checks syntax</strong>.<br />
This is more profound than it sounds. I suspect the reason that AS2 compiles the script and checks all references and types is because that&#8217;s the best chance you&#8217;ve got of catching an error. AS3 actually has the ability to do this at run time, so don&#8217;t think &#8220;This script contains no errors&#8221; means you&#8217;re in the clear!</li>
<li>At last; percentage properties like <em>alpha</em> are now 0-1, instead of 0-100. Another design interface legacy bites the dust. &#8211; and say goodbye to underscores in property names too :)</li>
<li>A new <code>override</code> keyword must be used to redefine a parent class method of the same name</li>
<li>MovieClips do not have implicit onEnterFrame, onRelease,  or <em>any</em> such handlers invoked by default. You have to explicitly define all event handling via the thoroughly standardized Event mechanism.</li>
<li>Looking for onLoad? You won&#8217;t find it, see above;</li>
<li>Declaring child clips as member variables in classes was raising conflicts with members of the same name placed physically on the stage. It took me a while to find the publish setting &#8220;Automatically declare stage instances&#8221;. If you&#8217;re used to declaring all your physical members switch this off. If you&#8217;re normally lazy, switch it on!</li>
<li>No more prototype hacking. Not even if it&#8217;s 10pm and you really want to go home.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://web.2point1.com/2008/04/13/as3-migration-day-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AS3 &#8211; The gap widens</title>
		<link>http://web.2point1.com/2008/04/12/as3-the-gap-widens/</link>
		<comments>http://web.2point1.com/2008/04/12/as3-the-gap-widens/#comments</comments>
		<pubDate>Sat, 12 Apr 2008 16:41:31 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://web.2point1.com/2008/04/13/as3-the-gap-widens/</guid>
		<description><![CDATA[The designer/developer boundary has always been a little blurry when it comes to Flash. Flash has been celebrated for this since 1999, and  has established a pretty unique position. But with each release of Flash those who sit on the fence feel an increasing pressure to choose a camp and stay in it. Some do, [...]]]></description>
			<content:encoded><![CDATA[<p>The designer/developer boundary has always been a little blurry when it comes to Flash. Flash has been celebrated for this since <a href="http://en.wikipedia.org/wiki/Adobe_Flash#History" title="Flash 4 inroduced menu driven scripting" target="_blank">1999</a>, and  has established a pretty unique position. But with each release of Flash those who sit on the fence feel an increasing pressure to choose a camp and stay in it. Some do, some don&#8217;t and some just carry on doing things as they always did, but one thing&#8217;s for sure; that the drive toward Flash being a more robust, more powerful, more serious platform is not showing any signs of slowing down. AS3 is another leap forward. In fact a much bigger leap than AS2 was.<span id="more-22"></span></p>
<p>The casual and flexible nature of ActionScript has lent itself very well to the creative industries in particular over the years. In short, it gets the job done! And unfortunately that&#8217;s what this business is all about most of the time. But ActionScript has really grown up this time. Of course you can still publish Flash movies in AS2, and even AS1, but if you want to grow up too you&#8217;re going to have to get a bit more serious &#8211; again. This means more planning and less hacking. Generally you are going to spend longer doing pretty much everything.</p>
<p>I know plenty of creative developers who have been writing ActionScript for years and many of them eventually embraced AS2, even if a little reluctantly. AS2 was an important step in the maturing of the language, but a step that was in fact a bit of an illusion. The structure and strictness that it appears to impose is really rather superficial and the list of hacks and compiler workarounds is endless. Under the hood AS2 is pretty much the same deal as AS1. i.e. it&#8217;s JavaScript. JavaScript was purposefully designed for non-programmers. How often have you done this to create a button action:</p>
<pre class="code">myBtn.onRelease = function(){ /* do stuff */ }</pre>
<p>What you are doing is creating a function object and assigning it as a property of another object. You can do this because the prototype architecture of JavaScript allows you to &#8211; a concept foreign to pretty much all class-based languages.<br />
Well you can&#8217;t do it any more. &#8211; not in AS3.</p>
<p>This time around Adobe has based the language on the <em>draft</em> specification of <a href="http://en.wikipedia.org/wiki/ECMAScript#Fourth_edition" target="_blank">ECMAScript</a> Edition 4 (<a href="http://en.wikipedia.org/wiki/ECMAScript#Fourth_edition" target="_blank">ES4</a>). AS1 &amp; 2 (along with most implementations of JavaScript that you&#8217;ll encounter) are based on ES3 which is nearly ten years old now. So under the hood AS3 is genuinely a different beast and a more grown up one at that.</p>
<p>So with the ever-stricter, and more robust stature of ActionScript, how long can this designer/developer melting pot survive? And how narrow can the margin remain between the developer and the designer? I don&#8217;t mean to suggest that designers can&#8217;t code or that coders can&#8217;t design, but there are only so many hours in the day, and only so much you can fit into one person&#8217;s job description. Perhaps the distinction of merely two roles isn&#8217;t sufficient anymore. We don&#8217;t talk about Flash development in terms of <em>front </em>and <em>back</em> ends, but perhaps we should. As the gap widens perhaps we can identify multiple roles for specialists across multiple layers of development just as we do with HTML based web apps.</p>
]]></content:encoded>
			<wfw:commentRss>http://web.2point1.com/2008/04/12/as3-the-gap-widens/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Down and Dirty</title>
		<link>http://web.2point1.com/2008/03/23/down-and-dirty/</link>
		<comments>http://web.2point1.com/2008/03/23/down-and-dirty/#comments</comments>
		<pubDate>Sun, 23 Mar 2008 16:06:01 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[portfolio]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://web.2point1.com/2008/03/23/down-and-dirty/</guid>
		<description><![CDATA[Over the previous three weeks I was working with my old pals at Greenroom Digital, who were producing a Facebook application for their client Paramount Pictures. The app&#8217;s release coincided with Paramount&#8217;s release of  South Park Season 6 on DVD. You won&#8217;t be surprised to see that the application is crude and puerile, and [...]]]></description>
			<content:encoded><![CDATA[<p>Over the previous three weeks I was working with my old pals at <a href="http://greenroom-digital.com/" target="_blank" title="Greenroom Digital">Greenroom Digital</a>, who were producing a Facebook application for their client Paramount Pictures. The app&#8217;s release coincided with Paramount&#8217;s release of  South Park Season 6 on DVD. You won&#8217;t be surprised to see that the application is crude and <span class="me">puerile</span>, and you may [as I do] reluctantly find it pretty amusing in places.<a href="http://apps.facebook.com/downanddirty/profile.php?uid=692475161&amp;chinballsid=9b29c38d1db06e9461ff6dc655b8f26a#chinballs"><img src="http://web.2point1.com/wp-content/uploads/2008/03/chinballs2.jpg" alt="Down and Dirty | Chin Balls | mini feed" border="0" hspace="0" vspace="10" /></a></p>
<p>You can see the <a href="http://apps.facebook.com/downanddirty/profile.php?uid=692475161&amp;chinballsid=9b29c38d1db06e9461ff6dc655b8f26a" target="_blank" title="My Down and Dirty Profile">South Park Down and Dirty application in action here</a>. This link is my public <em>Down and Dirty</em> profile and does not require you to add the app, although you can <a href="http://www.facebook.com/add.php?api_key=50be42edee113fc004c43227bd125019" target="_blank" title="Add the Down and Dirty app">add it here</a> in the usual fashion.</p>
<p>Pick up <em>Campaign</em> or some such publication and no doubt you&#8217;ll be able to read all about the strategy, the creative, the design, even the metrics. Less likely you&#8217;ll read about the technical execution, which is where I come in&#8230;</p>
<p><span id="more-10"></span>I joined the team once the creative and design had been signed off, and from that point I was sole developer on the project. This meant developing the back end, (PHP/MySQL), and front end (FBML/CSS) and quite a bit of non-trivial Flash content (AS2). The total development time from briefing to launch was 13 days &#8211; 13 long, hard days.</p>
<p>This project threw up some interesting technical points worth mentioning. If you are interested in any of these topics, let me know and I&#8217;ll write a more in depth article on each;</p>
<p>First up was  the seemingly trivial problem of linking to parts of the app from within Flash content. Something even the least technical Flashers have been doing for years. However, this was until Adobe implemented <a href="http://kb.adobe.com/selfservice/viewContent.do?externalId=50c1cf38" target="_blank" title="getURL securty addition">this security feature</a> in the Flash Player. This led me to implement all Flash content across the app within <em>iframes</em>, as opposed to using Facebook&#8217;s <a href="http://wiki.developers.facebook.com/index.php/Fb:swf" target="_blank">fb:swf</a> tag.</p>
<p>The good old Flash security model came into play on this project too. Loading images directly from Facebook&#8217;s servers into a third party Flash app is not a problem if all you want to do is display the image. This is all I needed to do in my first ever Facebook app <a href="http://apps.facebook.com/fbplayer/" title="FBPlayer Facebook application displays your photos in flash" target="_blank">FBPlayer</a>. This can be achieved simply with the <em>MovieClipLoader</em>, but as advanced Flashers will know, if you want to do anything remotely cool you need to use the wonderful <em>BitmapData </em>class. Take note: an image that has been loaded into Flash from outside your sandbox is subject to the same security lockdown as an external SWF. In a nutshell &#8211; it is not scriptable! Therefore BitmapData.draw() does not work on the image data. The obvious solution is an image proxy. Not difficult in the least and one has to wonder what the point in this security feature really is when it is so easily circumvented with a perfectly legitimate technique. The image proxy I implemented in PHP was about 12 lines long [excluding library code], and took all of 5 minutes to write and test.</p>
<p>Another surprise was related to Facebook privacy. Accessing friends&#8217; photo albums via the API was yielding empty results in some cases &#8211; It transpires that plenty of punters are aware they can block applications from accessing their data. This is obviously not the default setting, but as more people become aware of these capabilities the functionality of apps like <em>Chin Balls</em> become more restricted because users&#8217; friends have to be more willing participants. Although I support this approach in sentiment, it unfortunately increases applications&#8217; need to persuade people to <em>add</em> in order to function, which makes apps more irritating and &#8216;<em>spammy</em>&#8216;.</p>
<p>This does not necessarily mean you must add an application to interact with it at all. A little known fact [it seems] is that a Facebook canvas page is viewable by anyone logged into a Facebook account. The only reason you see immediate &#8216;<em>add application</em>&#8216; prompts is that the app authors are being pushy and lazy. The South Park app has a <a href="http://apps.facebook.com/downanddirty/profile.php?uid=692475161&amp;chinballsid=9b29c38d1db06e9461ff6dc655b8f26a" title="My Down and Dirty Profile" target="_blank">public profile page</a> where you can see the same content that I can see. You do not need to add the app to see my profile. &#8211; <em>Why? </em>- Because this functionality does not require the app to know who <strong>you </strong>are. In fact it cannot know even your user id until you authorize it. When you view this page the app is using <strong>my </strong>authorization for you to see the content. Why not give new users an experience up front and let them decide if thy like the app before being coerced into adding it? There are privacy issues at stake here too of course, but I am blithering on enough as it is. Let me know your thoughts!</p>
]]></content:encoded>
			<wfw:commentRss>http://web.2point1.com/2008/03/23/down-and-dirty/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
