<?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>James Ward - RIA Cowboy &#187; Adobe AIR</title>
	<atom:link href="http://www.jamesward.com/category/flash-platform/air/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jamesward.com</link>
	<description>Rich Internet Applications &#124; Flex &#124; Adobe AIR &#124; Java &#124; Open Source &#124; Linux &#124; Enterprise Software &#124; Cloud</description>
	<lastBuildDate>Tue, 24 Aug 2010 16:03:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Video: Introduction to the New Adobe AIR Launchpad</title>
		<link>http://www.jamesward.com/2010/08/24/video-introduction-to-the-new-adobe-air-launchpad/</link>
		<comments>http://www.jamesward.com/2010/08/24/video-introduction-to-the-new-adobe-air-launchpad/#comments</comments>
		<pubDate>Tue, 24 Aug 2010 16:03:01 +0000</pubDate>
		<dc:creator>James Ward</dc:creator>
				<category><![CDATA[Adobe AIR]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://www.jamesward.com/?p=1970</guid>
		<description><![CDATA[I just created a video that walks through the new Adobe AIR Launchpad. The AIR Launchpad is the easiest way to get started building desktop apps with Adobe AIR and Flex. Check it out:]]></description>
			<content:encoded><![CDATA[<p>I just created a video that walks through the new <a href="http://labs.adobe.com/technologies/airlaunchpad/">Adobe AIR Launchpad</a>.  The AIR Launchpad is the easiest way to get started building desktop apps with Adobe AIR and Flex.  Check it out:<br />
<object width="640" height="505"><param name="movie" value="http://www.youtube.com/v/_zHVuWfjLHg?fs=1&amp;hl=en_US&amp;rel=0&amp;hd=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/_zHVuWfjLHg?fs=1&amp;hl=en_US&amp;rel=0&amp;hd=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="505"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jamesward.com/2010/08/24/video-introduction-to-the-new-adobe-air-launchpad/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Building Client / Cloud Apps with Flash Builder for Force.com</title>
		<link>http://www.jamesward.com/2010/07/26/building-client-cloud-apps-with-flash-builder-for-force-com/</link>
		<comments>http://www.jamesward.com/2010/07/26/building-client-cloud-apps-with-flash-builder-for-force-com/#comments</comments>
		<pubDate>Mon, 26 Jul 2010 19:15:25 +0000</pubDate>
		<dc:creator>James Ward</dc:creator>
				<category><![CDATA[Adobe AIR]]></category>
		<category><![CDATA[Cloud]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Salesforce.com]]></category>

		<guid isPermaLink="false">http://www.jamesward.com/?p=1894</guid>
		<description><![CDATA[I have a theory. The majority of people who use enterprise software today use old school Client / Server apps. We&#8217;ve been trying to move these apps to the web for more than ten years. The ease of deployment of web apps is a clear motivator. Yet the client capabilities of the plain old web [...]]]></description>
			<content:encoded><![CDATA[<p>I have a theory.  The majority of people who use enterprise software today use old school Client / Server apps.  We&#8217;ve been trying to move these apps to the web for more than ten years.  The ease of deployment of web apps is a clear motivator.  Yet the client capabilities of the plain old web browser have not been sufficient for many apps to make the leap.  This is why I love Flex and the Flash Platform.  It provides a way to use web technologies and the web deployment model but adds many of the critical things needed for mission critical apps that people use all day long.</p>
<p>But no one wants to go back to the Client / Server architecture.  We want to embrace Cloud Computing architectures but not lose the client capabilities.  What we really need is the Client / Cloud architecture.  We need a web deployment model that provides ease of deployment but also the ability to install applications on our desktops and mobile devices.</p>
<p>This is why I&#8217;m so excited about the new <a href="http://developer.force.com/flashbuilder">Adobe Flash Builder for Force.com</a>.  In a nutshell this is a tool that Adobe and Salesforce.com built together to enable developers to build great software using Flex for the UI and Force.com for the Cloud back-end.  It&#8217;s a wonderful combination of technologies that will help many Client / Server apps make the switch to Client / Cloud.</p>
<p>Applications created with Flash Builder for Force.com can be run in the browser, on the desktop, and on mobile devices.  These applications can be assembled from the hundreds of Flex components that are out there (check out many of them in <a href="http://flex.org/tour">Tour de Flex</a>).</p>
<p>Check out this video to see how to use Flash Builder for Force.com to build a simple app:</p>
<p><object width="640" height="385"><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=7230&#038;context=64&#038;embeded=true&#038;environment=production"></param><embed src="http://images.tv.adobe.com/swf/player.swf" flashvars="fileID=7230&#038;context=64&#038;embeded=true&#038;environment=production" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="385"></embed></object></p>
<p>As you can see, it&#8217;s very easy to get started.  But I wanted to go a step further and try to build something real&#8211;something that shows a genuine use case for extending beyond the out-of-the-box Salesforce.com UI.  I wanted to keep it really simple so that I could post the code here.  What I came up with is this (in user story form):</p>
<ul>
<li>As a Salesforce.com user I want to take a photo, using my phone, of one of my contacts so that the photo can be saved to their contact record for future reference.</li>
<li>As a Salesforce.com user I want to see photos I&#8217;ve taken of my contacts so that I can be reminded of what they look like.</li>
</ul>
<p>Simple enough.  So here is what I came up with:</p>
<p><object width="640" height="505"><param name="movie" value="http://www.youtube.com/v/RIUwh6wk8cY&amp;hl=en_US&amp;fs=1?rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/RIUwh6wk8cY&amp;hl=en_US&amp;fs=1?rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="505"></embed></object></p>
<p>To build these two apps I first downloaded and installed <a href="https://www.developerforce.com/events/flashbuilder/registration.php">Flash Builder for Force.com</a>.  I used the <a href="http://www.adobe.com/go/airbetasignup">Adobe AIR for Android prerelease</a> to build the mobile app.  Here is how I created these apps.</p>
<p>First I added a new field to Contact to store the photo.  Salesforce.com doesn&#8217;t have a binary field so I used a large text field (32k limit).  I&#8217;ll store the photo Base64 encoded.</p>
<p>Then in Salesforce.com I saved my enterprise.wsdl file. Check out a <a href="http://wiki.developerforce.com/index.php/Demo_Building_Desktop_Client_for_the_Cloud">great video from Dave Carroll</a> to see how to do this.</p>
<p>Now in Flash Builder for Force.com I created a new Force.com Flex Project for the mobile app.  If you do this on your own and want to run on a mobile device then you will need to overlay the AIR for Android SDK on top of a Flex 4.1 SDK.  Select Desktop Application as the app type.  Replace WindowedApplication with just Application.  And replace the F3DesktopApplication with F3WebApplication since F3DesktopApplication uses APIs that are not available on AIR for Android.  (BTW: Flash Builder, Flex, and Force.com Flex Projects do not officially support mobile deployment yet.  It works but there is no support and no guarantees.)  If you are building a standard Web Application or Desktop Application then you can just leave the generated code as is.</p>
<p>Using the Data/Services wizard I connected to Salesforce.com using my enterprise.wsdl file.  After the services and value objects have been generated I modified the Contact object and added a Bindable account property.  The generated application already included the F3DesktopApplication Declaration used to connect to Salesforce.  Due to an incompatibility with that API and AIR for Android I switched it to use F3WebApplication.  In F3WebApplication&#8217;s loginComplete event handler I query Salesforce.com for Accounts and then Contacts, associate contacts with their account, and then store the contacts:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">app.<span style="color: #006600;">wrapper</span>.<span style="color: #006600;">query</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;select Id, Name from Account&quot;</span>, <span style="color: #000000; font-weight: bold;">new</span> AsyncResponder<span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">data</span>:ArrayCollection, token:<span style="color: #0066CC;">Object</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
    accounts = <span style="color: #0066CC;">data</span>;
    app.<span style="color: #006600;">wrapper</span>.<span style="color: #006600;">query</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;select Id, AccountId, FirstName, LastName, Phone, MobilePhone, Email, Title, Department, MailingCity, photoData__c from Contact&quot;</span>, <span style="color: #000000; font-weight: bold;">new</span> AsyncResponder<span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">data</span>:ArrayCollection, token:<span style="color: #0066CC;">Object</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
        <span style="color: #b1b100;">for</span> <span style="color: #b1b100;">each</span> <span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> contact:Contact <span style="color: #b1b100;">in</span> <span style="color: #0066CC;">data</span><span style="color: #66cc66;">&#41;</span>
        <span style="color: #66cc66;">&#123;</span>
            <span style="color: #b1b100;">for</span> <span style="color: #b1b100;">each</span> <span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> account:Account <span style="color: #b1b100;">in</span> accounts<span style="color: #66cc66;">&#41;</span>
            <span style="color: #66cc66;">&#123;</span>
                <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>account.<span style="color: #006600;">Id</span> == contact.<span style="color: #006600;">AccountId</span><span style="color: #66cc66;">&#41;</span>
                <span style="color: #66cc66;">&#123;</span>
                    contact.<span style="color: #006600;">account</span> = account;						
                <span style="color: #66cc66;">&#125;</span>
            <span style="color: #66cc66;">&#125;</span>
        <span style="color: #66cc66;">&#125;</span>
        contacts = <span style="color: #0066CC;">data</span>;
    <span style="color: #66cc66;">&#125;</span>, handleError<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>, handleError<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>Notice in the query that I&#8217;m fetching photoData__c, which is the custom field I created on Contact to store the photo.</p>
<p>In the renderer for a contact I need to either display the photo if there is one or let the user add one.  Here is the simple UI code to handle that:</p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Group</span> width=<span style="color: #ff0000;">&quot;92&quot;</span> height=<span style="color: #ff0000;">&quot;92&quot;</span> top=<span style="color: #ff0000;">&quot;8&quot;</span> right=<span style="color: #ff0000;">&quot;8&quot;</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Rect</span> width=<span style="color: #ff0000;">&quot;92&quot;</span> height=<span style="color: #ff0000;">&quot;92&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:fill</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:SolidColor</span> color=<span style="color: #ff0000;">&quot;#cccccc&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:fill</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Rect</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Label</span> id=<span style="color: #ff0000;">&quot;addPhoto&quot;</span> text=<span style="color: #ff0000;">&quot;Add a photo&quot;</span> width=<span style="color: #ff0000;">&quot;92&quot;</span> height=<span style="color: #ff0000;">&quot;92&quot;</span> verticalAlign=<span style="color: #ff0000;">&quot;middle&quot;</span> textAlign=<span style="color: #ff0000;">&quot;center&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:BitmapImage</span> id=<span style="color: #ff0000;">&quot;photo&quot;</span> width=<span style="color: #ff0000;">&quot;92&quot;</span> height=<span style="color: #ff0000;">&quot;92&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Group</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p>When the contact is set I check to see if there is a photo and if so display it:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>contact.<span style="color: #006600;">photoData__c</span> == <span style="color: #000000; font-weight: bold;">null</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#123;</span>
    photo.<span style="color: #0066CC;">visible</span> = <span style="color: #000000; font-weight: bold;">false</span>;
    <span style="color: #b1b100;">return</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">var</span> decoder:Base64Decoder = <span style="color: #000000; font-weight: bold;">new</span> Base64Decoder<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
decoder.<span style="color: #006600;">decode</span><span style="color: #66cc66;">&#40;</span>contact.<span style="color: #006600;">photoData__c</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #000000; font-weight: bold;">var</span> loader:Loader = <span style="color: #000000; font-weight: bold;">new</span> Loader<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
loader.<span style="color: #006600;">contentLoaderInfo</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">COMPLETE</span>, <span style="color: #000000; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>event:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
    photo.<span style="color: #006600;">source</span> = event.<span style="color: #0066CC;">target</span>.<span style="color: #006600;">content</span>;
    photo.<span style="color: #0066CC;">visible</span> = <span style="color: #000000; font-weight: bold;">true</span>;
<span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;
loader.<span style="color: #006600;">loadBytes</span><span style="color: #66cc66;">&#40;</span>decoder.<span style="color: #006600;">toByteArray</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>The data from the photoData__c field is Base64 decoded and then displayed using the Flex BitmapImage component.</p>
<p>Now when the user clicks on the photo or empty photo box I use the AIR for Android CameraUI to grab a photo, resize it, covert it to a PNG, Base64 encode it, set it on the contact, and then save the contact to Salesforce.com:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>CameraUI.<span style="color: #006600;">isSupported</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#123;</span>
    cameraUI = <span style="color: #000000; font-weight: bold;">new</span> CameraUI<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
    cameraUI.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MediaEvent.<span style="color: #006600;">COMPLETE</span>, <span style="color: #000000; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>event:MediaEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">var</span> loader:Loader = <span style="color: #000000; font-weight: bold;">new</span> Loader<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
        loader.<span style="color: #0066CC;">load</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> URLRequest<span style="color: #66cc66;">&#40;</span>event.<span style="color: #0066CC;">data</span>.<span style="color: #006600;">file</span>.<span style="color: #0066CC;">url</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
        loader.<span style="color: #006600;">contentLoaderInfo</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">COMPLETE</span>, <span style="color: #000000; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>event:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">var</span> bitmap:Bitmap = event.<span style="color: #0066CC;">target</span>.<span style="color: #006600;">content</span> as Bitmap;
&nbsp;
            <span style="color: #000000; font-weight: bold;">var</span> result:BitmapData = <span style="color: #000000; font-weight: bold;">new</span> BitmapData<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">46</span>, <span style="color: #cc66cc;">46</span>, <span style="color: #000000; font-weight: bold;">false</span><span style="color: #66cc66;">&#41;</span>;
            <span style="color: #000000; font-weight: bold;">var</span> matrix:Matrix = <span style="color: #000000; font-weight: bold;">new</span> Matrix<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
            matrix.<span style="color: #006600;">scale</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">46</span> <span style="color: #66cc66;">/</span> bitmap.<span style="color: #0066CC;">width</span>, <span style="color: #cc66cc;">46</span> <span style="color: #66cc66;">/</span> bitmap.<span style="color: #0066CC;">height</span><span style="color: #66cc66;">&#41;</span>;
            result.<span style="color: #006600;">draw</span><span style="color: #66cc66;">&#40;</span>bitmap, matrix<span style="color: #66cc66;">&#41;</span>;
&nbsp;
            <span style="color: #000000; font-weight: bold;">var</span> pngEncoder:PNGEncoder = <span style="color: #000000; font-weight: bold;">new</span> PNGEncoder<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
            <span style="color: #000000; font-weight: bold;">var</span> pngBytes:ByteArray = pngEncoder.<span style="color: #006600;">encode</span><span style="color: #66cc66;">&#40;</span>result<span style="color: #66cc66;">&#41;</span>;
&nbsp;
            <span style="color: #000000; font-weight: bold;">var</span> base64Encoder:Base64Encoder = <span style="color: #000000; font-weight: bold;">new</span> Base64Encoder<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
            base64Encoder.<span style="color: #006600;">encodeBytes</span><span style="color: #66cc66;">&#40;</span>pngBytes<span style="color: #66cc66;">&#41;</span>;
            <span style="color: #000000; font-weight: bold;">var</span> encodedImage:<span style="color: #0066CC;">String</span> = base64Encoder.<span style="color: #0066CC;">flush</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
            contact.<span style="color: #006600;">photoData__c</span> = encodedImage;
&nbsp;
            displayPhoto<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
            F3WebApplication.<span style="color: #006600;">getInstance</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">wrapper</span>.<span style="color: #006600;">save</span><span style="color: #66cc66;">&#40;</span>contact, <span style="color: #000000; font-weight: bold;">new</span> AsyncResponder<span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">data</span>:<span style="color: #0066CC;">Object</span>, token:<span style="color: #0066CC;">Object</span>=<span style="color: #000000; font-weight: bold;">null</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
            <span style="color: #66cc66;">&#125;</span>, FlexGlobals.<span style="color: #006600;">topLevelApplication</span>.<span style="color: #006600;">handleError</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
        <span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;
    <span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;
    cameraUI.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>ErrorEvent.<span style="color: #0066CC;">ERROR</span>, <span style="color: #000000; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>event:ErrorEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
        FlexGlobals.<span style="color: #006600;">topLevelApplication</span>.<span style="color: #006600;">handleError</span><span style="color: #66cc66;">&#40;</span>event<span style="color: #66cc66;">&#41;</span>;
    <span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;
    cameraUI.<span style="color: #006600;">launch</span><span style="color: #66cc66;">&#40;</span>MediaType.<span style="color: #006600;">IMAGE</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>That&#8217;s it for the mobile app!  I compiled it, exported it to an Android app, and then copied it to my phone.  Pretty simple and as you can see it works!  One limitation with my approach is the 32k limit of the photoData__c field.  However, I think I could easily get around that by striping the Base64 encoded data across multiple fields.  It&#8217;s not ideal but it would work.</p>
<p>To display the photo when I view a contact on Salesforce.com I created a very simple Flex app using another Force.com Flex Project.  I could have also added photo upload to this application but chose to keep it simple.  All it does is display the selected contact&#8217;s photo.  Here is the complete code (after generating the required services in Flash Builder):</p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #7400FF;">&gt;</span></span>
<span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Application</span> xmlns:fx=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span></span>
<span style="color: #000000;">    xmlns:s=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/spark&quot;</span></span>
<span style="color: #000000;">    xmlns:mx=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/mx&quot;</span></span>
<span style="color: #000000;">    xmlns:flexforforce=<span style="color: #ff0000;">&quot;http://flexforforce.salesforce.com&quot;</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Script</span><span style="color: #7400FF;">&gt;</span></span>		
    import mx.rpc.AsyncResponder;
    import mx.utils.Base64Decoder;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:Script</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;fx:Declarations</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;flexforforce:F</span>3WebApplication id=<span style="color: #ff0000;">&quot;app&quot;</span> requiredTypes=<span style="color: #ff0000;">&quot;Contact&quot;</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;flexforforce:loginComplete</span><span style="color: #7400FF;">&gt;</span></span>
                app.wrapper.query(&quot;select photoData__c from Contact where Id = '&quot; + this.parameters.contactId + &quot;'&quot;, new AsyncResponder(function(data:Object, token:Object):void {
                    if (data.length == 1)
                    {
                        if (data[0].photoData__c == null)
                        {
                            photo.visible = false;
                            noPhoto.visible = true;
                            return;
                        }
&nbsp;
                        var decoder:Base64Decoder = new Base64Decoder();
                        decoder.decode(data[0].photoData__c);
&nbsp;
                        var loader:Loader = new Loader();
                        loader.contentLoaderInfo.addEventListener(Event.COMPLETE, function(event:Event):void {
                            photo.source = event.target.content;
                            photo.visible = true;
                        });
                        loader.loadBytes(decoder.toByteArray());
                    }
                }, function(fault:Object):void {
                    // ignored
                }));
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;/flexforforce:loginComplete</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/flexforforce:F</span>3WebApplication<span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/fx:Declarations</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:applicationComplete</span><span style="color: #7400FF;">&gt;</span></span>
        app.serverUrl = this.parameters.serverUrl;
        app.loginBySessionId(this.parameters.sessionId);
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:applicationComplete</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Rect</span> width=<span style="color: #ff0000;">&quot;92&quot;</span> height=<span style="color: #ff0000;">&quot;92&quot;</span><span style="color: #7400FF;">&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:fill</span><span style="color: #7400FF;">&gt;</span></span>
            <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:SolidColor</span> color=<span style="color: #ff0000;">&quot;#cccccc&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
        <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:fill</span><span style="color: #7400FF;">&gt;</span></span>
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Rect</span><span style="color: #7400FF;">&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:Label</span> id=<span style="color: #ff0000;">&quot;noPhoto&quot;</span> text=<span style="color: #ff0000;">&quot;No Photo&quot;</span> width=<span style="color: #ff0000;">&quot;92&quot;</span> height=<span style="color: #ff0000;">&quot;92&quot;</span> textAlign=<span style="color: #ff0000;">&quot;center&quot;</span> verticalAlign=<span style="color: #ff0000;">&quot;middle&quot;</span> visible=<span style="color: #ff0000;">&quot;false&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
    <span style="color: #000000;"><span style="color: #7400FF;">&lt;s:BitmapImage</span> id=<span style="color: #ff0000;">&quot;photo&quot;</span> width=<span style="color: #ff0000;">&quot;92&quot;</span> height=<span style="color: #ff0000;">&quot;92&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
&nbsp;
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/s:Application</span><span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p>Finally I created a custom S-Control to run the Flex app:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">object</span> <span style="color: #000066;">classid</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;clsid:D27CDB6E-AE6D-11cf-96B8-444553540000&quot;</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;ContactPhoto&quot;</span> <span style="color: #000066;">width</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;92&quot;</span> <span style="color: #000066;">height</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;92&quot;</span> </span>
<span style="color: #009900;"><span style="color: #000066;">codebase</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;https://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab&quot;</span>&gt;</span> 
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">param</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;movie&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;{!Scontrol.JavaArchive}&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span> 
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">param</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;flashvars&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;sessionId={!API.Session_ID}&amp;serverUrl={!API.Partner_Server_URL_90}&amp;contactId={!Contact.Id}&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span> 
    <span style="color: #009900;">&lt;embed <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;{!Scontrol.JavaArchive}&quot;</span> <span style="color: #000066;">width</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;92&quot;</span> <span style="color: #000066;">height</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;92&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;ContactPhoto&quot;</span> </span>
<span style="color: #009900;">flashvars<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;sessionId={!API.Session_ID}&amp;serverUrl={!API.Partner_Server_URL_90}&amp;contactId={!Contact.Id}&quot;</span> </span>
<span style="color: #009900;"><span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;application/x-shockwave-flash&quot;</span> </span>
<span style="color: #009900;">pluginspage<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://www.adobe.com/go/getflashplayer&quot;</span>&gt;</span> 
    <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span>embed&gt;</span> 
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">object</span>&gt;</span></pre></div></div>

<p>I uploaded the compiled Flex app to the S-Control and added it to the Contact page.  And that&#8217;s it!  In just a few hours I extended Force.com and built a cool mobile app.  I could also have easily created a desktop widget for browsing contacts and adding photos.  If you are looking for a fun project to use as a way to learn this stuff that would be a good one!  :)</p>
<p>Here are some resources to help you get started with Flash Builder for Force.com:</p>
<ul>
<li><a href="http://wiki.developerforce.com/index.php/Force.com_Flex_Quick_Start_Tutorial">Force.com Flex Quick Start Tutorial</a></li>
<li><a href="http://developerforce.s3.amazonaws.com/website/afb/docs/ASDoc_Flex/index.html">Force.com Flex Project APIs for Web Applications</a></li>
<li><a href="http://developerforce.s3.amazonaws.com/website/afb/docs/ASDoc_AIR/index.html">Force.com Flex Project APIs for Desktop Applications</a></li>
<li><a href="http://developer.force.com/flashbuilder">Numerous other demo applications and tutorials</a></li>
<li><a href="http://github.com/jlward4th/MobileContacts">Source code for my mobile contacts demo</a></li>
<li><a href="http://github.com/jlward4th/WebContactSControl">Source code for my web contact photo viewer demo</a></li>
</ul>
<p>Have fun building the next generation of software!  Let me know how it goes.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jamesward.com/2010/07/26/building-client-cloud-apps-with-flash-builder-for-force-com/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Tour de Flex 2.0 &#8211; Nearly 500 Flex Examples!</title>
		<link>http://www.jamesward.com/2010/06/21/tour-de-flex-2-0-nearly-500-flex-examples/</link>
		<comments>http://www.jamesward.com/2010/06/21/tour-de-flex-2-0-nearly-500-flex-examples/#comments</comments>
		<pubDate>Mon, 21 Jun 2010 15:45:42 +0000</pubDate>
		<dc:creator>James Ward</dc:creator>
				<category><![CDATA[Adobe AIR]]></category>
		<category><![CDATA[Flash Player]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://www.jamesward.com/?p=1827</guid>
		<description><![CDATA[Adobe has just launched the new AIR 2 based Tour de Flex version 2.0 which now contains almost 500 Flex examples! The new version has new AIR 2 examples (only available in the AIR version of Tour de Flex) including: File Promises Mass Storage Detection Native Process Open with default app Socket Server Also there [...]]]></description>
			<content:encoded><![CDATA[<p>Adobe has just launched the new AIR 2 based <a href="http://flex.org/tour">Tour de Flex version 2.0</a> which now contains almost 500 Flex examples!  The new version has new AIR 2 examples (only available in the AIR version of Tour de Flex) including:</p>
<ul>
<li>File Promises</li>
<li>Mass Storage Detection</li>
<li>Native Process</li>
<li>Open with default app</li>
<li>Socket Server</li>
</ul>
<p>Also there are some great examples of the new Flash Player 10.1 and AIR 2 APIs including:</p>
<ul>
<li>Gestures</li>
<li>Global Error Handler</li>
<li>Globalization / Internationalization</li>
<li>Microphone access</li>
</ul>
<p>Those are some great examples but my favorite is still <a href="http://dougmccune.com/blog/">Doug McCune&#8217;s</a> <a href="http://www.adobe.com/devnet/flex/tourdeflex/web/#docIndex=0;illustIndex=0;sampleId=16300">Physics Form</a> followed closely by the <a href="http://www.adobe.com/devnet/flex/tourdeflex/web/#docIndex=-1;illustIndex=0;sampleId=14050">real-time Tour de Flex Dashboard</a>.  :)</p>
<p>If you already have Tour de Flex installed then it should auto update to the latest version when you launch it.  Otherwise install it now using the badge installer below.<br />
<iframe width="216" height="182" frameborder=0 scrolling="no" src="http://tourdeflex.adobe.com/badge/"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jamesward.com/2010/06/21/tour-de-flex-2-0-nearly-500-flex-examples/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Flex on Android in Flash Player and AIR</title>
		<link>http://www.jamesward.com/2010/05/21/flex-on-android-in-flash-player-and-air/</link>
		<comments>http://www.jamesward.com/2010/05/21/flex-on-android-in-flash-player-and-air/#comments</comments>
		<pubDate>Fri, 21 May 2010 16:07:18 +0000</pubDate>
		<dc:creator>James Ward</dc:creator>
				<category><![CDATA[Adobe AIR]]></category>
		<category><![CDATA[Flash Player]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Mobile]]></category>

		<guid isPermaLink="false">http://www.jamesward.com/?p=1743</guid>
		<description><![CDATA[This week at the Google I/O conference Adobe announced that a Flash Player 10.1 beta and an Adobe AIR prerelease are now available for Android devices. This is really exciting news for those of us building apps on the Flash Platform because now we can begin building apps in Flex for these mobile devices (and [...]]]></description>
			<content:encoded><![CDATA[<p>This week at the Google I/O conference Adobe announced that a Flash Player 10.1 beta and an Adobe AIR prerelease are now available for Android devices.  This is really exciting news for those of us building apps on the Flash Platform because now we can begin building apps in Flex for these mobile devices (and many others coming soon).</p>
<p>Take a look a some of the quick demos I&#8217;ve built with Flex running on Android in Flash Player and AIR:<br />
<object width="640" height="385"><param name="movie" value="http://www.youtube.com/v/Zp7leMUo2NY&#038;hl=en_US&#038;fs=1&#038;rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/Zp7leMUo2NY&#038;hl=en_US&#038;fs=1&#038;rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="385"></embed></object><br />
You can get the source code for all of these demos from <a href="http://github.com/jlward4th">github</a>.</p>
<p>Also <a href="http://coenraets.org">Christophe Coenraets</a> has posted some great Flex mobile demos.  Check out his <a href="http://coenraets.org/blog/2010/05/sample-application-using-flex-and-air-for-android/">Employee Directory</a> and <a href="http://coenraets.org/blog/2010/05/android-trader-application-with-flex-4-and-air/">Stock Trader</a> demos.</p>
<p>These are very exciting times for developers!</p>
<p>If you want to check out the Flash Player 10.1 beta for Android it will be available in the Android Marketplace for Android 2.2 devices.  You can try Adobe AIR for Android today by <a href="http://blogs.adobe.com/air/2010/05/air_android_prerelease.html">signing up for the prerelease</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jamesward.com/2010/05/21/flex-on-android-in-flash-player-and-air/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>Video: Build your First Desktop Application with Flash Builder</title>
		<link>http://www.jamesward.com/2010/04/01/video-build-your-first-desktop-application-with-flash-builder/</link>
		<comments>http://www.jamesward.com/2010/04/01/video-build-your-first-desktop-application-with-flash-builder/#comments</comments>
		<pubDate>Thu, 01 Apr 2010 13:47:35 +0000</pubDate>
		<dc:creator>James Ward</dc:creator>
				<category><![CDATA[Adobe AIR]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://www.jamesward.com/?p=1667</guid>
		<description><![CDATA[In this video I walk through the basics of building Adobe AIR desktop applications in Flash Builder 4 using the Flex 4 SDK. Let me know what you think.]]></description>
			<content:encoded><![CDATA[<p>In this video I walk through the basics of building Adobe AIR desktop applications in Flash Builder 4 using the Flex 4 SDK.  Let me know what you think.</p>
<p><object width="640" height="385"><param name="movie" value="http://www.youtube.com/v/IkWkZGLm-jo&#038;hl=en_US&#038;fs=1&#038;rel=0&#038;hd=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/IkWkZGLm-jo&#038;hl=en_US&#038;fs=1&#038;rel=0&#038;hd=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="385"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jamesward.com/2010/04/01/video-build-your-first-desktop-application-with-flash-builder/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>Time to Update to Flex SDK 3.5a</title>
		<link>http://www.jamesward.com/2010/02/12/time-to-update-to-flex-sdk-3-5a/</link>
		<comments>http://www.jamesward.com/2010/02/12/time-to-update-to-flex-sdk-3-5a/#comments</comments>
		<pubDate>Fri, 12 Feb 2010 19:44:40 +0000</pubDate>
		<dc:creator>James Ward</dc:creator>
				<category><![CDATA[Adobe AIR]]></category>
		<category><![CDATA[BlazeDS]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://www.jamesward.com/?p=1538</guid>
		<description><![CDATA[If you are using a Flex SDK before 3.5a then it&#8217;s probably time to update. Flex SDKs before 3.4 have a security vulnerability. I believe the problem is actually in the HTML template, so when you update make sure that you also update the HTML templates that you are using. The Flex SDK 3.4 had [...]]]></description>
			<content:encoded><![CDATA[<p>If you are using a Flex SDK before 3.5a then it&#8217;s probably time to update.  Flex SDKs before 3.4 have a <a href="http://www.adobe.com/support/security/bulletins/apsb09-13.html">security vulnerability</a>.  I believe the problem is actually in the HTML template, so when you update make sure that you also update the HTML templates that you are using.  The Flex SDK 3.4 had the <a href="https://bugs.adobe.com/jira/browse/SDK-22883">double responder bug</a>.  And the initial release of Flex SDK 3.5 had a <a href="https://bugs.adobe.com/jira/browse/SDK-24766">bug with AIR&#8217;s ApplicationUpdaterUI</a>.  If you overlay your own AIR SDK on top of the Flex SDK then be aware that you will actually be overwriting the ApplicationUpdaterUI fix (comments in the bug report discuss how to deal with that).</p>
<p>So it&#8217;s time to move to the <a href="http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+3">latest Flex SDK 3.5a</a>!</p>
<p>Also, if you are using BlazeDS, LCDS, or FDS then it&#8217;s time to update that as well due to <a href="http://www.adobe.com/support/security/bulletins/apsb10-05.html">a security vulnerability</a> that was published yesterday.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jamesward.com/2010/02/12/time-to-update-to-flex-sdk-3-5a/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Exciting Flash Platform Advancements</title>
		<link>http://www.jamesward.com/2009/12/16/exciting-flash-platform-advancements/</link>
		<comments>http://www.jamesward.com/2009/12/16/exciting-flash-platform-advancements/#comments</comments>
		<pubDate>Wed, 16 Dec 2009 20:56:44 +0000</pubDate>
		<dc:creator>James Ward</dc:creator>
				<category><![CDATA[Adobe AIR]]></category>
		<category><![CDATA[Flash Player]]></category>

		<guid isPermaLink="false">http://www.jamesward.com/blog/?p=1375</guid>
		<description><![CDATA[Recently there has been a number of exciting advancements with the Flash Platform (Flex, Flash Player, and Adobe AIR). Here is a quick round-up: Adobe released security updates for the Flash runtimes: Flash Player 10.0.42.34 and Adobe AIR 1.5.3. The Flash Player update fixes an issue with mouse scroll wheels not working in Flash when [...]]]></description>
			<content:encoded><![CDATA[<p>Recently there has been a number of exciting advancements with the Flash Platform (Flex, Flash Player, and Adobe AIR).  Here is a quick round-up:</p>
<p>Adobe released security updates for the Flash runtimes: <a href="http://www.adobe.com/go/gntray_dl_getflashplayer">Flash Player 10.0.42.34</a> and <a href="http://www.adobe.com/go/gntray_dl_getair">Adobe AIR 1.5.3</a>.  The Flash Player update fixes an issue with <a href="http://bugs.adobe.com/jira/browse/FP-503">mouse scroll wheels not working in Flash when using Safari</a>.</p>
<p>Recently, Adobe also released public betas for <a href="http://labs.adobe.com/technologies/air2/">Adobe AIR 2</a> and <a href="http://labs.adobe.com/downloads/flashplayer10.html">Flash Player 10.1</a>.  This Flash Player release fixes the &#8220;<a href="http://bugs.adobe.com/jira/browse/FP-40">Incorrect unicode input in Linux</a>&#8221; bug.  Both AIR 2 and Flash Player 10.1 have a new API for Global Exception Handling (which was <a href="http://bugs.adobe.com/jira/browse/FP-444">one of the highest rated feature requests</a> on <a href="http://bugs.adobe.com">bugs.adobe.com</a>).  Check out <a href="http://flex.org/tour">Tour de Flex</a> for some new samples on how to use this new and other new APIs.</p>
<p>For those looking to build Flex applications in the enterprise, Adobe has posted two great resources.  First is a <a href="http://www.adobe.com/products/player_census/flashplayer/enterprise_penetration.html">third-party study</a> that says <b>enterprise penetration of Flash Player 9 (or better) is at 97.6%!</b>  Second is a fantastic white paper about <a href="http://www.flashforbiz.com/Index.asp">The Business Benefits of Rich Internet Applications</a> &#8211; a must read for anyone in the enterprise who is evaluating Flex.</p>
<p>Last is a short video of me at Adobe MAX 2009 where I talk about the progress that Adobe is making in getting the Flash Platform onto the many screens in our lives and why that is exciting for developers.  Let me know what you think!<br />
<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=4141&#038;context=76&#038;embeded=true&#038;environment=production"></param><embed src="http://images.tv.adobe.com//swf/player.swf" flashvars="fileID=4141&#038;context=76&#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://www.jamesward.com/2009/12/16/exciting-flash-platform-advancements/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>RIAs on the Web, on the Desktop, and in a PDF</title>
		<link>http://www.jamesward.com/2009/09/13/rias-on-the-web-on-the-desktop-and-in-a-pdf/</link>
		<comments>http://www.jamesward.com/2009/09/13/rias-on-the-web-on-the-desktop-and-in-a-pdf/#comments</comments>
		<pubDate>Sun, 13 Sep 2009 21:30:51 +0000</pubDate>
		<dc:creator>James Ward</dc:creator>
				<category><![CDATA[Adobe AIR]]></category>
		<category><![CDATA[Flash Player]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[PDF]]></category>

		<guid isPermaLink="false">http://www.jamesward.com/blog/?p=1200</guid>
		<description><![CDATA[Some believe that the &#8220;Internet&#8221; in &#8220;rich Internet application&#8221; (RIA) means that RIAs must only run in the browser. However my definition of RIA is not constrained to only web-based applications. RIAs can run anywhere: web, desktop, mobile devices, TVs, or even inside PDFs. Ideally we should have some level of code and library reusability [...]]]></description>
			<content:encoded><![CDATA[<p>Some believe that the &#8220;Internet&#8221; in &#8220;rich Internet application&#8221; (RIA) means that RIAs must only run in the browser.  However my <a href="http://www.jamesward.com/blog/2007/10/17/what-is-a-rich-internet-application/">definition of RIA</a> is not constrained to only web-based applications.  RIAs can run anywhere: web, desktop, mobile devices, TVs, or even <a href="http://www.jamesward.com/blog/2008/11/05/portable-rias-flex-apps-in-pdfs/">inside PDFs</a>.  Ideally we should have some level of code and library reusability between these environments.  However to think that we can reuse the entire application is a pipe dream.  Client capabilities and end user needs vary too greatly between these mediums.</p>
<p>I wanted to build an application in Flex that shows how applications can have a high degree of reuse between the web, the desktop, and in a PDF.  I decided to build a Mortgage Calculator to illustrate this.  Here is the web widget:<br />
<iframe src="/mortgageCalc/mortgageCalcWeb.html" width="100%" height="540"></iframe></p>
<p>From within the web widget you can install the desktop widget or email yourself a PDF containing the widget.  Since this application is a small, self contained application (i.e. a widget) the functionality between the different mediums is very similar.  In this case I was able to reuse about 99% of the code between the different versions.  However, sometimes achieving that level of reuse is not possible due to the differences in client capabilities and the end user needs.  This is the case with the Flex and Adobe AIR based <a href="http://www.oracle.com/applications/crm/siebel/crm-gadgets.html">Oracle CRM Gadgets</a>, which are for different use cases than the primary Siebel UI.</p>
<p>There are beginning to be more instances where RIA widgets are being reused across different mediums.  But this is only one piece of software development.  In other instances the capabilities and functionality of web, desktop, and mobile applications vary so greatly that there is little reuse.  Either way it&#8217;s important to architect our back ends such that they are agnostic to the front end.  This is one of the ways RIA and mobile app development have changed the way we build software.  It&#8217;s a good thing and we should embrace it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jamesward.com/2009/09/13/rias-on-the-web-on-the-desktop-and-in-a-pdf/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>My MAX 2009 Sessions</title>
		<link>http://www.jamesward.com/2009/09/01/my-max-2009-sessions/</link>
		<comments>http://www.jamesward.com/2009/09/01/my-max-2009-sessions/#comments</comments>
		<pubDate>Tue, 01 Sep 2009 17:09:16 +0000</pubDate>
		<dc:creator>James Ward</dc:creator>
				<category><![CDATA[Adobe AIR]]></category>
		<category><![CDATA[Augmented Reality]]></category>
		<category><![CDATA[BlazeDS]]></category>
		<category><![CDATA[Conferences]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[LCDS]]></category>

		<guid isPermaLink="false">http://www.jamesward.com/blog/?p=1148</guid>
		<description><![CDATA[MAX 2009 is coming fast! It&#8217;s going to be another great event with tons of great speakers and after party fun. Here are my sessions this year: Introduction to BlazeDS and LiveCycle Data Services Designing for Augmented Reality Building Flex and Adobe AIR Service Clients 2009 Flex and Adobe AIR Boot Camp Also Drunk on [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://max.adobe.com/">MAX 2009</a> is coming fast!  It&#8217;s going to be another great event with tons of great speakers and after party fun.  Here are my sessions this year:</p>
<ul>
<li><a href="http://max.adobe.com/scheduler/#view=1;session=38f90275-4f7f-4c9e-9456-a87ae4428a8a">Introduction to BlazeDS and LiveCycle Data Services</a></li>
<li><a href="http://max.adobe.com/scheduler/#view=1;session=3ed8c7b5-d2fc-4572-b4fd-44e7ab9b4da6">Designing for Augmented Reality</a></li>
<li><a href="http://max.adobe.com/scheduler/#view=1;session=51f7122b-42e8-4c10-ad75-d87e7a62aa98">Building Flex and Adobe AIR Service Clients 2009</a></li>
<li><a href="http://max.adobe.com/scheduler/#view=1;session=536613cb-9409-4187-81ec-7d00607c2786">Flex and Adobe AIR Boot Camp</a></li>
</ul>
<p>Also <a href="http://www.drunkonsoftware.com">Drunk on Software</a> will be there filming some episodes.</p>
<p>So this is certainly a MAX you don&#8217;t want to miss!  I hope to see you there!</p>
<p>Also check out the very cool MAX Widget (there are some funny facts about me in there):<br />
<img style="visibility:hidden;width:0px;height:0px;" border=0 width=0 height=0 src="http://counters.gigya.com/wildfire/IMP/CXNID=2000002.0NXC/bT*xJmx*PTEyNTE4MjI2MTI4MzgmcHQ9MTI1MTgyMjYyMjY5NSZwPTc3NDM3MSZkPW1heDA5d2lkZ2V*Jmc9MyZvPTRhYTY5MWUyMDYwZjQ4MzFhNDEyNDg4ZWVlOTMyN2VjJnM9d2Via2l*Y2hlbi5iZSZvZj*w.gif" /><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="MaxWidget" width="400" height="400" codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab"><param name="movie" value="http://max.adobe.com/widget/MaxWidget.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#869ca7" /><param name="allowScriptAccess" value="sameDomain" /><embed src="http://max.adobe.com/widget/MaxWidget.swf" quality="high" bgcolor="#869ca7" width="400" height="400" name="MaxWidget" align="middle" play="true" loop="false" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" FlashVars="crtr=1&#038;gig_lt=1251822612838&#038;gig_pt=1251822622695&#038;gig_g=3&#038;gig_s=webkitchen.be&#038;gig_crtr=1"></embed><param name="FlashVars" value="crtr=1&#038;gig_lt=1251822612838&#038;gig_pt=1251822622695&#038;gig_g=3&#038;gig_s=webkitchen.be&#038;gig_crtr=1" /></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jamesward.com/2009/09/01/my-max-2009-sessions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fonts in Flex 4 / Flash Player 10 / AIR 1.5 Make Me Happy</title>
		<link>http://www.jamesward.com/2009/08/11/fonts-in-flex-4-flash-player-10-air-1-5-make-me-happy/</link>
		<comments>http://www.jamesward.com/2009/08/11/fonts-in-flex-4-flash-player-10-air-1-5-make-me-happy/#comments</comments>
		<pubDate>Tue, 11 Aug 2009 22:05:52 +0000</pubDate>
		<dc:creator>James Ward</dc:creator>
				<category><![CDATA[Adobe AIR]]></category>
		<category><![CDATA[Flash Player]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://www.jamesward.com/blog/?p=1106</guid>
		<description><![CDATA[Device font rendering in Flash content has always had some limitations, including the inability for text to be correctly scaled, rotated, and faded. Due to these limitations many developers using Flex resort to embedding fonts. But this can really bloat the size of applications &#8211; especially when working with non-English languages. Luckily Flash Player 10 [...]]]></description>
			<content:encoded><![CDATA[<p>Device font rendering in Flash content has always had some limitations, including the inability for text to be correctly scaled, rotated, and faded.  Due to these limitations many developers using Flex resort to embedding fonts.  But this can really bloat the size of applications &#8211; especially when working with non-English languages.  Luckily Flash Player 10 / AIR 1.5 added a new font engine!  To make using the new engine easy Adobe also created an open source library called the <a href="http://opensource.adobe.com/wiki/display/tlf/Text+Layout+Framework">Text Layout Framework</a>, which wraps Flash Player&#8217;s low level text APIs.  Flex 4 Spark components use the Text Layout Framework for all text rendering.  The end result is much better device font support in Flex applications.  Here&#8217;s a quick example (<a href="http://www.jamesward.com/demos/fontTest/srcview/index.html">view source</a>):<br />
<iframe src="/demos/fontTest/fontTest.html" frameborder="0" height="410" width="500"></iframe><br />
Drag the slider to change the scaleX and scaleY on the Panels.  Notice how the Flex 3 / Flash Player 9 text jumps around and flickers.  And then notice how the Flex 4 / Flash Player 10 text looks wonderful as it scales up and down!  That makes me happy.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jamesward.com/2009/08/11/fonts-in-flex-4-flash-player-10-air-1-5-make-me-happy/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
	</channel>
</rss>
