<?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>Danny Patterson</title>
	<atom:link href="http://blog.dannypatterson.com/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://blog.dannypatterson.com</link>
	<description></description>
	<lastBuildDate>Mon, 14 Jun 2010 19:40:48 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Yahoo World Cup Game</title>
		<link>http://blog.dannypatterson.com/?p=302</link>
		<comments>http://blog.dannypatterson.com/?p=302#comments</comments>
		<pubDate>Mon, 14 Jun 2010 19:40:48 +0000</pubDate>
		<dc:creator>Danny Patterson</dc:creator>
				<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://blog.dannypatterson.com/?p=302</guid>
		<description><![CDATA[I don&#8217;t do many games, but I recently worked with Sapient to build a World Cup game for Yahoo.  The game is a multi-player Penalty Shootout.  It lets you invite and challenge your friends to matches or you can &#8220;play now&#8221; against a random player from around the world.  This game has [...]]]></description>
			<content:encoded><![CDATA[<p>I don&#8217;t do many games, but I recently worked with <a href="http://www.sapient.com/" target="_blank">Sapient</a> to build a <a href="http://g.sports.yahoo.com/soccer/world-cup/penalty-shootout" target="_blank">World Cup game for Yahoo</a>.  The game is a multi-player Penalty Shootout.  It lets you invite and challenge your friends to matches or you can &#8220;play now&#8221; against a random player from around the world.  This game has been localized for 17 different countries and languages.  At the end of the World Cup Yahoo will even be give out a great prize to one of the top players in the game.  There were lots of challenges in creating this game, but it was fun and the teams and Sapient and Yahoo were great to work with.  Check it out!</p>
<p><a href="http://g.sports.yahoo.com/soccer/world-cup/penalty-shootout" target="_blank"><img src="/wp-content/PenaltyShootout.jpg" alt="Yahoo Penalty Shootout" title="Yahoo Penalty Shootout" width="500" height="240" border="0" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.dannypatterson.com/?feed=rss2&amp;p=302</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Namespaces on Attributes with E4x in ActionScript 3</title>
		<link>http://blog.dannypatterson.com/?p=297</link>
		<comments>http://blog.dannypatterson.com/?p=297#comments</comments>
		<pubDate>Tue, 30 Mar 2010 16:58:16 +0000</pubDate>
		<dc:creator>Danny Patterson</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[XML/XSLT/XML Schema]]></category>

		<guid isPermaLink="false">http://blog.dannypatterson.com/?p=297</guid>
		<description><![CDATA[I recently came accross an odd behavior when adding namespaces to an attrubute using E4X.  I needed to create an XML object like the following:

1
&#60;body xml:lang=&#34;en&#34; xmpp:version=&#34;1.0&#34; xmlns:xml=&#34;http://www.w3.org/XML/1998/namespace&#34; xmlns:xmpp=&#34;urn:xmpp:xbosh&#34; /&#62;

This XML element is created dynamically within the ActionScript code like this:

1
2
3
4
5
var body:XML = &#60;body /&#62;;
var xml:Namespace = new Namespace&#40;&#34;xml&#34;, &#34;http://www.w3.org/XML/1998/namespace&#34;&#41;;
body.@xml::lang = &#34;en&#34;;
var xmpp:Namespace = [...]]]></description>
			<content:encoded><![CDATA[<p>I recently came accross an odd behavior when adding namespaces to an attrubute using E4X.  I needed to create an XML object like the following:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;body</span> <span style="color: #000066;">xml:lang</span>=<span style="color: #ff0000;">&quot;en&quot;</span> <span style="color: #000066;">xmpp:version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">xmlns:xml</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/XML/1998/namespace&quot;</span> <span style="color: #000066;">xmlns:xmpp</span>=<span style="color: #ff0000;">&quot;urn:xmpp:xbosh&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span></pre></td></tr></table></div>

<p>This XML element is created dynamically within the ActionScript code like this:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> body:<span style="color: #0066CC;">XML</span> = <span style="color: #66cc66;">&lt;</span>body <span style="color: #66cc66;">/&gt;</span>;
<span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">xml</span>:Namespace = <span style="color: #000000; font-weight: bold;">new</span> Namespace<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;xml&quot;</span>, <span style="color: #ff0000;">&quot;http://www.w3.org/XML/1998/namespace&quot;</span><span style="color: #66cc66;">&#41;</span>;
body.<span style="color: #66cc66;">@</span><span style="color: #0066CC;">xml</span>::lang = <span style="color: #ff0000;">&quot;en&quot;</span>;
<span style="color: #000000; font-weight: bold;">var</span> xmpp:Namespace = <span style="color: #000000; font-weight: bold;">new</span> Namespace<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;xmpp&quot;</span>, <span style="color: #ff0000;">&quot;urn:xmpp:xbosh&quot;</span><span style="color: #66cc66;">&#41;</span>;
body.<span style="color: #66cc66;">@</span>xmpp::<span style="color: #0066CC;">version</span> = <span style="color: #ff0000;">&quot;1.0&quot;</span>;</pre></td></tr></table></div>

<p>However, the output of the namespaces in the XML was off:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;body</span> <span style="color: #000066;">aaa:lang</span>=<span style="color: #ff0000;">&quot;en&quot;</span> <span style="color: #000066;">aab:version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">xmlns:aaa</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/XML/1998/namespace&quot;</span> <span style="color: #000066;">xmlns:aab</span>=<span style="color: #ff0000;">&quot;urn:xmpp:xbosh&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span></pre></td></tr></table></div>

<p>I realize this is still valid, but the server was having issues with it.  That&#8217;s when I discovered that I need to first add the namespaces to the XML element using addNamespace().  This then gave me the right output:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> body:<span style="color: #0066CC;">XML</span> = <span style="color: #66cc66;">&lt;</span>body <span style="color: #66cc66;">/&gt;</span>;
<span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">xml</span>:Namespace = <span style="color: #000000; font-weight: bold;">new</span> Namespace<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;xml&quot;</span>, <span style="color: #ff0000;">&quot;http://www.w3.org/XML/1998/namespace&quot;</span><span style="color: #66cc66;">&#41;</span>;
body.<span style="color: #006600;">addNamespace</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">xml</span><span style="color: #66cc66;">&#41;</span>;
body.<span style="color: #66cc66;">@</span><span style="color: #0066CC;">xml</span>::lang = <span style="color: #ff0000;">&quot;en&quot;</span>;
<span style="color: #000000; font-weight: bold;">var</span> xmpp:Namespace = <span style="color: #000000; font-weight: bold;">new</span> Namespace<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;xmpp&quot;</span>, <span style="color: #ff0000;">&quot;urn:xmpp:xbosh&quot;</span><span style="color: #66cc66;">&#41;</span>;
body.<span style="color: #006600;">addNamespace</span><span style="color: #66cc66;">&#40;</span>xmpp<span style="color: #66cc66;">&#41;</span>;
body.<span style="color: #66cc66;">@</span>xmpp::<span style="color: #0066CC;">version</span> = <span style="color: #ff0000;">&quot;1.0&quot;</span>;</pre></td></tr></table></div>

<p>Hopefully this will save someone else an hour of banging his or her head against the wall.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.dannypatterson.com/?feed=rss2&amp;p=297</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Speaking about Flash Development on Facebook</title>
		<link>http://blog.dannypatterson.com/?p=291</link>
		<comments>http://blog.dannypatterson.com/?p=291#comments</comments>
		<pubDate>Thu, 04 Mar 2010 17:35:19 +0000</pubDate>
		<dc:creator>Danny Patterson</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Conferences]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[MN.swf]]></category>

		<guid isPermaLink="false">http://blog.dannypatterson.com/?p=291</guid>
		<description><![CDATA[I&#8217;ll be speaking at a couple confirences in the next six months on the topic of Flash Development on Facebook.  The first conference I&#8217;ll be at is MN.swf Camp on April 5th.  This will be a short 30 minute session that will introduce the concepts around developing a Facebook application and specifically putting [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flashbelt.com" target="_blank"><img src="/wp-content/flashbelt2010_200x120_Speaker.gif" alt="Flashbelt 2010" width="200" height="120" align="right" /></a>I&#8217;ll be speaking at a couple confirences in the next six months on the topic of Flash Development on Facebook.  The first conference I&#8217;ll be at is <a href="http://mnswf.com/camp" target="_blank">MN.swf Camp</a> on April 5th.  This will be a short 30 minute session that will introduce the concepts around developing a Facebook application and specifically putting Flash Applications within Facebook.com.</p>
<p>Then I&#8217;ll be giving a much more in-depth session at <a href="http://www.flashbelt.com" target="_blank">Flashbelt</a> in June.  This session will actually dig into some of the details and caveats of Facebook development.  Patterson Consulting has been doing a lot of Facebook integration with our clients lately and we see this as an emerging market Flash developers.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.dannypatterson.com/?feed=rss2&amp;p=291</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>BusinessCard2.com using Flex to Distribute Business Cards</title>
		<link>http://blog.dannypatterson.com/?p=276</link>
		<comments>http://blog.dannypatterson.com/?p=276#comments</comments>
		<pubDate>Sun, 04 Oct 2009 02:30:44 +0000</pubDate>
		<dc:creator>Danny Patterson</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://blog.dannypatterson.com/?p=276</guid>
		<description><![CDATA[For the past few months I&#8217;ve been working with the guys over at Workface to develop their BusinessCard2 platform.  BusinessCard2 is a fast growing social site that is focused on being your professional identity online.  Simply go the BusinessCard2.com and enter in your contact information to create your card.  Then you can [...]]]></description>
			<content:encoded><![CDATA[<p>For the past few months I&#8217;ve been working with the guys over at <a href="http://www.workfaceinc.com" target="_blank">Workface</a> to develop their <a href="http://businesscard2.com" target="_blank">BusinessCard2</a> platform.  BusinessCard2 is a fast growing social site that is focused on being your professional identity online.  Simply go the BusinessCard2.com and enter in your contact information to create your card.  Then you can embed the card on your web site or blog, you can share it on a number of social web sites, and you can even sign up for the AdCast service where BusinessCard2 will actually purchase advertising space and push your card to a number of publishers on a cost-per-interaction basis.</p>
<p><span id="more-276"></span></p>
<p>The actual card is a 300&#215;250 SWF so it can be distributed in a standard advertising slot.  The SWF was created using Flex.  It has a lot of functionality today, but we have even bigger plans for it in the future.  Using the Flash Platform gives us the <em>flexibility</em> (pun intended) to expand the card with features like photos, videos and even real-time chat.</p>
<p>We built a <a href="http://wordpress.org/extend/plugins/businesscard2-card">WordPress Plugin</a> to make it easy to embed the card on your blog and we also just launched a <a href="http://apps.facebook.com/businesscardtwo" target="_blank">Facebook application</a> that makes it easy to post your card right on your wall in Facebook.</p>
<p>The service just launched this past summer and we have a number of additional features planned to add additional content and functionality to your card.  I encourage everyone to go and check it out.  Here is my card:</p>
<p><script type="text/javascript" src="http://businesscard2.com/api_1.php/api/embedScript?customerDomain=patterson.businesscard2.com"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.dannypatterson.com/?feed=rss2&amp;p=276</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Upload ByteArray to Flickr</title>
		<link>http://blog.dannypatterson.com/?p=250</link>
		<comments>http://blog.dannypatterson.com/?p=250#comments</comments>
		<pubDate>Wed, 05 Aug 2009 19:28:26 +0000</pubDate>
		<dc:creator>Danny Patterson</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[flickr]]></category>
		<category><![CDATA[multipart]]></category>
		<category><![CDATA[upload]]></category>

		<guid isPermaLink="false">http://blog.dannypatterson.com/?p=250</guid>
		<description><![CDATA[If you&#8217;ve used the the AS3 Flickr Library for uploading images to Flickr you know that it requires a FileReference object.  Since you can only get a FileReference if you ask the user to browse to a local image on their hard drive or if you&#8217;re using AIR and just grab an image from [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;ve used the the <a href="http://code.google.com/p/as3flickrlib/" target="_blank">AS3 Flickr Library</a> for uploading images to Flickr you know that it requires a FileReference object.  Since you can only get a FileReference if you ask the user to browse to a local image on their hard drive or if you&#8217;re using AIR and just grab an image from the user&#8217;s hard drive.  But what if you just want to upload a dynamically generated image from within your SWF?</p>
<p><span id="more-250"></span></p>
<p>With the help of an <a href="http://code.google.com/p/in-spirit/wiki/MultipartURLLoader" target="_blank">open-source MultipartURLLoader</a> class, I went in and added the ability to upload a bytearray to AS3 Flickr Library.  Just add the following method to the Upload class:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
</pre></td><td class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> uploadBytes<span style="color: #66cc66;">&#40;</span>photoData:ByteArray, 
				title:<span style="color: #0066CC;">String</span> = <span style="color: #ff0000;">&quot;&quot;</span>,
				description:<span style="color: #0066CC;">String</span> = <span style="color: #ff0000;">&quot;&quot;</span>,
				tags:<span style="color: #0066CC;">String</span> = <span style="color: #ff0000;">&quot;&quot;</span>,
				is_public:<span style="color: #0066CC;">Boolean</span> = <span style="color: #000000; font-weight: bold;">false</span>,
				is_friend:<span style="color: #0066CC;">Boolean</span> = <span style="color: #000000; font-weight: bold;">false</span>,
				is_family:<span style="color: #0066CC;">Boolean</span> = <span style="color: #000000; font-weight: bold;">false</span>,
				safety_level:<span style="color: #0066CC;">int</span> = <span style="color: #cc66cc;">0</span>,
				content_type:<span style="color: #0066CC;">int</span> = <span style="color: #cc66cc;">0</span>,
				hidden:<span style="color: #0066CC;">Boolean</span> = <span style="color: #000000; font-weight: bold;">false</span><span style="color: #66cc66;">&#41;</span> : <span style="color: #0066CC;">Boolean</span> <span style="color: #66cc66;">&#123;</span>
&nbsp;
	<span style="color: #808080; font-style: italic;">// Bail out if missing the necessary authentication parameters</span>
	<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>_service.<span style="color: #006600;">api_key</span> == <span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #66cc66;">||</span> _service.<span style="color: #006600;">secret</span> == <span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #66cc66;">||</span> _service.<span style="color: #006600;">token</span> == <span style="color: #ff0000;">&quot;&quot;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
		<span style="color: #b1b100;">return</span> <span style="color: #000000; font-weight: bold;">false</span>;
	<span style="color: #66cc66;">&#125;</span>
&nbsp;
	<span style="color: #808080; font-style: italic;">// Bail out if application doesn't have authorisation to writ or delete from account</span>
	<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>_service.<span style="color: #006600;">permission</span> <span style="color: #66cc66;">!</span>= AuthPerm.<span style="color: #006600;">WRITE</span> <span style="color: #66cc66;">&amp;&amp;</span> _service.<span style="color: #006600;">permission</span> <span style="color: #66cc66;">!</span>= AuthPerm.<span style="color: #0066CC;">DELETE</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
	    <span style="color: #b1b100;">return</span> <span style="color: #000000; font-weight: bold;">false</span>;
	<span style="color: #66cc66;">&#125;</span>
&nbsp;
	<span style="color: #808080; font-style: italic;">// The upload method requires signing, so go through</span>
	<span style="color: #808080; font-style: italic;">// the signature process</span>
&nbsp;
	<span style="color: #808080; font-style: italic;">// Flash sends both the 'Filename' and the 'Upload' values</span>
	<span style="color: #808080; font-style: italic;">// in the body of the POST request, so these are needed for the signature</span>
	<span style="color: #808080; font-style: italic;">// as well, otherwise Flickr returns a error code 96 'invalid signature'</span>
	<span style="color: #000000; font-weight: bold;">var</span> sig:<span style="color: #0066CC;">String</span> = StringUtil.<span style="color: #006600;">trim</span><span style="color: #66cc66;">&#40;</span> _service.<span style="color: #006600;">secret</span> <span style="color: #66cc66;">&#41;</span>;
	sig += <span style="color: #ff0000;">&quot;FilenamePhoto&quot;</span>;
	sig += <span style="color: #ff0000;">&quot;UploadSubmit Query&quot;</span>;
	sig += <span style="color: #ff0000;">&quot;api_key&quot;</span> + StringUtil.<span style="color: #006600;">trim</span><span style="color: #66cc66;">&#40;</span> _service.<span style="color: #006600;">api_key</span> <span style="color: #66cc66;">&#41;</span>;
	sig += <span style="color: #ff0000;">&quot;auth_token&quot;</span> + StringUtil.<span style="color: #006600;">trim</span><span style="color: #66cc66;">&#40;</span> _service.<span style="color: #006600;">token</span> <span style="color: #66cc66;">&#41;</span>;
&nbsp;
	<span style="color: #808080; font-style: italic;">// optional values, in alphabetical order as required</span>
	<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> content_type <span style="color: #66cc66;">!</span>= <span style="color: #0066CC;">ContentType</span>.<span style="color: #000000; font-weight: bold;">DEFAULT</span> <span style="color: #66cc66;">&#41;</span> sig += <span style="color: #ff0000;">&quot;content_type&quot;</span> + content_type;
	<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> description <span style="color: #66cc66;">!</span>= <span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #66cc66;">&#41;</span> sig += <span style="color: #ff0000;">&quot;description&quot;</span> + description;
	<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> hidden <span style="color: #66cc66;">&#41;</span> sig += <span style="color: #ff0000;">&quot;hidden&quot;</span> + <span style="color: #66cc66;">&#40;</span> hidden ? <span style="color: #cc66cc;">1</span> : <span style="color: #cc66cc;">0</span> <span style="color: #66cc66;">&#41;</span>;
	<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> is_family <span style="color: #66cc66;">&#41;</span> sig += <span style="color: #ff0000;">&quot;is_family&quot;</span> + <span style="color: #66cc66;">&#40;</span> is_family ? <span style="color: #cc66cc;">1</span> : <span style="color: #cc66cc;">0</span> <span style="color: #66cc66;">&#41;</span>;
	<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> is_friend <span style="color: #66cc66;">&#41;</span> sig += <span style="color: #ff0000;">&quot;is_friend&quot;</span> + <span style="color: #66cc66;">&#40;</span> is_friend ? <span style="color: #cc66cc;">1</span> : <span style="color: #cc66cc;">0</span> <span style="color: #66cc66;">&#41;</span>;
	<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> is_public <span style="color: #66cc66;">&#41;</span> sig += <span style="color: #ff0000;">&quot;is_public&quot;</span> + <span style="color: #66cc66;">&#40;</span> is_public ? <span style="color: #cc66cc;">1</span> : <span style="color: #cc66cc;">0</span> <span style="color: #66cc66;">&#41;</span>;
	<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> safety_level <span style="color: #66cc66;">!</span>= SafetyLevel.<span style="color: #000000; font-weight: bold;">DEFAULT</span> <span style="color: #66cc66;">&#41;</span> sig += <span style="color: #ff0000;">&quot;safety_level&quot;</span> + safety_level;
	<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> tags <span style="color: #66cc66;">!</span>= <span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #66cc66;">&#41;</span> sig += <span style="color: #ff0000;">&quot;tags&quot;</span> + tags;
	<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> title <span style="color: #66cc66;">!</span>= <span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #66cc66;">&#41;</span> sig += <span style="color: #ff0000;">&quot;title&quot;</span> + title;
&nbsp;
	<span style="color: #808080; font-style: italic;">// Create MultipartURLLoader to send upload</span>
	<span style="color: #000000; font-weight: bold;">var</span> loader:MultipartURLLoader = <span style="color: #000000; font-weight: bold;">new</span> MultipartURLLoader<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
	loader.<span style="color: #006600;">addFile</span><span style="color: #66cc66;">&#40;</span>photoData, <span style="color: #ff0000;">&quot;Photo&quot;</span>, <span style="color: #ff0000;">&quot;photo&quot;</span><span style="color: #66cc66;">&#41;</span>;
	loader.<span style="color: #006600;">addVariable</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;auth_token&quot;</span>, StringUtil.<span style="color: #006600;">trim</span><span style="color: #66cc66;">&#40;</span>_service.<span style="color: #006600;">token</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
	loader.<span style="color: #006600;">addVariable</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;api_sig&quot;</span>, MD5.<span style="color: #006600;">hash</span><span style="color: #66cc66;">&#40;</span>sig<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
	loader.<span style="color: #006600;">addVariable</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;api_key&quot;</span>, StringUtil.<span style="color: #006600;">trim</span><span style="color: #66cc66;">&#40;</span>_service.<span style="color: #006600;">api_key</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
	<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>content_type <span style="color: #66cc66;">!</span>= <span style="color: #0066CC;">ContentType</span>.<span style="color: #000000; font-weight: bold;">DEFAULT</span><span style="color: #66cc66;">&#41;</span> loader.<span style="color: #006600;">addVariable</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;content_type&quot;</span>, content_type<span style="color: #66cc66;">&#41;</span>;
	<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>description <span style="color: #66cc66;">!</span>= <span style="color: #ff0000;">&quot;&quot;</span><span style="color: #66cc66;">&#41;</span> loader.<span style="color: #006600;">addVariable</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;description&quot;</span>, description<span style="color: #66cc66;">&#41;</span>;
	<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>hidden<span style="color: #66cc66;">&#41;</span> loader.<span style="color: #006600;">addVariable</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;hidden&quot;</span>, hidden ? <span style="color: #cc66cc;">1</span> : <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>is_family<span style="color: #66cc66;">&#41;</span> loader.<span style="color: #006600;">addVariable</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;is_family&quot;</span>, is_family ? <span style="color: #cc66cc;">1</span> : <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>is_friend<span style="color: #66cc66;">&#41;</span> loader.<span style="color: #006600;">addVariable</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;is_friend&quot;</span>, is_friend ? <span style="color: #cc66cc;">1</span> : <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>is_public<span style="color: #66cc66;">&#41;</span> loader.<span style="color: #006600;">addVariable</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;is_public&quot;</span>, is_public ? <span style="color: #cc66cc;">1</span> : <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>safety_level <span style="color: #66cc66;">!</span>= SafetyLevel.<span style="color: #000000; font-weight: bold;">DEFAULT</span><span style="color: #66cc66;">&#41;</span> loader.<span style="color: #006600;">addVariable</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;safety_level&quot;</span>, safety_level<span style="color: #66cc66;">&#41;</span>;
	<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>tags <span style="color: #66cc66;">!</span>= <span style="color: #ff0000;">&quot;&quot;</span><span style="color: #66cc66;">&#41;</span> loader.<span style="color: #006600;">addVariable</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;tags&quot;</span>, tags<span style="color: #66cc66;">&#41;</span>;
	<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>title <span style="color: #66cc66;">!</span>= <span style="color: #ff0000;">&quot;&quot;</span><span style="color: #66cc66;">&#41;</span> loader.<span style="color: #006600;">addVariable</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;title&quot;</span>, title<span style="color: #66cc66;">&#41;</span>;
&nbsp;
	loader.<span style="color: #006600;">addVariable</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;description&quot;</span>, description<span style="color: #66cc66;">&#41;</span>;
	loader.<span style="color: #006600;">addVariable</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;is_public&quot;</span>, is_public ? <span style="color: #cc66cc;">1</span> : <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span>;
	loader.<span style="color: #006600;">addVariable</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;tags&quot;</span>, tags<span style="color: #66cc66;">&#41;</span>;
	loader.<span style="color: #006600;">addVariable</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;title&quot;</span>, title<span style="color: #66cc66;">&#41;</span>;
	loader.<span style="color: #0066CC;">load</span><span style="color: #66cc66;">&#40;</span>UPLOAD_DEST<span style="color: #66cc66;">&#41;</span>;
&nbsp;
	<span style="color: #808080; font-style: italic;">// Indicate that the upload process started</span>
	<span style="color: #b1b100;">return</span> <span style="color: #000000; font-weight: bold;">true</span>;
&nbsp;
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<p>You can download the modified Upload.as file <a href="http://blog.dannypatterson.com/wp-content/Upload.as.zip" target="_blank">here</a>.</p>
<p>You&#8217;ll also need download the <a href="http://code.google.com/p/in-spirit/source/browse/trunk/projects/MultipartURLLoader/ru/inspirit/net/MultipartURLLoader.as" target="_blank">MultipartURLLoader</a> and <a href="http://code.google.com/p/in-spirit/source/browse/trunk/projects/MultipartURLLoader/ru/inspirit/net/events/MultipartURLLoaderEvent.as" target="_blank">MultipartURLLoaderEvent</a> from the in-spirit google code repository.</p>
<p>Its very easy to use this in your application.  Here is some sample code that takes a screen shot of your app and sends it to flickr:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> screenShot:BitmapData = <span style="color: #000000; font-weight: bold;">new</span> BitmapData<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">width</span>, <span style="color: #0066CC;">height</span><span style="color: #66cc66;">&#41;</span>;
screenShot.<span style="color: #006600;">draw</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">this</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #000000; font-weight: bold;">var</span> encoder:JPEGEncoder = <span style="color: #000000; font-weight: bold;">new</span> JPEGEncoder<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">50</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #000000; font-weight: bold;">var</span> photoData:ByteArray = encoder.<span style="color: #006600;">encode</span><span style="color: #66cc66;">&#40;</span>screenShot<span style="color: #66cc66;">&#41;</span>;
upload = <span style="color: #000000; font-weight: bold;">new</span> Upload<span style="color: #66cc66;">&#40;</span>flickrService<span style="color: #66cc66;">&#41;</span>;
upload.<span style="color: #006600;">uploadBytes</span><span style="color: #66cc66;">&#40;</span>photoData, <span style="color: #ff0000;">&quot;test&quot;</span>, <span style="color: #ff0000;">&quot;test&quot;</span>, <span style="color: #ff0000;">&quot;test&quot;</span>, <span style="color: #000000; font-weight: bold;">true</span>, <span style="color: #000000; font-weight: bold;">false</span>, <span style="color: #000000; font-weight: bold;">false</span>, <span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">2</span>, <span style="color: #000000; font-weight: bold;">false</span><span style="color: #66cc66;">&#41;</span>;</pre></td></tr></table></div>

<p>Note: You must authenticate with WRITE accress using the AS3 Flickr Library authentication classes before you can upload.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.dannypatterson.com/?feed=rss2&amp;p=250</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Flash Peer-to-Peer at Flashbelt</title>
		<link>http://blog.dannypatterson.com/?p=216</link>
		<comments>http://blog.dannypatterson.com/?p=216#comments</comments>
		<pubDate>Sun, 07 Jun 2009 22:02:58 +0000</pubDate>
		<dc:creator>Danny Patterson</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://blog.dannypatterson.com/?p=216</guid>
		<description><![CDATA[I&#8217;ll be giving my Flash Player 10 Peer-to-Peer talk at Flashbelt  this week.  This will be my fifth Flashbelt and it’s by far my favorite conference of the year.  I not only love that fact that it’s in my backyard and I get to sleep in my own bed each night, but [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flashbelt.com"><img src="/wp-content/flashbelt09_speakertile200x120.gif" alt="Flashbelt 09" width="200" height="120" align="right" /></a>I&#8217;ll be giving my Flash Player 10 Peer-to-Peer talk at <a href="http://www.flashbelt.com">Flashbelt </a> this week.  This will be my fifth Flashbelt and it’s by far my favorite conference of the year.  I not only love that fact that it’s in my backyard and I get to sleep in my own bed each night, but the conference is run to perfection; great speakers and a great atmosphere.  I&#8217;m really looking forward to it this year.  See you there!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.dannypatterson.com/?feed=rss2&amp;p=216</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Transparent Background Image in Flex</title>
		<link>http://blog.dannypatterson.com/?p=211</link>
		<comments>http://blog.dannypatterson.com/?p=211#comments</comments>
		<pubDate>Wed, 03 Jun 2009 18:23:25 +0000</pubDate>
		<dc:creator>Danny Patterson</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://blog.dannypatterson.com/?p=211</guid>
		<description><![CDATA[Here is a quick tip for setting a transparent image as the background of your Flex application.  If you want that transparency to pass through to the HTML page you would set your wmode to &#8220;transparent.&#8221;  But even after you set your transparent background image you&#8217;ll notice that default blue background still shows [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a quick tip for setting a transparent image as the background of your Flex application.  If you want that transparency to pass through to the HTML page you would set your wmode to &#8220;transparent.&#8221;  But even after you set your transparent background image you&#8217;ll notice that default blue background still shows through.  And yu can&#8217;t set the backgroundAlpha to 0 since that would also hide your background image.  What you need to know is that the backgroundColor is defaulted to that blue color, so you must set the backgroundColor to undefined so your application has no background color:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="actionscript" style="font-family:monospace;">Application <span style="color: #66cc66;">&#123;</span>
    backgroundImage: Embed<span style="color: #66cc66;">&#40;</span>source=<span style="color: #ff0000;">&quot;/assets/Background.png&quot;</span><span style="color: #66cc66;">&#41;</span>;
    <span style="color: #0066CC;">backgroundColor</span>: <span style="color: #0066CC;">undefined</span>;
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.dannypatterson.com/?feed=rss2&amp;p=211</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>SharedObject Best Practices</title>
		<link>http://blog.dannypatterson.com/?p=209</link>
		<comments>http://blog.dannypatterson.com/?p=209#comments</comments>
		<pubDate>Fri, 29 May 2009 16:43:14 +0000</pubDate>
		<dc:creator>Danny Patterson</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://blog.dannypatterson.com/?p=209</guid>
		<description><![CDATA[I downloaded the Hulu Desktop application today and when it threw a runtime error (since I have my shared objects disabled by default) I decided it was finally time to blog about best practices when working with Shared Objects.
First, your code should never be &#8220;dependant&#8221; on a Shared Object being set.  The user has [...]]]></description>
			<content:encoded><![CDATA[<p>I downloaded the Hulu Desktop application today and when it threw a runtime error (since I have my shared objects disabled by default) I decided it was finally time to blog about best practices when working with Shared Objects.</p>
<p>First, your code should never be &#8220;dependant&#8221; on a Shared Object being set.  The user has full control to disable Shared Objects just like they can with browser cookies.  If it absulutely must be set, then you should at least show a graceful degredation to the user explaining that they won&#8217;t get the full expereince without enabling shared objects.</p>
<p>Second, you should allways put your shared object code inside a try&#8230;catch statement.  If the user does have Shared Objects disabled by default, a runtime error will be thrown (and shown if they have the debug player) when you try to write to a Shared Object.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.dannypatterson.com/?feed=rss2&amp;p=209</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Adobe&#8217;s Flex Builder rebranded as Flash Builder</title>
		<link>http://blog.dannypatterson.com/?p=205</link>
		<comments>http://blog.dannypatterson.com/?p=205#comments</comments>
		<pubDate>Sun, 17 May 2009 02:21:38 +0000</pubDate>
		<dc:creator>Danny Patterson</dc:creator>
				<category><![CDATA[Adobe]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://blog.dannypatterson.com/?p=205</guid>
		<description><![CDATA[As you may have heard, Adobe has decided to rebrand Flex Builder as Flash Builder to go along with the Flash Platform initiative.  I actually think this is a really good idea.  Flash Player has always been the platform and the vehicle that has allowed developers to deliver amazing experiences for years.  [...]]]></description>
			<content:encoded><![CDATA[<p>As you may have heard, Adobe has decided to rebrand Flex Builder as Flash Builder to go along with the Flash Platform initiative.  I actually think this is a really good idea.  Flash Player has always been the platform and the vehicle that has allowed developers to deliver amazing experiences for years.  Flex is a great framework that I personally use on 90% of my projects, but I don&#8217;t think the IDE (Flash Builder) should be limited to a single framework.</p>
<p>The only problem I have with the name change is that it doesn&#8217;t go far enough.  When I say Flash, what is the first thing you think of?  If you&#8217;re a Flash developer, you probably think of Flash Professional.  This is an authoring tool that has been around for years and until Flex Builder it was our only “Adobe” tool for creating SWFs.  It’s NOT a programming tool.  Therefore most Flash programmers welcomed Adobe’s attempt at a real programmers IDE with Flex Builder.  It isn’t perfect, but it’s better than any alternative.  (Yes I’ve tried FDT, but I can’t live without the debugger.)</p>
<p>So my problem with the new Flash branding is the name of Flash Professional.  This tool is based on a timeline and is geared toward designers.  I personally think this should be renamed to Flash Designer.  This would help reduce confusion for new developers to the Flash Platform and put clarity into the entire Flash product line.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.dannypatterson.com/?feed=rss2&amp;p=205</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Trillian Astra Beta</title>
		<link>http://blog.dannypatterson.com/?p=202</link>
		<comments>http://blog.dannypatterson.com/?p=202#comments</comments>
		<pubDate>Fri, 15 May 2009 16:17:12 +0000</pubDate>
		<dc:creator>Danny Patterson</dc:creator>
				<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://blog.dannypatterson.com/?p=202</guid>
		<description><![CDATA[I just got an invitation to join the Trillian Astra Beta and so far I&#8217;m very impressed.  I&#8217;ve been a Trillian user for years and for me it’s always been the best way to manage my IM contacts across AOL, Yahoo, MSN, etc.  Astra also adds support for Facebook and twitter, maybe I&#8217;ll [...]]]></description>
			<content:encoded><![CDATA[<p>I just got an invitation to join the <a href="http://www.trillian.im/">Trillian Astra</a> Beta and so far I&#8217;m very impressed.  I&#8217;ve been a Trillian user for years and for me it’s always been the best way to manage my IM contacts across AOL, Yahoo, MSN, etc.  Astra also adds support for Facebook and twitter, maybe I&#8217;ll start using those more now that they are in a familiar place for me.  The main barrier for me not using Facebook or twitter much was because I didn&#8217;t want to constantly login to those sites or install a dedicated application.  I always hated that about the old messenger applications when you had to have three different apps running.  Looks like the <a href="http://www.trillian.im/signup.html">Beta signup </a>page is open for anyone, if you&#8217;re an existing Trillian users, I think you&#8217;ll really like this new version.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.dannypatterson.com/?feed=rss2&amp;p=202</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
