<?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>SmartLogic Solutions Blog &#187; JavaScript</title>
	<atom:link href="http://blog.smartlogicsolutions.com/category/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.smartlogicsolutions.com</link>
	<description>News and updates from the people at SmartLogic Solutions</description>
	<lastBuildDate>Tue, 30 Nov 2010 21:39:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Testing AJAX with Test::Unit</title>
		<link>http://blog.smartlogicsolutions.com/2010/10/08/testing-ajax-with-testunit/</link>
		<comments>http://blog.smartlogicsolutions.com/2010/10/08/testing-ajax-with-testunit/#comments</comments>
		<pubDate>Fri, 08 Oct 2010 19:58:17 +0000</pubDate>
		<dc:creator>Nick Gauthier</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Nick Gauthier]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.smartlogicsolutions.com/?p=979</guid>
		<description><![CDATA[If you want real end-to-end testing of a page with functioning AJAX, use Selenium. But I was interested in doing just a bit of JS speccing to make sure that the AJAX routes I called worked and that the data that came back fit the JS that I had written. So, I figured with a [...]]]></description>
			<content:encoded><![CDATA[<p>If you want real end-to-end testing of a page with functioning AJAX, use Selenium. But I was interested in doing just a bit of JS speccing to make sure that the AJAX routes I called worked and that the data that came back fit the JS that I had written.</p>
<p>So, I figured with a little <a href="http://github.com/jnicklas/capybara">capybara</a> and a little <a href="http://github.com/cowboyd/therubyracer">therubyracer</a>, I could test my javascript with real route calls. Let&#8217;s check it out.<br />
<span id="more-979"></span></p>
<p>The Javascript I want to test:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> dataObject <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> getRemoteData <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  $.<span style="color: #660066;">getJSON</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'/remote_path.json'</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>data<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    dataObject <span style="color: #339933;">=</span> $.<span style="color: #660066;">parseJSON</span><span style="color: #009900;">&#40;</span>data<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>We will pretend that hitting /remote_path.json returns the following response in JSON:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #009900;">&#123;</span> <span style="color: #3366CC;">&quot;my_information&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;my response data&quot;</span> <span style="color: #009900;">&#125;</span></pre></div></div>

<p>I want to test:</p>
<ol>
<li>That /remote_path.json is accessible and returns information</li>
<li>That dataObject is populated with a Javascript Object containing the params I pass down</li>
</ol>
<p>Here is my commented testing code:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">  test <span style="color:#996600;">'get some information via ajax'</span> <span style="color:#9966CC; font-weight:bold;">do</span>
    <span style="color:#008000; font-style:italic;"># Create a new JS Context. :with =&gt; self means that</span>
    <span style="color:#008000; font-style:italic;"># the global namespace is the current context</span>
    js = <span style="color:#6666ff; font-weight:bold;">V8::Context</span>.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:with</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0000FF; font-weight:bold;">self</span><span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
    <span style="color:#008000; font-style:italic;"># Load up our JS file</span>
    js.<span style="color:#CC0066; font-weight:bold;">load</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">join</span><span style="color:#006600; font-weight:bold;">&#40;</span>Rails.<span style="color:#9900CC;">root</span>, <span style="color:#996600;">'public'</span>, <span style="color:#996600;">'javascripts'</span>, <span style="color:#996600;">'application.js'</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
    <span style="color:#008000; font-style:italic;"># Define a mock method for getting JSON data</span>
    <span style="color:#9966CC; font-weight:bold;">def</span> getJSON<span style="color:#006600; font-weight:bold;">&#40;</span>url, callback<span style="color:#006600; font-weight:bold;">&#41;</span>
      <span style="color:#008000; font-style:italic;"># When the JS wants some data, get it for real w/ capybara</span>
      visit url
      <span style="color:#008000; font-style:italic;"># And call the JS function passed in (ruby =&gt; js)</span>
      callback.<span style="color:#9900CC;">call</span><span style="color:#006600; font-weight:bold;">&#40;</span>page.<span style="color:#9900CC;">body</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
    js.<span style="color:#CC0066; font-weight:bold;">eval</span> <span style="color:#006600; font-weight:bold;">%</span><span style="color:#006600; font-weight:bold;">&#123;</span>
      <span style="color:#006600; font-weight:bold;">/*</span> Mock out jQuery <span style="color:#006600; font-weight:bold;">*/</span>
      var $ = <span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#006600; font-weight:bold;">&#125;</span>;
&nbsp;
      <span style="color:#006600; font-weight:bold;">/*</span> Setup the mock <span style="color:#9966CC; font-weight:bold;">in</span> the right place <span style="color:#006600; font-weight:bold;">&#40;</span>JS <span style="color:#006600; font-weight:bold;">=&gt;</span> ruby<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">*/</span>
      $.<span style="color:#9900CC;">getJSON</span> = getJSON; 
&nbsp;
      <span style="color:#006600; font-weight:bold;">/*</span> Mock out jquery parseJSON to call ruby JSON.<span style="color:#9900CC;">parse</span>
         Since the args are the same, it is plug <span style="color:#9966CC; font-weight:bold;">and</span> play!
         <span style="color:#006600; font-weight:bold;">&#40;</span>JS <span style="color:#006600; font-weight:bold;">=&gt;</span> ruby<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">*/</span>
      $.<span style="color:#9900CC;">parseJSON</span> = JSON.<span style="color:#9900CC;">parse</span>;
&nbsp;
      <span style="color:#006600; font-weight:bold;">/*</span> Trigger our JS <span style="color:#006600; font-weight:bold;">*/</span>
      getRemoteData<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;
&nbsp;
      <span style="color:#006600; font-weight:bold;">/*</span> Assert what we expect <span style="color:#006600; font-weight:bold;">&#40;</span>JS <span style="color:#006600; font-weight:bold;">=&gt;</span> ruby<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">*/</span>
      assert_equal<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot; &quot;</span>, dataObject.<span style="color:#9900CC;">access_key</span><span style="color:#006600; font-weight:bold;">&#41;</span>;
    <span style="color:#006600; font-weight:bold;">&#125;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>This is not an example of an incredibly useful test, but I found the ability to bind back and forth easily between ruby and javascript to be <strong>mind-blowingly incredible</strong>. I mean, look at that last line, where I call assert and pass a javascript object to it!</p>
<p>Huge thanks to <strong><a href="http://github.com/cowboyd">Charles Lowell (cowboyd)</a></strong> for his hard work on <a href="http://github.com/cowboyd/therubyracer">therubyracer</a>.</p>
<p>Enjoy the weekend! </p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.smartlogicsolutions.com/2008/11/19/timecop-freeze-time-in-ruby-for-better-testing/" rel="bookmark" class="crp_title">Timecop: Freeze Time in Ruby for Better Testing</a></li><li><a href="http://blog.smartlogicsolutions.com/2010/10/26/testpilot-rails-integration-testing-pattern/" rel="bookmark" class="crp_title">TestPilot &#8211; Rails Integration Testing Pattern</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/06/20/google-ajax-libraries-on-rails/" rel="bookmark" class="crp_title">Google AJAX Libraries on Rails</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/08/08/using-active-x-and-javascript-to-scan-from-your-web-app/" rel="bookmark" class="crp_title">using active x and javascript to scan from your web app</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/10/15/using-swfobject-to-seamlessly-upgrade-to-flash-player-10/" rel="bookmark" class="crp_title">Using SWFObject to Seamlessly Upgrade to Flash Player 10</a></li><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/contextual-related-posts/">Contextual Related Posts</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://blog.smartlogicsolutions.com/2010/10/08/testing-ajax-with-testunit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Analytics Event Tracking Overview</title>
		<link>http://blog.smartlogicsolutions.com/2009/09/24/google-analytics-event-tracking-overview/</link>
		<comments>http://blog.smartlogicsolutions.com/2009/09/24/google-analytics-event-tracking-overview/#comments</comments>
		<pubDate>Thu, 24 Sep 2009 18:17:44 +0000</pubDate>
		<dc:creator>Yair Flicker</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Yair Flicker]]></category>

		<guid isPermaLink="false">http://blog.smartlogicsolutions.com/?p=714</guid>
		<description><![CDATA[At our last monthly technical luncheon I gave a presentation on Google Analytics Event Tracking. Event Tracking in Google Analytics lets the web developer track AJAX requests and by extension Flash events too. AJAX requests don&#8217;t cause page views but as more and more web applications use AJAX it&#8217;s important to track the AJAX requests [...]]]></description>
			<content:encoded><![CDATA[<p>At our last monthly technical luncheon I gave a presentation on <a href="http://code.google.com/apis/analytics/docs/tracking/eventTrackerGuide.html">Google Analytics Event Tracking</a>.</p>
<p><em>Event Tracking</em> in Google Analytics lets the web developer track AJAX requests and by extension Flash events too.  AJAX requests don&#8217;t cause page views but as more and more web applications use AJAX it&#8217;s important to track the AJAX requests in addition to the standard page requests.  Here are some examples of things you can track with GA Event Tracking that you typically wouldn&#8217;t be able to track with the standard Google Analytics Javascript embed:</p>
<p><span id="more-714"></span></p>
<ul>
<li>Play/pause a video</li>
<li>Dragging an element from one part of the screen into another part of the screen, e.g. dragging a product into a shopping cart</li>
<li>Selecting a location/pin on a map</li>
<li>Resizing/panning a map</li>
<li>Reordering elements in a list</li>
<li>Hovering over elements on a webpage</li>
</ul>
<p>The presentation is embedded below and is also available online at <a href="http://docs.google.com/present/view?id=dd86b7wt_1dx9s9dc7">http://bit.ly/gaevents</a>.</p>
<p><iframe src="http://docs.google.com/present/embed?id=dd86b7wt_1dx9s9dc7&#038;size=m" frameborder="0" width="555" height="451"></iframe></p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.smartlogicsolutions.com/2008/05/29/tracking-flash-interactions-with-google-analytics/" rel="bookmark" class="crp_title">Tracking Interactions in Flash with Google Analytics</a></li><li><a href="http://blog.smartlogicsolutions.com/2009/11/24/rack-rewrite-google-analytics-makes-site-transitions-seamless/" rel="bookmark" class="crp_title">Rack::Rewrite + Google Analytics Makes Site Transitions Seamless</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/06/20/google-ajax-libraries-on-rails/" rel="bookmark" class="crp_title">Google AJAX Libraries on Rails</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/10/15/using-swfobject-to-seamlessly-upgrade-to-flash-player-10/" rel="bookmark" class="crp_title">Using SWFObject to Seamlessly Upgrade to Flash Player 10</a></li><li><a href="http://blog.smartlogicsolutions.com/2007/03/09/smartlogic-creates-a-video-player-for-searchles/" rel="bookmark" class="crp_title">SmartLogic Creates a Video Player for Searchles</a></li><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/contextual-related-posts/">Contextual Related Posts</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://blog.smartlogicsolutions.com/2009/09/24/google-analytics-event-tracking-overview/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using SWFObject to Seamlessly Upgrade to Flash Player 10</title>
		<link>http://blog.smartlogicsolutions.com/2008/10/15/using-swfobject-to-seamlessly-upgrade-to-flash-player-10/</link>
		<comments>http://blog.smartlogicsolutions.com/2008/10/15/using-swfobject-to-seamlessly-upgrade-to-flash-player-10/#comments</comments>
		<pubDate>Wed, 15 Oct 2008 14:58:11 +0000</pubDate>
		<dc:creator>Greg Jastrab</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Greg Jastrab]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[flash player 10]]></category>
		<category><![CDATA[swfobject]]></category>

		<guid isPermaLink="false">http://blog.smartlogicsolutions.com/?p=324</guid>
		<description><![CDATA[If you haven&#8217;t heard that Flash Player 10 was officially released, then get out of the hole you&#8217;ve been living in and go get Flash Player 10! When you&#8217;re ready to deploy your first Flash Player 10 SWF, you&#8217;ll want to ensure your users have the latest Flash Player so they can actually view your [...]]]></description>
			<content:encoded><![CDATA[<p>If you haven&#8217;t heard that <a href="http://onflash.org/ted/2008/10/flash-player-10-is-released-flash.php">Flash Player 10</a> was officially released, then get out of the hole you&#8217;ve been living in and <a href="http://www.adobe.com/go/getflash">go get Flash Player 10</a>!</p>
<p>When you&#8217;re ready to deploy your first Flash Player 10 SWF, you&#8217;ll want to ensure your users have the latest Flash Player so they can actually view your content!  Why not make it as easy as possible for them to upgrade and use <a href="http://swfobject.googlecode.com">SWFObject</a> to embed your SWF and seamlessly upgrade older version of the Flash Player up to 10?</p>
<p>Let&#8217;s say you&#8217;re embedding a SWF called <i>MyFlashPlayer10.swf</i>.  Using the <a href="http://code.google.com/p/swfobject/wiki/documentation#How_to_embed_Flash_Player_content_using_SWFObject_dynamic_publis">dynamic publishing method</a> there are just 3 simple steps to follow to get your SWF embedded with SWFObject&#8230;</p>
<p><span id="more-324"></span></p>
<h4>1. Include the SWFObject JavaScript Library on Your Page</h4>
<p>Assuming you&#8217;ve <a href="http://code.google.com/p/swfobject/downloads/list">downloaded SWFObject</a> onto your server and placed <code>swfobject.js</code> in the same directory as the HTML page you&#8217;re editing:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>head<span style="color: #339933;">&gt;</span>
  <span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;swfobject.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>head<span style="color: #339933;">&gt;</span></pre></div></div>

<h4>2. Add a DIV to Hold the SWF</h4>
<p>Place a <code>
<div></code> tag on the page where you want the SWF to be embedded, giving it an ID:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;body&gt;
...
&lt;div id=&quot;swf&quot;&gt;
You need &lt;a href=&quot;http://www.adobe.com/go/getflash&quot;&gt;Flash Player&lt;/a&gt; to see this content!
&lt;/div&gt;</pre></div></div>

<p>The content inside of the DIV will be replaced with your SWF if Flash is present on the user&#8217;s machine.</p>
<h4>3. Tell SWFObject to Embed the SWF</h4>
<p>Add the JavaScript code to embed the SWF after the tag you&#8217;ve added in step 1:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;!--</span>
swfobject.<span style="color: #660066;">addDomLoadEvent</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  swfobject.<span style="color: #660066;">embedSWF</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;MyFlashPlayer10.swf&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;swf&quot;</span><span style="color: #339933;">,</span>
                     <span style="color: #3366CC;">&quot;300&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;300&quot;</span><span style="color: #339933;">,</span>
                     <span style="color: #3366CC;">&quot;10.0.12&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;expressInstall.swf&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #006600; font-style: italic;">//--&gt;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></div></div>

<p>Refer to the <a href="http://code.google.com/p/swfobject/wiki/documentation">SWFObject documentation</a> for the details of these parameters, but a quick explanation:</p>
<p>The <code>addDomLoadEvent</code> function ensures that the DOM is available before running a function.</p>
<p>The parameters for embedSWF are:</p>
<ol>
<li>URL to SWF</li>
<li>ID of DIV to place SWF in</li>
<li>width of SWF</li>
<li>height of SWF</li>
<li>minimum required Flash Player version</li>
<li>URL to express install SWF</li>
</ol>
<p>There are some other optional parameters, but I won&#8217;t go into those here.  The important parameters to focus on for seamlessly upgrading are the 5th and 6th parameters.</p>
<p><b>10.0.12</b> means that we want at least Flash Player 10.0.12 to be installed.  You can also just specify <b>10.0.0</b> for a minimum of Flash Player 10.</p>
<p>The <b>expressInstall</b> SWF is included in the SWFObject download, and will provide the functionality of prompting the user to seamlessly upgrade their Flash Player.  If the user confirms the prompt it presents the Flash Player installer will launch, and the user will be prompted to close the browser so the installation may proceed.  Once it completes, Flash Player 10 (or whatever version has been required) will be installed on the machine!</p>
<p>If you have more questions on SWFObject check out the <a href="http://groups.google.com/group/swfobject">SWFObject Google Group</a>.</p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.smartlogicsolutions.com/2008/05/16/flash-player-10-astro-flex-sdk-compile/" rel="bookmark" class="crp_title">Flash Player 10 (&#8220;Astro&#8221;) Prerelease and Flex SDK Build Available to Compile Flash Player 10 Content</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/05/21/flash-player-10-apis-astro/" rel="bookmark" class="crp_title">Flash Player 10 ActionScript Language Reference Posted on Labs</a></li><li><a href="http://blog.smartlogicsolutions.com/2007/03/09/smartlogic-creates-a-video-player-for-searchles/" rel="bookmark" class="crp_title">SmartLogic Creates a Video Player for Searchles</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/07/15/compiling-your-first-flex-4-application/" rel="bookmark" class="crp_title">Compiling Your First Flex 4 Application</a></li><li><a href="http://blog.smartlogicsolutions.com/2007/08/21/adobe-onair-bus-tour-baltimore/" rel="bookmark" class="crp_title">Adobe onAIR Bus Tour: Baltimore</a></li><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/contextual-related-posts/">Contextual Related Posts</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://blog.smartlogicsolutions.com/2008/10/15/using-swfobject-to-seamlessly-upgrade-to-flash-player-10/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Facebox With Prototype</title>
		<link>http://blog.smartlogicsolutions.com/2008/10/14/facebox-with-prototype/</link>
		<comments>http://blog.smartlogicsolutions.com/2008/10/14/facebox-with-prototype/#comments</comments>
		<pubDate>Tue, 14 Oct 2008 18:58:55 +0000</pubDate>
		<dc:creator>Scott Davis</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Scott Davis]]></category>
		<category><![CDATA[facebox]]></category>
		<category><![CDATA[modal]]></category>
		<category><![CDATA[prototype]]></category>
		<category><![CDATA[window]]></category>

		<guid isPermaLink="false">http://blog.smartlogicsolutions.com/?p=316</guid>
		<description><![CDATA[After many failed attempts of trying to find a modal window that worked like facebox and used prototype, I gave up and started to write one from scratch. In the process I found the first port made by Phil Burrows. It wasn&#8217;t perfect but it was enough for me to build off of so with [...]]]></description>
			<content:encoded><![CDATA[<p>After many failed attempts of trying to find a modal window that worked like facebox and used prototype, I gave up and started to write one from scratch.  In the process I found the <a href="http://blog.philburrows.com">first port</a> made by <a href="http://blog.philburrows.com">Phil Burrows</a>. It wasn&#8217;t perfect but it was enough for me to build off of so with a few tweaks I was able to allow window resizing and let the box center itself.  You can view the changes on my <a href="http://github.com/jetviper21/prototype-facebox/tree/master/">github</a>.</p>
<p>Screenshot:<br />
<div id="attachment_317" class="wp-caption alignnone" style="width: 310px"><a href="http://blog.smartlogicsolutions.com/wp-content/uploads/2008/10/picture-10.png"><img src="http://blog.smartlogicsolutions.com/wp-content/uploads/2008/10/picture-10-300x172.png" alt="My Version of Facebox in our timetracker application" title="Facebox" width="300" height="172" class="size-medium wp-image-317" /></a><p class="wp-caption-text">My Version of Facebox in our timetracker application</p></div></p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.smartlogicsolutions.com/2008/11/12/watch-multiple-logs-in-a-single-terminal/" rel="bookmark" class="crp_title">Watch Multiple Logs in a Single Terminal</a></li><li><a href="http://blog.smartlogicsolutions.com/2009/05/05/smartlogic-wants-to-clean-up-twitter-introduces-shouldirtcom/" rel="bookmark" class="crp_title">SmartLogic Wants to Clean Up Twitter, Introduces ShouldIRT.com</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/08/21/getting-subclipse-to-work-in-gandymede-eclipse-34/" rel="bookmark" class="crp_title">Getting Subclipse to Work in Gandymede (Eclipse 3.4)</a></li><li><a href="http://blog.smartlogicsolutions.com/2009/11/24/rack-rewrite-google-analytics-makes-site-transitions-seamless/" rel="bookmark" class="crp_title">Rack::Rewrite + Google Analytics Makes Site Transitions Seamless</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/05/22/spotcrime-iphone-application-gets-techcrunched/" rel="bookmark" class="crp_title">SpotCrime iPhone Application gets TechCrunched</a></li><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/contextual-related-posts/">Contextual Related Posts</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://blog.smartlogicsolutions.com/2008/10/14/facebox-with-prototype/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>using active x and javascript to scan from your web app</title>
		<link>http://blog.smartlogicsolutions.com/2008/08/08/using-active-x-and-javascript-to-scan-from-your-web-app/</link>
		<comments>http://blog.smartlogicsolutions.com/2008/08/08/using-active-x-and-javascript-to-scan-from-your-web-app/#comments</comments>
		<pubDate>Fri, 08 Aug 2008 16:57:18 +0000</pubDate>
		<dc:creator>Joseph Jakuta</dc:creator>
				<category><![CDATA[ActiveX]]></category>
		<category><![CDATA[Adobe PDF]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Joseph Jakuta]]></category>

		<guid isPermaLink="false">http://blog.smartlogicsolutions.com/?p=125</guid>
		<description><![CDATA[In the app I had been working on users had to perform a great amount of scanning. In the first few iterations this was done manually, which, of course, lead to lots of user error (namely scanning documents at high resolutions, which clogged the system). It was decided that it was best if our app [...]]]></description>
			<content:encoded><![CDATA[<p>In the app I had been working on users had to perform a great amount of scanning.  In the first few iterations this was done manually, which, of course, lead to lots of user error (namely scanning documents at high resolutions, which clogged the system).  It was decided that it was best if our app to control the scan settings for most users.  So we found three possible Active X controllers available to allow for this functionality.  <a href="http://www.ciansoft.com/" target="new">CianSoft</a>, <a href="http://www.vintasoft.com/vstwain-index.html" target="new">VintaSoft</a>, and <a href="http://www.chestysoft.com/" target="new">ChestySoft</a>.  After a little research we found that VintaSoft didn&#8217;t quite meet our needs and that CianSoft&#8217;s TwainX controller and ChestySoft&#8217;s were eerily similar (it turns out that each company is run by a brother and both products were just different flavors of the same one).  In the end ChestySoft was the one we went with because it allows you to perform posts of the scanned data to the server (and the guy that runs the company is super responsive when you have questions).  </p>
<p><span id="more-125"></span></p>
<p>First there isn&#8217;t too much to get this ActiveX controller up in running in the first place.  There are great examples <a href="http://www.chestysoft.com/ximage/manual.htm#sect2" target="new">here</a> that take you 95% of the way towards getting these up and running.  A few little tricks we learned when setting up the javascript portion of the code are as follows:</p>
<ul>
<li>To set the page size use the following method (the example sets it to letter):

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">      csxi.<span style="color: #660066;">SetTwainLayout</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">,</span><span style="color: #CC0000;">8.5</span><span style="color: #339933;">,</span><span style="color: #CC0000;">0</span><span style="color: #339933;">,</span><span style="color: #CC0000;">11</span><span style="color: #009900;">&#41;</span></pre></div></div>

</li>
<li>Some scanners do not reset to their defaults after a custom scan.  You need to make sure you manually set all default settings before scanning.  A few you may want to set:

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">      csxi.<span style="color: #660066;">UseTwainInterface</span><span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//this makes sure that you are not prompted to change settings</span>
      csxi.<span style="color: #660066;">TwainAutoBright</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
      csxi.<span style="color: #660066;">TwainAutoDeskew</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span></pre></div></div>

</li>
<li>When beginning a multipage scan you must run the following three methods:<br/>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">      csxi.<span style="color: #660066;">TwainMultiImage</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
      csxi.<span style="color: #660066;">UseADF</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
      csxi.<span style="color: #660066;">ClearPDF</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

</li>
</ul>
<p>One other fun thing we can do with ChestySoft&#8217;s TwainX controller is upload the captured data directly to the server.  To do this in the javascript you need to do the following:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">      Success <span style="color: #339933;">=</span> csxi.<span style="color: #660066;">PostImage</span><span style="color: #009900;">&#40;</span>url<span style="color: #339933;">,</span> file_name<span style="color: #339933;">,</span> param_name<span style="color: #339933;">,</span> graphics_format<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>Success<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #006600; font-style: italic;">//what to do when success</span>
      <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #006600; font-style: italic;">//what to do if error - here are recommendations:</span>
        csxi.<span style="color: #660066;">SaveToFile</span><span style="color: #009900;">&#40;</span>path_on_desktop<span style="color: #009900;">&#41;</span> <span style="color: #006600; font-style: italic;">//write data to desktop if you saved as a graphic; </span>
        csxi.<span style="color: #660066;">WritePDF</span><span style="color: #009900;">&#40;</span>path_on_desktop<span style="color: #009900;">&#41;</span> <span style="color: #006600; font-style: italic;">//write data to desktop if you saved as a pdf; </span>
      <span style="color: #009900;">&#125;</span></pre></div></div>

<p>Some notes about the preceding code.  <i>url</i> a fully qualified url (including the &#8216;http://&#8217;).  <i>file_name</i> is what will be included as <i>original_filename</i> when you are reading data on the server side.  <i>graphics_format</i> is a enumeration that can be found <a href="http://www.chestysoft.com/ximage/manual.htm#sect19" target="new">here</a>.  </p>
<p>And the best thing is after you click on the button that runs your scan the information uploaded is the same as a standard file upload so you don&#8217;t have to do anything strange at all in ruby.</p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.smartlogicsolutions.com/2010/10/08/testing-ajax-with-testunit/" rel="bookmark" class="crp_title">Testing AJAX with Test::Unit</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/10/15/using-swfobject-to-seamlessly-upgrade-to-flash-player-10/" rel="bookmark" class="crp_title">Using SWFObject to Seamlessly Upgrade to Flash Player 10</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/07/01/microsoft-webdav-opens-document-as-read-only-when-using-railsdav/" rel="bookmark" class="crp_title">Microsoft WebDav opens document as Read-Only when using RailsDav</a></li><li><a href="http://blog.smartlogicsolutions.com/2007/08/21/adobe-onair-bus-tour-baltimore/" rel="bookmark" class="crp_title">Adobe onAIR Bus Tour: Baltimore</a></li><li><a href="http://blog.smartlogicsolutions.com/2007/06/06/eclipse-32-and-out-of-memory-errors/" rel="bookmark" class="crp_title">Eclipse 3.2 and &#8220;Out Of Memory&#8221; errors</a></li><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/contextual-related-posts/">Contextual Related Posts</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://blog.smartlogicsolutions.com/2008/08/08/using-active-x-and-javascript-to-scan-from-your-web-app/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Google AJAX Libraries on Rails</title>
		<link>http://blog.smartlogicsolutions.com/2008/06/20/google-ajax-libraries-on-rails/</link>
		<comments>http://blog.smartlogicsolutions.com/2008/06/20/google-ajax-libraries-on-rails/#comments</comments>
		<pubDate>Fri, 20 Jun 2008 20:42:47 +0000</pubDate>
		<dc:creator>Nick Gauthier</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Nick Gauthier]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://blog.smartlogicsolutions.com/2008/06/20/google-ajax-libraries-on-rails/</guid>
		<description><![CDATA[If you&#8217;re reading this blog you&#8217;ve probably already heard about Google&#8217;s AJAX Library API on many other news sites like Slashdot. I&#8217;m going to describe my simple process for setting up a RoR app to use Google to pull the APIs in a rails friendly way, throughout layouts, views, and helpers. First, open up &#8220;app/helpers/application_helper.rb&#8221;. [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re reading this blog you&#8217;ve probably already heard about <a href="http://code.google.com/apis/ajaxlibs/">Google&#8217;s AJAX Library API</a> on many other news sites like <a href="http://developers.slashdot.org/article.pl?sid=08/05/28/144218">Slashdot</a>.</p>
<p>I&#8217;m going to describe my simple process for setting up a RoR app to use Google to pull the APIs in a rails friendly way, throughout layouts, views, and helpers.</p>
<p><span id="more-51"></span><br />
First, open up &#8220;app/helpers/application_helper.rb&#8221;. Here, we are going to add a few tag methods to keep our views clean and also to keep our versions consistent.</p>
<pre>def google_loader_tag

  "&lt;script type=\"text/javascript\" src=\"http://www.google.com/jsapi\"&gt;&lt;/script&gt;"

end</pre>
<pre></pre>
<pre>def google_prototype_tag

  google_tag('prototype', '1.6.0.2')

end</pre>
<pre>

def google_scriptaculous_tag

  google_tag('scriptaculous', '1.8.1')

end

# etc for any of the other libraries

private

def google_tag(name, version)

  "&lt;script type=\"text/javascript\"&gt;google.load(\"#{name}\", \"#{version}\");&lt;/script&gt;"

end</pre>
<p>Now we need to include these tags in our layouts and views.</p>
<p>In my layout, I put this for a head:</p>
<pre>&lt;head&gt;</pre>
<pre>  &lt;title&gt;&lt;%= yield :title %&gt; - My Site&lt;/title&gt;</pre>
<pre>  &lt;%= stylesheet_link_tag 'mystyle' %&gt;</pre>
<pre>  &lt;%= google_loader_tag %&gt;</pre>
<pre>  &lt;%= yield :css_include %&gt;</pre>
<pre>  &lt;%= yield :javascript_include %&gt;</pre>
<pre>&lt;/head&gt;</pre>
<p>This lets me specify the page title, CSS, and Javascript, in the view, so we don&#8217;t load in anything unnecessary.</p>
<p>Now here is what my view looks like:</p>
<pre>&lt;% content_for :title do -%&gt;Welcome&lt;% end -%&gt;</pre>
<pre>&lt;% content_for :javascript_include do -%&gt;&lt;%= google_prototype_tag %&gt;&lt;% end -%&gt;</pre>
<p>Now my title bubbles up, and my request for prototype bubbles up to the head for me, after the google loader.</p>
<p>The best part about this setup is that my versions will stay the same, and they only need to be changed in one place. And, if I ever decide to host the files locally, I just change the tags in one place, and make the google loader tag return &#8220;&#8221;, until I fix all of the instances.</p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.smartlogicsolutions.com/2009/09/24/google-analytics-event-tracking-overview/" rel="bookmark" class="crp_title">Google Analytics Event Tracking Overview</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/10/15/using-swfobject-to-seamlessly-upgrade-to-flash-player-10/" rel="bookmark" class="crp_title">Using SWFObject to Seamlessly Upgrade to Flash Player 10</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/05/29/tracking-flash-interactions-with-google-analytics/" rel="bookmark" class="crp_title">Tracking Interactions in Flash with Google Analytics</a></li><li><a href="http://blog.smartlogicsolutions.com/2007/08/21/adobe-onair-bus-tour-baltimore/" rel="bookmark" class="crp_title">Adobe onAIR Bus Tour: Baltimore</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/04/05/openflux-flex-mvc-component/" rel="bookmark" class="crp_title">Flex MVC Component Architecture Using OpenFlux</a></li><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/contextual-related-posts/">Contextual Related Posts</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://blog.smartlogicsolutions.com/2008/06/20/google-ajax-libraries-on-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>More press for SpotCrime</title>
		<link>http://blog.smartlogicsolutions.com/2008/05/22/more-press-for-spotcrime/</link>
		<comments>http://blog.smartlogicsolutions.com/2008/05/22/more-press-for-spotcrime/#comments</comments>
		<pubDate>Thu, 22 May 2008 23:55:43 +0000</pubDate>
		<dc:creator>Yair Flicker</dc:creator>
				<category><![CDATA[Clients]]></category>
		<category><![CDATA[Company News]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Project/Product Releases]]></category>
		<category><![CDATA[Yair Flicker]]></category>

		<guid isPermaLink="false">http://blog.smartlogicsolutions.com/2008/05/22/more-press-for-spotcrime/</guid>
		<description><![CDATA[More links to blog posts about SpotCrime: LifeHacker: SpotCrime Maps Local Illegal Happenings Mashable: SpotCrime: Mapping The Criminal Landscape KillerStartups: SpotCrime.com &#8211; How Safe Is Your Neighborhood? See our original blog post on SpotCrime getting TechCrunched. Related Posts:SpotCrime iPhone Application gets TechCrunchedSearchles TV Gets Cease &#038; Desist Letter (and good press too)!BohConf 2010: A RetrospectiveUsing [...]]]></description>
			<content:encoded><![CDATA[<p>More links to blog posts about SpotCrime:</p>
<ul>
<li><a href="http://lifehacker.com/392662/spotcrime-maps-local-illegal-happenings">LifeHacker: SpotCrime Maps Local Illegal Happenings</a></li>
<li><a href="http://mashable.com/2008/05/22/spotcrime/">Mashable: SpotCrime: Mapping The Criminal Landscape</a></li>
<li><a href="http://www.killerstartups.com/Web20/SpotCrimecom---How-Safe-Is-Your-Neighborhood">KillerStartups: SpotCrime.com &#8211; How Safe Is Your Neighborhood?</a></li>
</ul>
<p>See <a href="http://blog.smartlogicsolutions.com/2008/05/22/spotcrime-iphone-application-gets-techcrunched/">our original blog post on SpotCrime getting TechCrunched</a>.</p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.smartlogicsolutions.com/2008/05/22/spotcrime-iphone-application-gets-techcrunched/" rel="bookmark" class="crp_title">SpotCrime iPhone Application gets TechCrunched</a></li><li><a href="http://blog.smartlogicsolutions.com/2007/03/15/searchles-tv-gets-cease-desist-letter-and-good-press-too/" rel="bookmark" class="crp_title">Searchles TV Gets Cease &#038; Desist Letter (and good press too)!</a></li><li><a href="http://blog.smartlogicsolutions.com/2010/06/22/railsconf-bohconf-2010-a-retrospective/" rel="bookmark" class="crp_title">BohConf 2010: A Retrospective</a></li><li><a href="http://blog.smartlogicsolutions.com/2010/01/22/ubuntu-byobu-landscape/" rel="bookmark" class="crp_title">Using Byobu and Landscape to improve remote Ubuntu sessions</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/12/18/puremvcgen-011-released-now-works-on-windows/" rel="bookmark" class="crp_title">PureMVCGen 0.1.1 Released &#8211; Now Works on Windows</a></li><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/contextual-related-posts/">Contextual Related Posts</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://blog.smartlogicsolutions.com/2008/05/22/more-press-for-spotcrime/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adobe onAIR Bus Tour: Baltimore</title>
		<link>http://blog.smartlogicsolutions.com/2007/08/21/adobe-onair-bus-tour-baltimore/</link>
		<comments>http://blog.smartlogicsolutions.com/2007/08/21/adobe-onair-bus-tour-baltimore/#comments</comments>
		<pubDate>Wed, 22 Aug 2007 04:40:48 +0000</pubDate>
		<dc:creator>Greg Jastrab</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Events]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Greg Jastrab]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Yair Flicker]]></category>

		<guid isPermaLink="false">http://blog.smartlogicsolutions.com/2007/08/21/adobe-onair-bus-tour-baltimore/</guid>
		<description><![CDATA[Yair and I went to the Baltimore stop of Adobe&#8217;s onAIR Bus Tour tonight. Ryan Stewart Ryan Stewart kicked off the keynote giving an introduction and overview to Adobe AIR. After briefly going over the background/web-history of the Flash player and the motivations behind the development of Adobe AIR, Ryan showcased some AIR applications: Finetune [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.smartlogicsolutions.com/wiki/Yair_Flicker">Yair</a> and <a href="http://www.smartlogicsolutions.com/wiki/Greg_Jastrab">I</a> went to the Baltimore stop of Adobe&#8217;s <a href="http://onair.adobe.com">onAIR Bus Tour</a> tonight.</p>
<h4>Ryan Stewart</h4>
<p>Ryan Stewart kicked off the keynote giving an introduction and overview to Adobe AIR.  After briefly going over the background/web-history of the Flash player and the motivations behind the development of Adobe AIR, Ryan showcased some AIR applications:</p>
<ul>
<li><a href="http://www.finetune.com/">Finetune</a></li>
<li>A task app that was made in 24 hours w/ straight CSS &#038; JavaScript by the creator of the Ext framework</li>
<li><a href="http://www.virtub.com/">Buzzword</a></li>
<li><a href="http://labs.adobe.com/wiki/index.php/Media_Player">Adobe Media Player</a> (not publicly released yet)</li>
</ul>
<p>He also highlighted that with the newly <a href="http://labs.adobe.com/technologies/flashplayer9/">announced update</a> to Flash Player  9 (codenamed &#8220;Moviestar&#8221;), Flash SWFs will be able to support H.264 video and HE-AAC audio.  This will allow Quicktime movies to be played through SWFs and the Adobe Media Player.</p>
<p>Ryan then mentioned that the second public beta drop of AIR will be released during the <a href="http://www.adobe.com/go/max">MAX 2007</a> conference.  Also, we were reminded of the <a href="http://www.adobe.com/go/airderby">AIR Developer Derby</a>: a contest to see who can make the <i>best</i> AIR application.  The grand prize is essentially a $100,000 travel coupon.  There will also be five category winners that will win &#8220;The Ultimate Desktop Environment&#8221;, which is pretty much a bunch of beast hardware.</p>
<h4>Mike Chambers</h4>
<p>Next up was <a href="http://www.mikechambers.com/blog/">Mike Chambers</a> demo&#8217;ing how to write a HelloWorld Flex-based AIR application.  Pretty standard, but he went on to highlight the install experience for end-users that will be using AIR applications we developers will be creating.  End-users will need the AIR runtime in order to install an AIR app, but developers will be able to place a Flash Badge on their website which will allow users without the AIR runtime to install both the runtime and their AIR application with only 4 clicks.</p>
<p>Mike finished off with pointing any developers that are starting to play around with AIR to the <a href="http://onair.adobe.com/api/"> onAIR Bus APIs</a> which have a ton of live data that can be used in an AIR app.</p>
<h4>Kevin Hoyt</h4>
<p><a href="http://blog.kevinhoyt.org">Kevin Hoyt</a> was next to demo how to build an HTML-based AIR Application.</p>
<p>Kevin emphasized that Flex Builder is not necessary to create AIR applications.  The Flex 3 SDK (which is freely downloadable) contains the AIR SDK as well, so you can compile and debug your AIR applications from the command line.  Dreamweaver CS3 also has an AIR extension so if you&#8217;re a web developer that&#8217;s afraid of the command line you can go ahead and develop your HTML page in Dreamweaver and debug the application or package it as an AIR file directly within the comfort of Dreamweaver.</p>
<h5>Script Bridging</h5>
<p>Kevin next demo&#8217;d the script bridging capabilities of AIR, which lets JavaScript reach into the ActionScript world and invoke any methods in the Flash API (anything in the flash.* namespace).  The reverse is also true (ActionScript reaching into the JavaScript world).  This means you can have a purely HTML-based AIR application that can call methods in the Flash API by simply doing things like:</p>
<pre><code>&lt;script&gt;
  var airFile = window.runtime.flash.filesystem.File;
  var desktop = airFile.desktopDirectory;
  var myFileInJS = new airFile(desktop.resolve("file_on_the_desktop.txt");
&lt;/script&gt;
</code></pre>
<p>Here, <code>myFileInJS</code> is a JavaScript variable that references an ActionScript 3 class from the AIR SDK.</p>
<p>So &#8220;window.runtime.flash.* can let you directly use any Flash class from JavaScript. IMO the coolest thing Kevin covered is the ability augment the Flash packages you can use by simply script including a library.swf from any SWC to access those AS classes:</p>
<pre><code>&lt;script src="library.swf"&gt;&lt;/script&gt;
&lt;script&gt;
  var encoder = runtime.com.adobe.images.PNGEncoder;
  encoder.encode( bitmapData )
&lt;/script&gt;
</code></pre>
<p>In this example, <code>encoder</code> is the PNGEncoder from the <a href="http://code.google.com/p/as3corelib/">as3corelib</a> project, but the encoding is being done in JavaScript using AS classes!  Very cool stuff.  (FYI: a SWC is stored in a ZIP format, so you can just unzip a SWC file to access the library.swf inside of it)</p>
<h4>Chafic Kazoun: Windowing in AIR</h4>
<p>Windowing concepts <a href="http://www.rewindlife.com/">Chafic</a> covered/demo&#8217;d:</p>
<ul>
<li>utility window</li>
<li>standard window</li>
<li>custom chrome transparent window</li>
<li>custom chrome where background is embedded in a SWF</li>
<li>custom window dispatching events and being listened to by another window</li>
</ul>
<h4>Ben Forta: AIR + ColdFusion</h4>
<p>Highlights from Ben&#8217;s talk:</p>
<ul>
<li>50% of existing ColdFusion customers have upgraded to ColdFusion 8.</li>
<li>ColdFusion/Flex Extensions for Eclipse available at Adobe&#8217;s ColdFusion page.</li>
</ul>
<p>Can generate a ColdFusion-backed Flex web app w/ literally no front-end coding; the extension has Master/Detail/Master_Detail and DB wizards to configure everything which then generates the CFCs, MXML components, and CSS stylesheets using all best practices.</p>
<p>This was possible before in ColdFusion 7, but now ColdFusion 8 can generate a ColdFusion-backed AJAX/HTML/CSS web app in the same manner.</p>
<p>From AIR you can load an HTML page from a ColdFusion backend and it will properly renders this AJAX/HTML/CSS generated content.</p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.smartlogicsolutions.com/2008/10/29/i-won-the-air-cook-off/" rel="bookmark" class="crp_title">I Won the AIR Cook-off</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/03/31/air-linux-adobe-alpha-flexbuilder/" rel="bookmark" class="crp_title">Adobe AIR Alpha Released on Linux</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/02/25/flex-air-released-adobe/" rel="bookmark" class="crp_title">AIR 1.0 and Flex 3 Released</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/09/11/migrating-serialization-changes-within-an-air-application/" rel="bookmark" class="crp_title">Migrating Serialization Changes Within an AIR Application</a></li><li><a href="http://blog.smartlogicsolutions.com/2008/11/17/migrairable-library-added-to-google-code/" rel="bookmark" class="crp_title">MigrAIRable Library Added to Google Code</a></li><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/contextual-related-posts/">Contextual Related Posts</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://blog.smartlogicsolutions.com/2007/08/21/adobe-onair-bus-tour-baltimore/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

