<?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>Joris Timmerman</title>
	<atom:link href="http://www.joristimmerman.be/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.joristimmerman.be/wordpress</link>
	<description>Multimedia Consultant @ BoulevArt</description>
	<lastBuildDate>Mon, 30 Aug 2010 08:26:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Google API &#8211; AS3 library: v. 2.0</title>
		<link>http://www.joristimmerman.be/wordpress/2009/04/15/google-api-as3-library-v-20/</link>
		<comments>http://www.joristimmerman.be/wordpress/2009/04/15/google-api-as3-library-v-20/#comments</comments>
		<pubDate>Wed, 15 Apr 2009 14:29:44 +0000</pubDate>
		<dc:creator>Joris Timmerman</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[google api]]></category>
		<category><![CDATA[search]]></category>
		<category><![CDATA[suggest]]></category>
		<category><![CDATA[weather]]></category>

		<guid isPermaLink="false">http://www.joristimmerman.be/wordpress/?p=304</guid>
		<description><![CDATA[General I&#8217;ve been busy at work, perhaps the reason why it was so silent on this blog. But I&#8217;m back! And one of my first act is to update the Google AS3 Library I&#8217;ve build a while ago. I started the library to support Google&#8217;s Ajax search API. Later on, when I found some new [...]]]></description>
			<content:encoded><![CDATA[<h3>General</h3>
<p>I&#8217;ve been busy at work, perhaps the reason why it was so silent on this blog.<br />
But I&#8217;m back! And one of my first act is to update the Google AS3 Library I&#8217;ve build a while ago.</p>
<p>I started the library to support Google&#8217;s Ajax search API.<br />
Later on, when I found some new webservices, I added those too. At the end, the entire library was one messy organically grown library.<br />
So I decided a while ago to clean that mess up.</p>
<h3>Changes &amp; new features</h3>
<ul>
<li>I reordened the package structure, meaning I devided the API in <em>ajaxapi</em> (<em>search</em>, <em>translation</em> and, the newly added, <strong><em>feeds</em></strong>), <strong><em>apicore</em></strong> (where you can store your api key), <em>suggest</em> (using the Google Suggest webservice) and <em>weather</em> (using the weather services).</li>
<li>I changed the name of the event GoogleSearchEvent to <strong>GoogleApiEvent</strong>, which is more relevant since the library is more than the Ajax search API.</li>
<li>Dito for the class that unites all features called GoogleSearch, it&#8217;s now called <strong>GoogleApi</strong></li>
<li>As already mentioned, I also added the ability to use an api key.</li>
</ul>
<p>I hope those changes make the library at least a bit more transparent and easier to get.</p>
<h3>Updating</h3>
<p>If you want to update the library your using, the easiest way is using FDT.</p>
<ol>
<li>Delete the old library and add the new one instead.</li>
<li>Right-click your source folder, goto Source and click &#8216;Organize imports&#8217;.</li>
<li>This will change your imports and correct them accordingly, so they point to the correct classes.</li>
<li>Correct the eventname, <em>GoogleSearchEvent</em> becomes <em>GoogleApiEvent. </em>You can do that by using a find &amp; replace, same for GoogleSearch to GoogleApi</li>
</ol>
<h3>Gimme, gimme , gimme</h3>
<p>The classes are still on Google Code, where a new version of the library has been committed into the SVN.<br />
The old classes have been moved to the branch folder. There is also a new update for GoogleEyes, containing the new libraries.</p>
<p>You can download those libraries <a href="http://googleas3api.googlecode.com/files/as3googleapilibs2.0.2.zip" onclick="pageTracker._trackPageview('/outgoing/googleas3api.googlecode.com/files/as3googleapilibs2.0.2.zip?referer=');">here</a>.<br />
GoogleEyes demo app can be found <a href="http://googleas3api.googlecode.com/files/GoogleEyes.air" onclick="pageTracker._trackPageview('/outgoing/googleas3api.googlecode.com/files/GoogleEyes.air?referer=');">here</a>.</p>
<p>The project is hosted on Google Code <a href="http://code.google.com/p/googleas3api" onclick="pageTracker._trackPageview('/outgoing/code.google.com/p/googleas3api?referer=');">(see)</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.joristimmerman.be/wordpress/2009/04/15/google-api-as3-library-v-20/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>ScreenManager: expand your AIR application (to multiple monitors)</title>
		<link>http://www.joristimmerman.be/wordpress/2009/03/03/screenmanager-expand-your-air-application/</link>
		<comments>http://www.joristimmerman.be/wordpress/2009/03/03/screenmanager-expand-your-air-application/#comments</comments>
		<pubDate>Tue, 03 Mar 2009 17:13:55 +0000</pubDate>
		<dc:creator>Joris Timmerman</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[multi-screen]]></category>
		<category><![CDATA[multiscreen]]></category>
		<category><![CDATA[screenmanager]]></category>

		<guid isPermaLink="false">http://www.joristimmerman.be/wordpress/?p=250</guid>
		<description><![CDATA[Never wondered how cool it would be when your AIR application runs on 2 or more monitors at the same time? Adobe AIR supports multi-screen by offering the developer a Screen-class. This class makes it possible to detect screens, get some info, and that&#8217;s it. To open a window on a screen, you&#8217;ll have to [...]]]></description>
			<content:encoded><![CDATA[<h1><span style="font-weight: normal; font-size: 13px;">Never wondered how cool it would be when your AIR application runs on 2 or more monitors at the same time?</span></h1>
<p>Adobe AIR supports multi-screen by offering the developer a Screen-class.<br />
This class makes it possible to detect screens, get some info, and that&#8217;s it.<br />
To open a window on a screen, you&#8217;ll have to do some calculations yourself.</p>
<p>To make positioning screens, moving screens, &#8230; easier , I quickly build a ScreenManager that takes care of your NativeWindow(s).<br />
Make an instance of the nativewindow and send it throught the manager.<br />
Like this:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> nw:NativeWindow=<span style="color: #000000; font-weight: bold;">new</span> NativeWindow<span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> NativeWindowInitOptions<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
nw.<span style="color: #0066CC;">width</span>=<span style="color: #cc66cc;">250</span>
nw.<span style="color: #0066CC;">height</span>=<span style="color: #cc66cc;">90</span>
<span style="color: #000000; font-weight: bold;">var</span> mc:<span style="color: #0066CC;">MovieClip</span>=<span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">MovieClip</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #808080; font-style: italic;">//movieclip with content</span>
nw.<span style="color: #0066CC;">stage</span>.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span>mc<span style="color: #66cc66;">&#41;</span>;
ScreenManager.<span style="color: #006600;">openWindowCenteredOnScreen</span><span style="color: #66cc66;">&#40;</span>nw,<span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>The ScreenManager is a static class.<br />
It allow the developer to control a NativeWindow through the following methods:<br />
<em> (incorrect signatures)</em></p>
<ul>
<li>ScreenManager.centerWindowOnScreen()</li>
<li>ScreenManager.getActualScreenBounds()</li>
<li>ScreenManager.getScreenColorDepth()</li>
<li>ScreenManager.getVisibleScreenBounds()</li>
<li>ScreenManager.moveWindow()</li>
<li>ScreenManager.openWindowCenteredOnScreen()</li>
<li>ScreenManager.openWindowOnScreen()</li>
<li>ScreenManager.stretchWindowToAllScreens()</li>
<li>ScreenManager.stretchWindowOnScreen()</li>
<li>ScreenManager.openWindowFullScreenOn()</li>
<li>ScreenManager.setWindowFullScreenOn()</li>
<li>ScreenManager.moveWindowToCorner()</li>
<li>ScreenManager.openWindowInCorner()</li>
</ul>
<p>and the following properties:</p>
<ul>
<li>ScreenManager.mainScreenIndex</li>
<li>ScreenManager.numScreens</li>
<li>ScreenManager.maximumAvailableResolution</li>
</ul>
<p>The ScreenManager can be <a href="http://airscreenmanageras3.googlecode.com/files/AIRScreenManager.zip" onclick="pageTracker._trackPageview('/outgoing/airscreenmanageras3.googlecode.com/files/AIRScreenManager.zip?referer=');"> downloaded here </a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.joristimmerman.be/wordpress/2009/03/03/screenmanager-expand-your-air-application/feed/</wfw:commentRss>
		<slash:comments>25</slash:comments>
		</item>
		<item>
		<title>Extending BulkLoader &#8211; Throwing an event when an item is downloaded</title>
		<link>http://www.joristimmerman.be/wordpress/2009/01/08/extending-bulkloader-onitemdownload/</link>
		<comments>http://www.joristimmerman.be/wordpress/2009/01/08/extending-bulkloader-onitemdownload/#comments</comments>
		<pubDate>Thu, 08 Jan 2009 11:30:05 +0000</pubDate>
		<dc:creator>Joris Timmerman</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[bulkloader]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[as3 bulk-loader on item download]]></category>
		<category><![CDATA[on item download]]></category>

		<guid isPermaLink="false">http://www.joristimmerman.be/wordpress/?p=132</guid>
		<description><![CDATA[A while ago, I needed something that could load a LOT of images at a short times notice without Flash crashing or stopping in the middle of the queue without reason, like what happens if you loop a Loader 500 times. Then I found BulkLoader&#8230; It was all I needed, but then the client wanted [...]]]></description>
			<content:encoded><![CDATA[<p>A while ago, I needed something that could load a LOT of images at a short times notice without Flash crashing or stopping in the middle of the queue without reason, like what happens if you loop a Loader 500 times.</p>
<p>Then I found BulkLoader&#8230;<br />
It was all I needed, but then the client wanted the image added to the stage at the moment it was downloaded, this is not build in the  BulkLoaders classes, so I extended those.</p>
<p>Here is how I did it.</p>
<h2>Getting started</h2>
<p>We are going to extend the BulkLoader classes so it throws an event when a single download has finished.<br />
To do this, get the latest version of BulkLoader at <a title="Google Code" href="http://code.google.com/p/BulkLoader/" onclick="pageTracker._trackPageview('/outgoing/code.google.com/p/BulkLoader/?referer=');">Google Code</a>.</p>
<p>Unpack the zipped file, and open up the BulkLoader.as and BulkProgressEvent.as in the br.com.stimuli.loading package.</p>
<h2>BulkLoader.as</h2>
<p>Let&#8217;s start with adding an event constant name with the global variables:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">public</span> <span style="color: #0066CC;">static</span> const ITEMLOADED : <span style="color: #0066CC;">String</span> = <span style="color: #ff0000;">&quot;item_loaded&quot;</span>;</pre></div></div>

<p>You may insert it under the line (178):</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">public</span> <span style="color: #0066CC;">static</span> const COMPLETE : <span style="color: #0066CC;">String</span> = <span style="color: #ff0000;">&quot;complete&quot;</span>;</pre></div></div>

<p>Next scroll down to the function _onItemComplete (line 801).<br />
At the bottom of that function you should see the following if-statement:</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>allDone<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
    _onAllLoaded<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>replace it with:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> eItemL : BulkProgressEvent = <span style="color: #000000; font-weight: bold;">new</span> BulkProgressEvent<span style="color: #66cc66;">&#40;</span>ITEMLOADED,item<span style="color: #66cc66;">&#41;</span>;
eItemL.<span style="color: #006600;">setInfo</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">bytesLoaded</span>, <span style="color: #0066CC;">bytesTotal</span>, bytesTotalCurrent, _itemsLoaded, itemsTotal, weightPercent<span style="color: #66cc66;">&#41;</span>;
dispatchEvent<span style="color: #66cc66;">&#40;</span>eItemL<span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>allDone<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
      _onAllLoaded<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
 <span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>What did we do here?<br />
We&#8217;re creating an instance of  a  BulkProgressEvent and add relevant information to it.<br />
Next we&#8217;re going to dispatch it everytime this function is called.<br />
As you can see, we&#8217;ve given the constructor another new parameter, the loaded item, we wil have to extend the BulkProgressEvent.</p>
<h2>BulkProgressEvent.as</h2>
<p>Start with adding a constant, a new name for a new kind of Event, an ITEMLOADED event, you can do that under line 52:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">public</span> <span style="color: #0066CC;">static</span> const ITEMLOADED : <span style="color: #0066CC;">String</span> = <span style="color: #ff0000;">&quot;item_loaded&quot;</span>;</pre></div></div>

<p>Next, create an new public variable (or an private one and make it a property by adding  a getter &amp; a setter), named lastLoadedItem (under line 70 for example):</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> lastLoadedItem:LoadingItem;</pre></div></div>

<p>Now we are going to change the BulkProgressEvents constructor by adding a new parameter. Insert llItem:LoadingItem=null after the name parameter so the constructor looks like this:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> BulkProgressEvent<span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">name</span> : <span style="color: #0066CC;">String</span>,llItem:LoadingItem=<span style="color: #000000; font-weight: bold;">null</span>, bubbles:<span style="color: #0066CC;">Boolean</span>=<span style="color: #000000; font-weight: bold;">true</span>, cancelable:<span style="color: #0066CC;">Boolean</span>=<span style="color: #000000; font-weight: bold;">false</span> <span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></pre></div></div>

<p>We gave it the default value <em>null</em> so we don&#8217;t have to change other code from the rest of the project.</p>
<p>Don&#8217;t forget to import LoadingItem</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">import</span> br.<span style="color: #006600;">com</span>.<span style="color: #006600;">stimuli</span>.<span style="color: #006600;">loading</span>.<span style="color: #006600;">loadingtypes</span>.<span style="color: #006600;">LoadingItem</span>;</pre></div></div>

<p>In the constructor, under the line</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">name</span> = <span style="color: #0066CC;">name</span>;</pre></div></div>

<p>add</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">this</span>.<span style="color: #006600;">lastLoadedItem</span> = llItem;</pre></div></div>

<p>Change in the clone function the line:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> b : BulkProgressEvent = <span style="color: #000000; font-weight: bold;">new</span> BulkProgressEvent<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">name</span>, bubbles, cancelable<span style="color: #66cc66;">&#41;</span></pre></div></div>

<p>to:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> b : BulkProgressEvent = <span style="color: #000000; font-weight: bold;">new</span> BulkProgressEvent<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">name</span>, lastLoadedItem, bubbles, cancelable<span style="color: #66cc66;">&#41;</span></pre></div></div>

<p>And you&#8217;re done!<br />
Now you can add an new eventlistener to you BulkLoader instance and capture every new loaded item.</p>
<h2>Usage</h2>
<p><span id="more-132"></span><br />
Just add another listener to the BulkLoader instance to listen for the ITEMLOADED event.<br />
You can retrieve your last loaded item in the function you assigned to that ITEMLOADED event by calling that public variable/property lastLoadedItem.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> loader: BulkLoader = <span style="color: #000000; font-weight: bold;">new</span> BulkLoader<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;galleryLoader&quot;</span><span style="color: #66cc66;">&#41;</span>
loader.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>BulkLoader.<span style="color: #006600;">COMPLETE</span>,bloaderComplete<span style="color: #66cc66;">&#41;</span>
loader.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>BulkLoader. <span style="color: #006600;">ITEMLOADED</span>, itemComplete<span style="color: #66cc66;">&#41;</span>
&nbsp;
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> itemComplete<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:BulkProgressEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><span style="color: #66cc66;">&#123;</span>
	<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;lastLoadedItem:&quot;</span> + <span style="color: #0066CC;">e</span>.<span style="color: #006600;">lastLoadedItem</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<h2>Download</h2>
<p>Here is a download, adjusted version of BulkLoader r239: <a href="http://www.joristimmerman.be/wordpress/wp-content/uploads/bulkloader_r239.zip">download</a>.</p>
<h2>What is BulkLoader?</h2>
<p>BulkLoader is a minimal library written in Actionscript 3 (AS3) that aims to make loading and managing complex loading requirements easier and faster. BulkLoader takes a more dynamic, less architecture heavy aproach. Few imports and making heavy use of AS3&#8242;s dynamic capabilities, BulkLoader has a one-liner feel that doesn&#8217;t get in your way.</p>
<p>BulkLoader tries to hide the complexity of loading different data types in AS3 and provides a unified interface for loading, accessing and events notification for different types of content.</p>
<p>This library is licensed under an open source MIT license. Features:</p>
<ul>
<li>Connection pooling.</li>
<li>Unified interface for different loading types.</li>
<li>Unified progress notification.</li>
<li>Events for individual items and as groups.</li>
<li>Priority</li>
<li>Stop and resuming individually as well as in bulk.</li>
<li>Cache management.</li>
<li>Statistics about loading (latency, speed, average speed).</li>
<li>Various kinds on progress indication: ratio (items loaded / items to load), bytes , and weighted percentage.</li>
<li>Configurable number of retries.</li>
<li>Configurable logging.</li>
<li>Various assest types (XML, NetStreams, Swfs, Images, Sound, Text Files)</li>
</ul>
<p>Design goals:</p>
<ul>
<li>Minimal imports.</li>
<li>Few method to learn.</li>
<li>Consistent interface, regardless of content type.</li>
</ul>
<p>BulkLoader tries to gracefully handle progress notification in these use cases:</p>
<ul>
<li>Few connections to open: bytes total can be used instantly.</li>
<li>Many connections opened: progress by ratio</li>
<li>Many connections opened for data of widely varying sizes: progress by weight.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.joristimmerman.be/wordpress/2009/01/08/extending-bulkloader-onitemdownload/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Google API &#8211; AS3 Library</title>
		<link>http://www.joristimmerman.be/wordpress/2008/12/18/google-api-as3-library/</link>
		<comments>http://www.joristimmerman.be/wordpress/2008/12/18/google-api-as3-library/#comments</comments>
		<pubDate>Thu, 18 Dec 2008 21:00:57 +0000</pubDate>
		<dc:creator>Joris Timmerman</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[BoulevArt]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://www.joristimmerman.be/wordpress/?p=16</guid>
		<description><![CDATA[A while ago, I have build an API library in AS3 that interfaces with Google’s own AJAX API. To show you how performant this API is, I included a demo-app at the bottom of this blog. The library is a simple collection of the API’s features, there is a class per feature, like Google Web [...]]]></description>
			<content:encoded><![CDATA[<p><!--StartFragment--></p>
<p style="text-align: center; ">
<p style="text-align: center;"><img class="size-medium wp-image-505   aligncenter" title="Google API: AS3 lib" src="http://labs.boulevart.be/wp-content/uploads/2008/12/googlewb1.jpg" alt="" width="133" height="100" /></p>
<p class="MsoNormal">
<p class="MsoNormal"><span lang="NL-BE">A while ago, I have build an API library in AS3 that interfaces with Google’s own AJAX API. To show you how performant this API is, I included a demo-app at the bottom of this blog.</span></p>
<p class="MsoNormal"><span lang="NL-BE">The library is a simple collection of the API’s features, there is a class per feature, like Google Web search, Images Search, etc. Each library throws it’s own event with an Array of matching datatypes, for example GoogleWebItem, so it’s easy to keep track on wich data is recieved and what this data contains.</span></p>
<p class="MsoNormal"><span lang="NL-BE">This api contains:</span></p>
<ul>
<li>Google Web Search</li>
<li>Google Images Search</li>
<li>Google Book Search</li>
<li>Google Video Search (Google Video &amp; YouTube)</li>
<li>Google Blog Search</li>
<li>Google Local Search</li>
<li>Google Patent Search</li>
<li>Google News Search</li>
<li>Google Translation</li>
<li>Google Weather</li>
<li>Google Suggest (new)</li>
</ul>
<p>This API is Flash &amp; Flex compatible.</p>
<p class="MsoNormal">
<h2><span lang="NL-BE">Little example code</span></h2>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> googleWebSearch:GoogleWebSearch=<span style="color: #000000; font-weight: bold;">new</span> GoogleWebSearch<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
&nbsp;
googleWebSearch.<span style="color: #006600;">search</span><span style="color: #66cc66;">&#40;</span>txtInput.<span style="color: #0066CC;">text</span>,<span style="color: #cc66cc;">0</span>,lang<span style="color: #66cc66;">&#41;</span>
googleWebSearch.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>GoogleSearchEvent.<span style="color: #006600;">WEB_SEARCH_RESULT</span>,onWebResults<span style="color: #66cc66;">&#41;</span> 
&nbsp;
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> onWebResults<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:GoogleSearchEvent<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> result:GoogleWebItem <span style="color: #b1b100;">in</span> <span style="color: #0066CC;">e</span>.<span style="color: #0066CC;">data</span> as <span style="color: #0066CC;">Array</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
      <span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span>result.<span style="color: #006600;">title</span>, result.<span style="color: #0066CC;">url</span><span style="color: #66cc66;">&#41;</span>
   <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<h2>The library</h2>
<p>You can download the library <a href="http://googleas3api.googlecode.com/files/as3googleapilibs2.0.2.zip" onclick="pageTracker._trackPageview('/outgoing/googleas3api.googlecode.com/files/as3googleapilibs2.0.2.zip?referer=');">here</a> <span style="color: #ff0000;">(updated)</span>.<br />
The demo app can be found <a title="here" href="http://googleas3api.googlecode.com/files/GoogleEyes.air" target="_blank" onclick="pageTracker._trackPageview('/outgoing/googleas3api.googlecode.com/files/GoogleEyes.air?referer=');">here</a>.</p>
<p>Right-click in the app to see source-code.</p>
<p><!--EndFragment--></p>
]]></content:encoded>
			<wfw:commentRss>http://www.joristimmerman.be/wordpress/2008/12/18/google-api-as3-library/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>FLVRecorder for Adobe AIR</title>
		<link>http://www.joristimmerman.be/wordpress/2008/12/18/flvrecorder-record-to-flv-using-air/</link>
		<comments>http://www.joristimmerman.be/wordpress/2008/12/18/flvrecorder-record-to-flv-using-air/#comments</comments>
		<pubDate>Thu, 18 Dec 2008 21:00:33 +0000</pubDate>
		<dc:creator>Joris Timmerman</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[BoulevArt]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[as3 webcam to flv]]></category>
		<category><![CDATA[webcam to flv]]></category>
		<category><![CDATA[writing flv]]></category>

		<guid isPermaLink="false">http://www.joristimmerman.be/wordpress/?p=12</guid>
		<description><![CDATA[FLVRecorder for Adobe AIR About When I was researching earlier this year whether or not I could capture a webcam feed and save it to the Flash Video Format, I stumbled on a guys blog called Zero Point Nine. He made a class that could save frames (BitmapData objects) passed to it as an FLV. [...]]]></description>
			<content:encoded><![CDATA[<p><!--StartFragment--></p>
<h2><span lang="EN-GB">FLVRecorder for Adobe AIR</span></h2>
<h3><span lang="EN-GB">About</span></h3>
<p class="MsoNormal"><span lang="EN-GB">When I was researching earlier this year whether or not I could capture a webcam feed and save it to the Flash Video Format, I stumbled on a guys blog called Zero Point Nine. He made a class that could save frames (BitmapData objects) passed to it as an FLV.<span> </span></span></p>
<p class="MsoNormal"><span lang="EN-GB">This was nice, but not very performant, as the parsing of the BitmapData to ByteArrays took way too long and was extremely CPU intensive and your app froze up, I decided to adjust the class and make it usable within an Adobe AIR app without losing a single frame, or freezing the app. For this, I started out with a new class, only copied the algorithms for writing an FLV and started building my own api.<br />
The main target of developing this FLV-recorder was performance on the CPU and RAM side.</span></p>
<h3><span lang="EN-GB">FLVRecorder</span></h3>
<p> 
</p>
<p class="MsoNormal"><span lang="EN-GB">The purpose of this revolutionary new class is to record a stream of BitmapData to a FLV-file, because writing directly, and especially the converting-BitmapData-to-ByteArrays-with-byteshifting-part, made everything run shaky. I solved that issue by saving the BitmapData to a temporary file on the system. This to protect your RAM from overloading, and when done recording, the class converts that temporary file to an FLV-file.</span></p>
<p class="MsoNormal"><span lang="EN-GB">For developing comforts, I build in a few events as well, when recording starts and stops, and an event while saving, with an indication of your progress.</span></p>
<p class="MsoNormal"><span lang="EN-GB">The class offers the user to record via inputting BitmapData, Bitmaps and even your custom components, Flex component, like your VideoDisplay and also Flash components, like the FLVPlayBack or your custom Sprites and MovieClips.</span></p>
<p class="MsoNormal"><span lang="EN-GB">The class does not yet support adding sound to the flv-file, this is the next step of development, to enable sound recording and add sound to the flv-file.</span></p>
<p><!--EndFragment--><!--StartFragment--></p>
<h3><span lang="EN-GB">AirCam</span></h3>
<p class="MsoNormal"><span lang="EN-GB">As a proof-of-concept, I built a small application that enables you to record your webcam and saved it on your desktop as an flv-file.</span></p>
<div id="attachment_300" class="wp-caption alignnone" style="width: 310px"><a href="http://flvrecorder.googlecode.com/files/AirCam.air" onclick="pageTracker._trackPageview('/outgoing/flvrecorder.googlecode.com/files/AirCam.air?referer=');"><img class="size-medium wp-image-300" title="AirCam" src="http://labs.boulevart.be/wp-content/uploads/2008/09/webcam.png" alt="Screenshot of AirCam" width="300" height="268" /></a><p class="wp-caption-text">Screenshot of AirCam</p></div>
<p>Download the AirCam installer <a href="http://flvrecorder.googlecode.com/files/AirCam.air" onclick="pageTracker._trackPageview('/outgoing/flvrecorder.googlecode.com/files/AirCam.air?referer=');">here.<br />
</a>To view the source used in this project, right-click somewhere, and choose view source.</p>
<p>The FLVRecorder and all related classes are open source, they are not fully tested and may contain bugs.<br />
I&#8217;m happy to share it with the community, use them, play with them and certainly enhance them!<br />
These classes are NOT FOR COMMERCIAL USE and property of BoulevArt nv.</p>
<p>Download the <a href="http://flvrecorder.googlecode.com/files/flvrecorder_0.2.zip" onclick="pageTracker._trackPageview('/outgoing/flvrecorder.googlecode.com/files/flvrecorder_0.2.zip?referer=');">source.</a></p>
<p><span id="more-12"></span></p>
<h2>API</h2>
<p>The class offers the developer an API to easy implement this in your app.<br />
You should respect a certain flow:</p>
<p>1. Make an instance of the class, it&#8217;s a singleton class, so just ask for the instance:<br />
<span style="color: #33cccc;"><span style="white-space:pre"> </span>var</span> recorder:FLVRecorder=FLVRecorder.getInstance()</p>
<p>2. Define the target FLV-file&#8217;s properties, the file instance to your flv-file, width &amp; height, framerate and the systemManager instance, that&#8217;s a Flash internal declared variable and the optional duration in seconds:<br />
<span style="white-space:pre"> <span style="white-space:pre"> </span></span>file=File.desktopDirectory.resolvePath(<span style="color: #ff0000;">&#8220;recording</span><span style="color: #ff0000;">.flv&#8221;</span>);<br />
<span style="white-space:pre"> <span style="white-space:pre"> </span></span>recorder.setTarget(file,640,480,fps,systemManager, durationInSeconds)</p>
<p>the duration is optional, it will be automaticly filled in when left blank.</p>
<p>3. Insert some bitmaps, bitmapdatas or a screenshot of a component into the flv-file:<br />
<span style="white-space:pre"> </span>recorder.captureComponent(vidDisplay)	<span style="white-space:pre"> <span style="white-space:pre"> </span></span><span style="color: #339966;">//DisplayObject, takes a screenshot from that component<br />
<span style="color: #339966;"><span style="white-space:pre"><span style="color: #000000;"> </span></span><span style="color: #000000;">recorder.saveFrame(bmpdata) </span><span style="white-space:pre"><span style="color: #000000;"> </span><span style="white-space:pre"> </span></span></span><span style="color: #339966;">//Bitmapdata, does nothing with it<br />
<span style="color: #339966;"><span style="white-space:pre"><span style="color: #000000;"> </span></span><span style="color: #000000;">recorder. saveSmoothedBitmapFrame(bmp)</span></span><span style="color: #339966;"> </span><span style="white-space:pre"><span style="color: #339966;"> <span style="white-space:pre"> </span></span></span><span style="color: #339966;">//Bitmap, smooths before saving<br />
<span style="color: #339966;"><span style="white-space:pre"><span style="color: #000000;"> </span></span><span style="color: #000000;">recorder. saveSmoothedFrame(bmpdata)</span><span style="white-space:pre"> <span style="white-space:pre"> </span></span></span><span style="color: #339966;">//Bitmapdata, smooths bitmapdata before saving</span></span></span></span></p>
<p>4. To stop recording, simply command the class to stop, it will start to convert your saved data to the flv-file<br />
<span style="white-space:pre"> </span>recorder.stopRecording()</p>
<p><span style="white-space:pre"> </span>It will throw 3 events, when saving starts, when savings stops and one while saving to pass on the savings progress<br />
<span style="white-space:pre"> <span style="white-space:pre"> </span></span>FLVRecorderEvent.FLV_START_CREATION<br />
<span style="white-space:pre"> <span style="white-space:pre"> </span></span>FLVRecorderEvent.FLV_CREATED<br />
<span style="white-space:pre"> <span style="white-space:pre"> </span></span>FLVRecorderEvent.PROGRESS //event contains progress property, is a value between 0-1 to indicate progress</p>
<p>5. All done, that&#8217;s how simple things can be in life.</p>
<p>6. Test it, use it and give me feedback of your experiences!</p>
<p><!--StartFragment--></p>
<h3><span lang="EN-GB">How–to-use code example</span></h3>
<p><span style="color: #0000ff;">private</span> <span style="color: #33cccc;">var</span> tmr:Timer<br />
<span style="color: #0000ff;"> private</span> <span style="color: #33cccc;">var</span> recorder:FLVRecorder<br />
<span style="color: #0000ff;"> private</span> <span style="color: #33cccc;">var</span> file:File</p>
<p><span style="color: #0000ff;">private</span> <span style="color: #33cccc;">function</span> startRecording():<span style="color: #0000ff;">void</span>{</p>
<p><span style="white-space:pre"> </span><span style="color: #0000ff;">if</span>(recorder==<span style="color: #0000ff;">null</span>){<br />
<span style="white-space:pre"> </span>recorder=FLVRecorder.getInstance()<br />
<span style="white-space:pre"> </span>}<br />
<span style="white-space:pre"> </span>file=File.desktopDirectory.resolvePath(<span style="color: #ff0000;">&#8220;recording</span><span style="color: #ff0000;">.flv&#8221;</span>);<br />
<span style="white-space:pre"> </span>recorder.setTarget(file,640,480,fps,systemManager)</p>
<p><span style="white-space:pre"> </span>if(tmr==<span style="color: #0000ff;">null</span>){<br />
<span style="white-space:pre"> </span>tmr=<span style="color: #0000ff;">new</span> Timer(1000/fps)<br />
<span style="white-space:pre"> </span>}<br />
<span style="white-space:pre"> </span>tmr.addEventListener(TimerEvent.TIMER,record)<br />
<span style="white-space:pre"> </span>tmr.start()<br />
}</p>
<p><span style="color: #0000ff;">private</span> <span style="color: #33cccc;">function</span> record(e:TimerEvent):<span style="color: #0000ff;">void</span>{<br />
<span style="white-space:pre"> </span>recorder.captureComponent(vidDisplay)	<span style="white-space:pre"> </span><span style="color: #339966;">//DisplayObject</span><br />
<span style="white-space:pre"> </span><span style="color: #339966;">//recorder.saveFrame(bmpdata) </span><span style="white-space:pre"><span style="color: #339966;"> </span></span><span style="color: #339966;">//Bitmapdata<br />
</span><span style="white-space:pre"><span style="color: #339966;"> </span></span><span style="color: #339966;">//recorder. saveSmoothedBitmapFrame(bmp) </span><span style="white-space:pre"><span style="color: #339966;"> </span></span><span style="color: #339966;">//Bitmap<br />
</span><span style="white-space:pre"><span style="color: #339966;"> </span></span><span style="color: #339966;">//recorder. saveSmoothedFrame(bmpdata) </span><span style="white-space:pre"><span style="color: #339966;"> </span></span><span style="color: #339966;">//Bitmapdata</span><br />
}</p>
<p><span style="color: #0000ff;">private</span> <span style="color: #33cccc;">function</span> stopRecording():<span style="color: #0000ff;">void</span>{<br />
<span style="white-space:pre"> </span>tmr.stop()</p>
<p><span style="white-space:pre"> </span><span style="color: #339966;">//when saving is done</span><br />
<span style="white-space:pre"> </span>recorder.addEventListener(FLVRecorderEvent.FLV_CREATED,fileMade)</p>
<p><span style="white-space:pre"> </span><span style="color: #339966;">//when saving starts</span><br />
<span style="white-space:pre"> </span>recorder.addEventListener(FLVRecorderEvent.FLV_START_CREATION,startCreatingFLV)</p>
<p><span style="white-space:pre"> </span>recorder.stopRecording()<br />
}</p>
<p><span style="color: #0000ff;">private</span> <span style="color: #33cccc;">function</span> startCreatingFLV(e:FLVRecorderEvent):<span style="color: #0000ff;">void</span>{<br />
<span style="white-space:pre"> </span>recorder.addEventListener(FLVRecorderEvent.PROGRESS,onFLVCreationProgress)<br />
}</p>
<p><span style="color: #0000ff;">private</span> <span style="color: #33cccc;">function</span> onFLVCreationProgress(e:FLVRecorderEvent):<span style="color: #0000ff;">void</span>{<br />
<span style="white-space:pre"> </span><span style="color: #339966;">//e.progress: percent complete (0 to 1)<br />
</span><span style="white-space:pre"><span style="color: #339966;"> </span></span><span style="color: #339966;">//pbSaving: ProgressBar component in Flex</span><br />
<span style="white-space:pre"> </span>pbSaving.setProgress(e.progress,1)<br />
}</p>
<h2>Downloads</h2>
<p><a title="Download AirCam" href="http://flvrecorder.googlecode.com/files/AirCam.air" onclick="pageTracker._trackPageview('/outgoing/flvrecorder.googlecode.com/files/AirCam.air?referer=');"><img class="alignnone size-medium wp-image-278" title="Download AIRCam" src="http://labs.boulevart.be/wp-content/uploads/2008/09/128.png" alt="" height="128" /></a><a title="Download source" href="http://flvrecorder.googlecode.com/files/flvrecorder_0.2.zip" onclick="pageTracker._trackPageview('/outgoing/flvrecorder.googlecode.com/files/flvrecorder_0.2.zip?referer=');"><img class="alignnone size-medium wp-image-279" title="Download source" src="http://labs.boulevart.be/wp-content/uploads/2008/09/zip.png" alt="" height="128" /></a></p>
<h2>Contact!</h2>
<p>Share your opinion with us, leave a comment!<br />
Also tell me if you&#8217;re using the class, what you wanted to see different, share your enhancements!<br />
Don&#8217;t forget to show me what apps you made with these classes!</p>
<p>You can always reach me:<br />
just leave a comment!</p>
<h2>*UPDATE 1*</h2>
<p>Thanks for your feedbacks, I&#8217;ve updated the classes to help out a few of you.<br />
What is new:</p>
<p>An <em>enableCompression</em> property: will compress the captured image with the JPGEncoder<br />
Warning! Using this property will slow you application down.</p>
<p><em>Codecs</em>:<br />
Pick a codec. You can find the available codecs in the FlvRecorderCodecs class.</p>
<p><em>Pausing &amp; Resuming recordings</em>:<br />
You can pause &amp; resume recordings.<br />
If you stop feeding the class frames, and not call the stopRecording() function, and after a while, feeding it some frames again, it will add those frames to the current movie.</p>
<p><span style="text-decoration: underline;"><a href="http://flvrecorder.googlecode.com/files/flvrecorder_0.2.zip" onclick="pageTracker._trackPageview('/outgoing/flvrecorder.googlecode.com/files/flvrecorder_0.2.zip?referer=');">Download update here.</a></span></p>
<h2>*UPDATE 2*</h2>
<p>Because I am using a Pseudo-Threading  class that is using a specific Flex class, and a lot of you are Flash-only developers, I have released a library for Flash (AS3) on Google Code.<br />
<a title="FLVRecorder Flash" href="http://flvrecorder.googlecode.com/files/flvrecorder0.2_flash.zip" onclick="pageTracker._trackPageview('/outgoing/flvrecorder.googlecode.com/files/flvrecorder0.2_flash.zip?referer=');">Here is a link.</a></p>
<p><span style="text-decoration: underline;"><br />
</span></p>
<p><span style="text-decoration: underline;"><br />
</span></p>
<p><!--EndFragment--></p>
]]></content:encoded>
			<wfw:commentRss>http://www.joristimmerman.be/wordpress/2008/12/18/flvrecorder-record-to-flv-using-air/feed/</wfw:commentRss>
		<slash:comments>43</slash:comments>
		</item>
	</channel>
</rss>

