<?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>Martin Collett</title>
	<atom:link href="http://martincollett.com/blog/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://martincollett.com/blog</link>
	<description>Live television and web development</description>
	<lastBuildDate>Thu, 21 Oct 2010 14:06:58 +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>Spending review Wordcloud</title>
		<link>http://martincollett.com/blog/?p=391</link>
		<comments>http://martincollett.com/blog/?p=391#comments</comments>
		<pubDate>Wed, 20 Oct 2010 14:38:06 +0000</pubDate>
		<dc:creator>martincollett</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://martincollett.com/blog/?p=391</guid>
		<description><![CDATA[Channel 4 News has just published a wordcloud of Chancellor George Osborne&#8217;s package of cuts for the UK. Great way of seeing the language used to break the bad news&#8230;]]></description>
			<content:encoded><![CDATA[<p>Channel 4 News has just published a <a href="http://www.channel4.com/news/spending-review-george-osborne-snowcloud">wordcloud</a> of Chancellor George Osborne&#8217;s package of cuts for the UK. Great way of seeing the language used to break the bad news&#8230;
<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fmartincollett.com%2Fblog%2F%3Fp%3D391"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif&amp;source=martincollett&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
]]></content:encoded>
			<wfw:commentRss>http://martincollett.com/blog/?feed=rss2&#038;p=391</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>At last, embeddable Snowclouds</title>
		<link>http://martincollett.com/blog/?p=197</link>
		<comments>http://martincollett.com/blog/?p=197#comments</comments>
		<pubDate>Thu, 08 Oct 2009 23:33:24 +0000</pubDate>
		<dc:creator>Martin Collett</dc:creator>
				<category><![CDATA[Actionscript 3.0]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://martincollett.com/blog/?p=197</guid>
		<description><![CDATA[I just finished an update to the Snowcloud project that renders clouds in two different sizes, depending on whether they&#8217;re embedded or not &#8211; the new embedded version is below&#8230;]]></description>
			<content:encoded><![CDATA[<p>I just finished an update to the Snowcloud project that renders clouds in two different sizes, depending on whether they&#8217;re embedded or not &#8211; the new embedded version is below&#8230;</p>
<p><object id="snowcloud" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="540" height="600" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="quality" value="high" /><param name="allowScriptAccess" value="sameDomain" /><param name="src" value="http://c4news.com/livepages/wordcloud/brown_2009/wordCloud.sw?embed=true" /><param name="name" value="snowcloud" /><param name="align" value="middle" /><param name="allowfullscreen" value="true" /><embed id="snowcloud" type="application/x-shockwave-flash" width="540" height="600" src="http://c4news.com/livepages/wordcloud/brown_2009/wordCloud.sw?embed=true" allowfullscreen="true" align="middle" name="snowcloud" allowscriptaccess="sameDomain" quality="high"></embed></object></p>
<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fmartincollett.com%2Fblog%2F%3Fp%3D197"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif&amp;source=martincollett&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
]]></content:encoded>
			<wfw:commentRss>http://martincollett.com/blog/?feed=rss2&#038;p=197</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fix image memory leaks in Air / AS3</title>
		<link>http://martincollett.com/blog/?p=184</link>
		<comments>http://martincollett.com/blog/?p=184#comments</comments>
		<pubDate>Tue, 07 Jul 2009 21:46:15 +0000</pubDate>
		<dc:creator>Martin Collett</dc:creator>
				<category><![CDATA[Actionscript 3.0]]></category>
		<category><![CDATA[Air]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://martincollett.com/blog/?p=184</guid>
		<description><![CDATA[wow &#8211; how hard is it to stop memory leaks in AS3? Programming for FP10 AIR in Flex, I have a class that loads an image from the web by setting the source property on the image to a url. I add and remove many instances of the class on the display list. I get [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-medium wp-image-186" title="code" src="http://martincollett.com/blog/wp-content/uploads/2009/07/code-300x219.jpg" alt="code" width="261" height="156" />wow &#8211; how hard is it to stop memory leaks in AS3? Programming for FP10 AIR in Flex, I have a class that loads an image from the web by setting the source property on the image to a url.</p>
<p>I add and remove many instances of the class on the display list. I get lots of memory leakage. All my listeners are weakly referenced, I even remove the event listeners when I unload the class instances. I also delete everything I&#8217;ve created. Still memory leaks. It turns out, and it took a while to find this, that you need to &#8220;unloadAndStop(true)&#8221; on images you&#8217;ve loaded, then they get unloaded from memory. Now, no memory leaks.</p>
<p>There don&#8217;t seem to be many mentions of this, certainly one to watch out for if you&#8217;re having memory problems!
<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fmartincollett.com%2Fblog%2F%3Fp%3D184"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif&amp;source=martincollett&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
]]></content:encoded>
			<wfw:commentRss>http://martincollett.com/blog/?feed=rss2&#038;p=184</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Twitter live on Television</title>
		<link>http://martincollett.com/blog/?p=151</link>
		<comments>http://martincollett.com/blog/?p=151#comments</comments>
		<pubDate>Fri, 26 Jun 2009 15:00:51 +0000</pubDate>
		<dc:creator>Martin Collett</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Television]]></category>
		<category><![CDATA[Twitter]]></category>

		<guid isPermaLink="false">http://martincollett.com/blog/?p=151</guid>
		<description><![CDATA[We&#8217;ve just put our new Twitter application on the Noon programme, getting reaction and questions after the death of Michael Jackson. I&#8217;m really excited to have web technology and television graphics working together, it&#8217;s something I think we&#8217;ll be seeing much more of. Now our presenters in the studio search on Twitter, select the tweets [...]]]></description>
			<content:encoded><![CDATA[<div class="mceTemp">
<dl id="attachment_156" class="wp-caption alignleft" style="width: 280px;">
<dt class="wp-caption-dt"><a title="Geller interview" href="http://www.channel4.com/news/articles/arts_entertainment/music/geller+aposjackson+denied+abuse+claims+to+meapos/3233862" target="_blank"><img class="size-medium wp-image-156" title="twitterBlog" src="http://martincollett.com/blog/wp-content/uploads/2009/06/twitterBlog-300x210.jpg" alt="Twitter Live on Channel 4 News" width="270" height="190" /></a></dt>
</dl>
</div>
<p>We&#8217;ve just put our new Twitter application on the Noon programme, getting reaction and questions after the death of Michael Jackson. I&#8217;m really excited to have web technology and television graphics working together, it&#8217;s something I think we&#8217;ll be seeing much more of. Now our presenters in the studio search on Twitter, select the tweets they like, and immediately put them on air from the studio laptop, no outside involvemement necessary. Emails and web texts appear on the app in the same way too. Collaboration is also possible, a producer in the newsroom can filter the Tweets to make the presenter&#8217;s job easier. Profanity and url filtering is built in, as well as removal of some of the Twitter tags to make it more presentable on the telly.</p>
<p>I&#8217;ve been writing this app for about a month now (ever since Krishnan did &#8216;<a title="Surgery Live" href="http://www.channel4.com/explore/surgerylive/index.html" target="_blank">Surgery Live</a>&#8216; &#8211; watching the programme and the Twitter feed together felt like a totally new way of doing tv), and it&#8217;s finally reached a mature enough stage that we can put it live on air. There&#8217;s a slight issue with recovery after loss of network connection that will be fixed in the next day or so &#8211; in the meantime the time honoured IT Crowd fix of turning it off and on again works well enough!</p>
<p>I learned a lot about regular expressions during this project, Grant Skinner&#8217;s excellent <a title="RegExr" href="http://gskinner.com/RegExr/" target="_blank">RegExr</a> was invaluable for debugging AS3 regular expressions.</p>
<p>Stay tuned, we&#8217;re working on a few other exciting web ideas that will be on the programme soon, Tweet @krishgm (our presenter <a title="Krishnan" href="http://www.channel4.com/news/authors/krishnan+gurumurthy/106080" target="_blank">Krishnan</a>), @martincollett (me), @channel4news or @c4news (the studio)<a href="http://twitter.com/channel4news" target="new"></a>
<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fmartincollett.com%2Fblog%2F%3Fp%3D151"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif&amp;source=martincollett&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
]]></content:encoded>
			<wfw:commentRss>http://martincollett.com/blog/?feed=rss2&#038;p=151</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Obama&#8217;s first 100 days</title>
		<link>http://martincollett.com/blog/?p=143</link>
		<comments>http://martincollett.com/blog/?p=143#comments</comments>
		<pubDate>Wed, 29 Apr 2009 15:17:09 +0000</pubDate>
		<dc:creator>Martin Collett</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://martincollett.com/blog/?p=143</guid>
		<description><![CDATA[Channel 4 News have re-released one of my Flash apps, a picture montage showing images from Barack Obama&#8217;s first 100 days as President.  I wrote it as an end of year piece, 100 images from 2008, the tweening is written inside an enter frame listener, the image size is calculated by measuring distance to the [...]]]></description>
			<content:encoded><![CDATA[<p><a title="Channel 4 News" href="http://www.channel4.com/news/articles/politics/international_politics/interactive+obamas+first+100+days/3115877" target="_blank"><img class="alignleft size-full wp-image-145" title="29_obama_montage_k1" src="http://martincollett.com/blog/wp-content/uploads/2009/04/29_obama_montage_k1.jpg" alt="29_obama_montage_k1" width="278" height="253" /></a><a href="http://channel4.com/news" target="_blank">Channel 4 News</a> have re-released one of my Flash apps, a <a title="Obama's first 100 days" href="http://www.channel4.com/news/articles/politics/international_politics/interactive+obamas+first+100+days/3115877" target="_blank">picture montage</a> showing images from Barack Obama&#8217;s first 100 days as President.  I wrote it as an end of year piece, <a title="Interactive images of the year" href="http://www.channel4.com/news/articles/world/interactive+images+of+the+year/2890767" target="_blank">100 images from 2008</a>, the tweening is written inside an enter frame listener, the image size is calculated by measuring distance to the mouse position.
<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fmartincollett.com%2Fblog%2F%3Fp%3D143"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif&amp;source=martincollett&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
]]></content:encoded>
			<wfw:commentRss>http://martincollett.com/blog/?feed=rss2&#038;p=143</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Live blogging election results programme</title>
		<link>http://martincollett.com/blog/?p=127</link>
		<comments>http://martincollett.com/blog/?p=127#comments</comments>
		<pubDate>Sat, 14 Mar 2009 11:00:03 +0000</pubDate>
		<dc:creator>Martin Collett</dc:creator>
				<category><![CDATA[Live Blogging]]></category>
		<category><![CDATA[Radio]]></category>

		<guid isPermaLink="false">http://martincollett.com/blog/?p=127</guid>
		<description><![CDATA[Have been listening until way too late last night to great live coverage of the Nottingham University Union elections &#8211; with neat live blogging, texts (moderated) into the programme, pretty much instant news updates and video updates too -  here . It&#8217;s interesting how much a text &#8216;back channel&#8217; added to the whole experience, there [...]]]></description>
			<content:encoded><![CDATA[<p><a title="University Radio Nottingham" href="http://urn1350.net" target="_blank"><img class="alignleft size-medium wp-image-128" title="mainpromo_electionsnight" src="http://martincollett.com/blog/wp-content/uploads/2009/03/mainpromo_electionsnight-300x169.png" alt="mainpromo_electionsnight" width="300" height="169" /></a>Have been listening until way too late last night to great live coverage of the Nottingham University Union elections &#8211; with neat live blogging, texts (moderated) into the programme, pretty much instant news updates and video updates too -  <a title="http://urn1350.net/elections/electionsnight" href="http://urn1350.net/elections/electionsnight" target="_blank">here</a> . It&#8217;s interesting how much a text &#8216;back channel&#8217; added to the whole experience, there are lessons here for my day job I&#8217;m sure. Superb presentation team, they had to be too keep me interested for so long, they really captured the live event, made you want to be there and it&#8217;s best that I don&#8217;t  say how many years it was since I was at Uni!  OK &#8211; I have to declare an interest, Katie was reporting live from the count until 4am. All genuinely very impressive stuff. They win loads at the Student Radio Awards every year, expect more for this!
<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fmartincollett.com%2Fblog%2F%3Fp%3D127"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif&amp;source=martincollett&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
]]></content:encoded>
			<wfw:commentRss>http://martincollett.com/blog/?feed=rss2&#038;p=127</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flash weather station</title>
		<link>http://martincollett.com/blog/?p=117</link>
		<comments>http://martincollett.com/blog/?p=117#comments</comments>
		<pubDate>Mon, 09 Feb 2009 20:24:19 +0000</pubDate>
		<dc:creator>Martin Collett</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Papervision 3D]]></category>
		<category><![CDATA[Television]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://martincollett.com/blog/?p=117</guid>
		<description><![CDATA[Yesterday I bumped into a near neighbour David, who runs harpendenweather.co.uk, a great website that shows live weather data for Harpenden, my home town. The live data is rendered using Flash, it has a very nice analogue look and feel, everything is nicely smoothed as the weather changes. The page lets me know what&#8217;s going [...]]]></description>
			<content:encoded><![CDATA[<p><a title="harpendenweather.co.uk" href="http://harpendenweather.co.uk" target="_blank"><img class="alignleft size-medium wp-image-116" title="harpenden_weather" src="http://martincollett.com/blog/wp-content/uploads/2009/02/harpenden_weather-300x204.jpg" alt="harpenden_weather" width="267" height="193" /></a>Yesterday I bumped into a near neighbour David, who runs <a title="harpendenweather.co.uk" href="http://harpendenweather.co.uk" target="_blank">harpendenweather.co.uk</a>, a great website that shows live weather data for Harpenden, my home town. The live data is rendered using Flash, it has a very nice analogue look and feel, everything is nicely smoothed as the weather changes. The page lets me know what&#8217;s going on outside without ever having to leave the computer and set foot through the front door&#8230; It was useful during the summer, I can check wind speeds before flying (crashing!) my electric heli outside.</p>
<p>David has a whole range of sensors on the roof of his house for just about every meteorological value you might imagine, he uploads data to the site every 4 seconds, and you can browse historical trends too. He&#8217;s even planning to add a webcam, great work!
<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fmartincollett.com%2Fblog%2F%3Fp%3D117"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif&amp;source=martincollett&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
]]></content:encoded>
			<wfw:commentRss>http://martincollett.com/blog/?feed=rss2&#038;p=117</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Snowclouds in Washington DC</title>
		<link>http://martincollett.com/blog/?p=84</link>
		<comments>http://martincollett.com/blog/?p=84#comments</comments>
		<pubDate>Tue, 20 Jan 2009 23:47:12 +0000</pubDate>
		<dc:creator>Martin Collett</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Television]]></category>

		<guid isPermaLink="false">http://martincollett.com/blog/?p=84</guid>
		<description><![CDATA[Hello from Washington DC, where I&#8217;ve been directing our coverage for Channel 4 News and ITV news on Barack Obama&#8217;s inauguration day. I was working for most of the time on the roof of the Canadian Embassy, overlooking the Capitol building while the new president was being sworn in. It was cold, sitting directing for 3 hours [...]]]></description>
			<content:encoded><![CDATA[<div class="mceTemp">
<dl id="attachment_89" class="wp-caption alignnone" style="width: 228px;">
<dt class="wp-caption-dt"><a title="Obama Inauguration snowcloud" href="http://www.channel4.com/news/articles/politics/international_politics/snowcloud+obama+inauguration+speech/2907297" target="_blank"><img class="size-medium wp-image-89" title="Obama wordcloud" src="http://martincollett.com/blog/wp-content/uploads/2009/01/obama360-300x213.jpg" alt="Obama wordcloud image" width="218" height="154" /></a></dt>
</dl>
</div>
<p>Hello from Washington DC, where I&#8217;ve been directing our coverage for Channel 4 News and ITV news on Barack Obama&#8217;s inauguration day. I was working for most of the time on the roof of the Canadian Embassy, overlooking the Capitol building while the new president was being sworn in.</p>
<p>It was cold, sitting directing for 3 hours at -11C, it took most of the rest of the day to thaw out, but the superb view was great compensation.</p>
<p>Before I came out I (almost) finished off a word / <a title="Obama Snowclud" href="http://www.channel4.com/news/articles/politics/international_politics/snowcloud+obama+inauguration+speech/2907297" target="_blank">snowcloud</a> generator for Channel 4 News, it&#8217;s probably the bit of Flash programming I&#8217;m most pleased with, at the moment. Have a play, it indexes the most-used words back into the full text of Barack Obama&#8217;s inauguration speech, and lets you watch the video at the same time. I&#8217;ll be working on improving the look and feel when I get back to the UK&#8230;
<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fmartincollett.com%2Fblog%2F%3Fp%3D84"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif&amp;source=martincollett&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
]]></content:encoded>
			<wfw:commentRss>http://martincollett.com/blog/?feed=rss2&#038;p=84</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Simple Flex / Air / BlazeDS messaging example</title>
		<link>http://martincollett.com/blog/?p=42</link>
		<comments>http://martincollett.com/blog/?p=42#comments</comments>
		<pubDate>Wed, 24 Dec 2008 00:33:30 +0000</pubDate>
		<dc:creator>Martin Collett</dc:creator>
				<category><![CDATA[Actionscript 3.0]]></category>
		<category><![CDATA[BlazeDS]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://martincollett.com/blog/?p=42</guid>
		<description><![CDATA[Here's a demo showing an Air app connected to the messaging service on a BlazeDS server.]]></description>
			<content:encoded><![CDATA[<p>I need to connect two Air apps running on different machines, looks like BlazeDS is going to work best for me.  I found <a href="http://www.brightworks.com/flex_ability/?p=74" target="_blank">this</a> good example, and some code from that is used for the database connection below,  but there don&#8217;t seem to be any examples of Air to BlazeDS messaging connection so have posted this, hope it&#8217;s useful. You need to have the BlazeDS turnkey installed and running, and the HSQLDB db should be started. The Air app is a &#8216;vanilla&#8217; project &#8211; you don&#8217;t need to mess with any J2EE or server settings in Flex when you create the project, all the config is in the AS3. No need to edit anything server side either.<br />
It took a while to figure out how to connect to the messaging service, I&#8217;m not sure why the &#8216;ro2.destination = &#8216; line isn&#8217;t needed.<br />
Full code after the jump.</p>
<p><span id="more-42"></span></p>
<pre>
<pre class="brush: java">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;!--minimal Air example, communication with BlazeDS server database and messaging--&gt;
&lt;!--no extra server config needed inside Flex environment--&gt;
&lt;mx:WindowedApplication
        xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot;
        backgroundColor=&quot;#FFFFFF&quot;
        creationComplete=&quot;init()&quot; width=&quot;837&quot; height=&quot;660&quot;&gt;
    &lt;mx:Script&gt;
        &lt;![CDATA[
        	import mx.messaging.channels.PollingChannel;
        	import mx.messaging.events.ChannelFaultEvent;
        	import mx.messaging.FlexClient;
        	import mx.rpc.events.FaultEvent;
            import mx.messaging.Channel;
            import mx.messaging.ChannelSet;

            import mx.messaging.channels.AMFChannel;
			import mx.messaging.messages.AsyncMessage;
			import mx.messaging.messages.IMessage;
			import mx.messaging.Consumer;
			import mx.messaging.Producer;
			import mx.messaging.channels.StreamingAMFChannel;
			import mx.messaging.events.MessageEvent;
			import mx.messaging.events.ChannelEvent;
			import mx.messaging.FlexClient;
			import mx.rpc.remoting.RemoteObject;
			import com.carlcalderon.arthropod.Debug;			

			private var producer:Producer = new Producer();
            private var consumer:Consumer = new Consumer();
            private var blazeUrl:String = &quot;http://192.168.1.201:8400/samples/messagebroker/&quot;; //url of turnkey BlazeDS installation
            [Bindable]
			private var ro1:RemoteObject = new RemoteObject();
			private var ro2:RemoteObject = new RemoteObject();

            public function init():void
            {
            	Debug.clear();
	           	ro1.addEventListener(FaultEvent.FAULT, logFault);
            	ro2.addEventListener(FaultEvent.FAULT, logFault);

            	//config db...
                var cs:ChannelSet = new ChannelSet();
                var customChannel:Channel = new AMFChannel(&quot;my-amf&quot;, blazeUrl + &quot;amf&quot;);
                cs.addChannel(customChannel);
                ro1.channelSet = cs;
                ro1.destination = &quot;product&quot;;

                //config messages
                ro2.channelSet = cs; //same address as database
                //ro2.destination = &quot;chat-room-service&quot;; //this line not needed, why not?? (maybe defaults...)
                var myStreamingAMF:StreamingAMFChannel = new StreamingAMFChannel(&quot;my-streaming-amf&quot;, blazeUrl + &quot;streamingamf&quot;);
				var myPollingAMF:AMFChannel = new AMFChannel(&quot;my-polling-amf&quot;, blazeUrl + &quot;amfpolling&quot;);
				myPollingAMF.pollingEnabled = true;
				myPollingAMF.pollingInterval = 5000; //set long, so we can see when polling kicks in

				//next line from http://www.dcooper.org/Blog/client/index.cfm?mode=entry&amp;amp;amp;amp;amp;amp;entry=8E1439AD-4E22-1671-58710DD528E9C2E7
				myPollingAMF.piggybackingEnabled = true; //makes quick response for a polling channel, only on sending machine though...
				var channelSet:ChannelSet = new ChannelSet();
				channelSet.addEventListener(ChannelEvent.CONNECT, channelConnected);
				channelSet.addChannel(myStreamingAMF); //looks like need to add streaming first, then polling, else doesn&#039;t work
				//channelSet.addChannel(myPollingAMF); //if you add polling, it only ever polls, doesn&#039;t stream
				consumer.channelSet = channelSet;
				producer.channelSet = channelSet;
				var name:String= &quot;chat&quot;; //this needs to be &#039;chat&#039;, listed as a destination in BlazeDS &#039;messaging-config.xml&#039;
				consumer.destination = name;
				producer.destination = name;
				consumer.addEventListener(MessageEvent.MESSAGE, messageHandler);
				consumer.subscribe();
				Debug.log(&quot;client id: &quot; + mx.messaging.FlexClient.getInstance().id);
            }

			private function send():void
			{
				Debug.log(&quot;send&quot;);
				var message:IMessage = new AsyncMessage();
				message.body.chatMessage = msg.text;
				producer.send(message);
				msg.text = &quot;&quot;;
			}

			private function messageHandler(e:MessageEvent):void
			{
				Debug.log(&quot;receive&quot;);
				log.text += e.message.body.chatMessage + &quot;\n&quot;;
			}
			private function channelConnected(e:ChannelEvent):void {
				Debug.log(e);
			}
			private function logFault(e:FaultEvent):void{
				Debug.log(e);
			}
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:DataGrid dataProvider=&quot;{ro1.getProducts.lastResult}&quot; width=&quot;734.1666&quot; height=&quot;326.9697&quot;/&gt;
    &lt;mx:Button label=&quot;Get Data&quot; click=&quot;ro1.getProducts()&quot;/&gt;
	&lt;mx:Panel title=&quot;Chat&quot; width=&quot;735.4546&quot; height=&quot;249.01517&quot;&gt;
		&lt;mx:TextArea id=&quot;log&quot; width=&quot;699.01514&quot; height=&quot;162.42424&quot;/&gt;
		&lt;mx:ControlBar&gt;
			 &lt;mx:TextInput id=&quot;msg&quot; width=&quot;100%&quot; enter=&quot;send()&quot;/&gt;
			 &lt;mx:Button label=&quot;Send&quot; click=&quot;send()&quot;/&gt;
		&lt;/mx:ControlBar&gt;
	&lt;/mx:Panel&gt;
&lt;/mx:WindowedApplication&gt;
</pre>
</pre>
<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fmartincollett.com%2Fblog%2F%3Fp%3D42"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif&amp;source=martincollett&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
]]></content:encoded>
			<wfw:commentRss>http://martincollett.com/blog/?feed=rss2&#038;p=42</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Superb realtime visualisation tool</title>
		<link>http://martincollett.com/blog/?p=8</link>
		<comments>http://martincollett.com/blog/?p=8#comments</comments>
		<pubDate>Sun, 19 Oct 2008 21:47:34 +0000</pubDate>
		<dc:creator>Martin Collett</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://martincollett.com/blog/?p=8</guid>
		<description><![CDATA[I got very inspired at this year&#8217;s Flash on the Beach, brilliant presentation by really inspirational coders. One of the guys was showing processing, along with VVV, a realtime rendering and programming tool. The programming is entirely visual, and it talks the reactTIVision lanuage, a multitouch and object recognition tool. I&#8217;ll try to post some [...]]]></description>
			<content:encoded><![CDATA[<p>I got very inspired at this year&#8217;s <a title="FOTB 08" href="http://www.flashonthebeach.com/" target="_blank">Flash on the Beach</a>, brilliant presentation by really inspirational coders. One of the guys was showing <a title="processing" href="http://www.processing.org/" target="_blank">processing</a>, along with <a title="VVV tool" href="http://vvvv.org/tiki-index.php" target="_blank">VVV</a>, a realtime rendering and programming tool. The programming is entirely visual, and it talks the <a title="reacTIVision" href="http://reactable.iua.upf.edu/?software" target="_blank">reactTIVision</a> lanuage, a multitouch and object recognition tool. I&#8217;ll try to post some examples when I get them up and working, but if you have a few hours to waste check it out!
<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fmartincollett.com%2Fblog%2F%3Fp%3D8"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif&amp;source=martincollett&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
]]></content:encoded>
			<wfw:commentRss>http://martincollett.com/blog/?feed=rss2&#038;p=8</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

