<?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>i-create &#124; therefore-i am &#187; JavaScript</title>
	<atom:link href="http://i-create.org/tag/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://i-create.org</link>
	<description>i-create &#124; therefore i-am &#124; a blog about opensource technology and rich internet applications</description>
	<lastBuildDate>Thu, 05 Aug 2010 04:19:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Virtual Painting with Hype</title>
		<link>http://i-create.org/2010/08/03/virtual-painting-with-hype/</link>
		<comments>http://i-create.org/2010/08/03/virtual-painting-with-hype/#comments</comments>
		<pubDate>Wed, 04 Aug 2010 04:28:55 +0000</pubDate>
		<dc:creator>Brendon Smith</dc:creator>
				<category><![CDATA[3d]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[art]]></category>
		<category><![CDATA[i-create]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[Experiment]]></category>
		<category><![CDATA[Generative]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[hype]]></category>

		<guid isPermaLink="false">http://i-create.org/?p=826</guid>
		<description><![CDATA[The hypeframe work is truly a unique library it offers generative artists a new tool to quickly create generative art. I believe it also provides flash developers with a rich actionscript library that does a great deal of heavy lifting. The library allows you to quickly create swarming effects that you can use to create [...]]]></description>
			<content:encoded><![CDATA[<p>The hypeframe work is truly a unique library it offers generative artists a new tool to quickly create generative art.  I believe it also provides flash developers with a rich actionscript library that does a great deal of heavy lifting.  The library allows you to quickly create swarming effects that you can use to create stunning artwork rapidly.  In the example below I am using hype to paint a picture it does this by grabbing the pixel value and then applying it to the canvas.  As a result you can simulate a painting effect that can really turn out stunning results.  This is one of the many things I really like about this library, is how quickly you can create art with it! <br/><br/>Simple Hype Painting Example:<br/><a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2ktY3JlYXRlLm9yZy9hY3Rpb25zY3JpcHQvdmlydHVhbF9wYWludGluZy8/S2VlcFRoaXM9dHJ1ZSYjMDM4O1RCX2lmcmFtZT10cnVlJiMwMzg7aGVpZ2h0PTUwMCYjMDM4O3dpZHRoPTYwMA==" class=\"thickbox\" title=\"Virtual Painting with the HypeFramework\"><img src="http://i-create.org/actionscript/virtual_painting/ireland.jpg" alt="HypeFramework Painting Example"/></a><br/><a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2ktY3JlYXRlLm9yZy9hY3Rpb25zY3JpcHQvdmlydHVhbF9wYWludGluZy92aXJ0dWFsX3BhaW50aW5nLnppcA==" title=\"Download the Code\">Download Example / <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2ktY3JlYXRlLm9yZy9hY3Rpb25zY3JpcHQvdmlydHVhbF9wYWludGluZy8/S2VlcFRoaXM9dHJ1ZSYjMDM4O1RCX2lmcmFtZT10cnVlJiMwMzg7aGVpZ2h0PTUwMCYjMDM4O3dpZHRoPTYwMA==" class=\"thickbox\" title=\"Virtual Painting with the HypeFramework\">Launch Demo</a><br/>So what have I been up to lately?  I have really been diving into html5 with webGL coming out soon I think combining html5, webgl, and flash developers will be able to create a whole new breed of rich internet applications.  I have also been shifting my focus on mobile, because it is the only way truly creative developers can rapidly create applications and profit off of them quickly.  It has the lowest barrier of entry and with mobile really starting to take off most applications will have to be completely re-written for these low power, light weight devies that everyone will use.  I am excited about what I see and I believe webGL will be supported in both the iphone, android, and hopefully palm!  I also believe that javascript development will be needed more and more simply because javascript is the glue that holds the web together and it is supported by all mobile platforms.  So you may see a variety of experiments here and I don&#8217;t think of development as javascript vs. actionscipt I just view them as working more together instead of against each other so this is not an HTML5 vs. Flash thing.  I wouldn&#8217;t be surprised one bit by adobe releasing a Flash to Canvas feature for CS6.  What makes flash so compelling to me is the amount of libraries available to developers.  I would also be willing to bet in the near future flash will also support 3d hardware acceleration this would really allow for lots of new games on the flash platform. Not too mention it doesn&#8217;t look like Internet Explorer is going to support any type of 3d in the near future.<br/><br/><a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2ktY3JlYXRlLm9yZy9KYXZhU2NyaXB0L21lbW9yaWFsUGFyay8=" target=\"_blank\" title=\"Simple Panoramic with Three.js!\">Simple 3D Panoramic in JavaScript no IE Support!:<br/><img src="http://i-create.org/JavaScript/memorialPark/memorialpark.jpg" alt="Three.js Panoramic"/></a><br/><a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2ktY3JlYXRlLm9yZy9KYXZhU2NyaXB0L21lbW9yaWFsUGFyay9tZW1vcmlhbFBhcmsuemlw" target=\"_blank\" title=\"Download the Code\">Download Example / <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2ktY3JlYXRlLm9yZy9KYXZhU2NyaXB0L21lbW9yaWFsUGFyay8=" target=\"_blank\" title=\"Simple Panoramic with Three.js!\">Launch Demo</a><br/>So you showed me some actionscipt can you show me some javascript?  Of course, I have been playing around a little with three.js.  As you can see above I built a simple panoramic sphere with javascript Mr. Doob created a really cool 3-D library that has lots of similar characteristics too PaperVision3D and it has some basic primitives so it makes it really easy to work with.  I will warn you ahead of time this example is a processor hog and it runs really, really slow, but it is some where to start.  JavaScript libraries are still a long way from where ActionScript is right now.  I have been working on a new version of my memorial panoramic with flash, only it will have 3-D sound that will be dynamically created by user interaction so stop by in about a month.<br/><br/>Simple HTML5 Example Chrome or Safari only!:<br/><a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2ktY3JlYXRlLm9yZy9KYXZhU2NyaXB0L3NjOS8=" target=\"_blank\" title=\"simple HTML5 Example with Processing and jQuery\"><img src="http://i-create.org/JavaScript/sc9/simpleHTML5.jpg" alt="Three.js Panoramic"/></a><br/><a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2ktY3JlYXRlLm9yZy9KYXZhU2NyaXB0L3NjOS9zYzkuemlw" title=\"Download the Code\">Download Example</a> / <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2ktY3JlYXRlLm9yZy9KYXZhU2NyaXB0L3NjOS8=" target=\"_blank\" title=\"simple HTML5 Example with Processing and jQuery\">Launch Demo</a><br/><br/>It will be interesting to see if the new devies start to have more hardware acceleration for the canvas.  It&#8217;s funny for as much as apple touts HTML5 it really runs slow on the iPhone and iPod and you can&#8217;t get a good read out on the emulator in that comes with the apple sdk so it is a let down.  Example, I was working on video game that runs at about 40-45 frames per second on the laptop emulator but when I actually place it on the iPhone it drops down to about 4 frames per second just enough to be useless.  So I hope they speed up the rendering on these devices.  I believe google will help drive that competition.  Google will be coming out with competing <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5wY3dvcmxkLmNvbS9hcnRpY2xlLzIwMjM0Ny9sZXRfdGhlX3NhbXN1bmdfZ2FsYXh5X3RhYmxldF9oeXBlX2JlZ2luLmh0bWw=" title=\"google tablets\" target=\"_blank\">tablets</a>, phones, and <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5nb29nbGUuY29tL3R2Lw==" title=\"Google TV\" target=\"_blank\">TV set top boxes</a>. <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2dpZ2FvbS5jb20vMjAxMC8wNS8xMi9mcm95by1zcGVlZC1hbmRyb2lkLw==" title=\"froyo\" target=\"_blank\">Froyo will be on all these devices and it is a significant speed boost</a> not too mention it supports flash!  I am really interested though in the future of webGL with flash on devices because, I know this combination will enable developers to create some really cool experiences and games for mobile devices.  JavaScript also lacks a true sound api.  With flash not only can I play sounds mp3 etc.. I can also create sound from scratch and manipulate that sound just one of the many advantages of the Flash Platform.<br/><br/>Cool Flash Libraries:<br/><a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2h5cGVmcmFtZXdvcmsub3Jn" title=\"HypeFramework\" target=\"_blank\">HypeFramework</a><br/><a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5zb25vcG9ydC5jb20v" title=\"sonoport\" target=\"_blank\">Sonoport</a><br/> <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5iaXQtMTAxLmNvbS9ibG9nLz9wPTI2NjA=" title=\"Bit-101 sound synthesis has an excllent article series on sound synthesis\" target=\"_blank\">Bit-101 sound synthesis</a><br/>Cool JavaScript Libraries:<br/><a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5waG9uZWdhcC5jb20v" title=\"phonegap\" target=\"_blank\">PhoneGap</a><br/> <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2JyaWFubGVyb3V4LmdpdGh1Yi5jb20vbGF3bmNoYWlyLw==" title=\"LawnChair JS\" target=\"_blank\">Lawnchair</a><br/> <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3Byb2Nlc3Npbmdqcy5vcmcv" title=\"processingJS\" target=\"_blank\">Processing</a><br/> <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2dpdGh1Yi5jb20vbXJkb29iL3RocmVlLmpzLw==" title=\"three JS\" target=\"_blank\">three</a></p>
 <img src="http://i-create.org/wp-content/plugins/feed-statistics.php?view=1&post_id=826" width="1" height="1" style="display: none;" /><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fi-create.org%2F2010%2F08%2F03%2Fvirtual-painting-with-hype%2F&amp;linkname=Virtual%20Painting%20with%20Hype"><img src="http://i-create.org/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://i-create.org/2010/08/03/virtual-painting-with-hype/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HTML5 jQuery jqPanoramic Plugin Alpha</title>
		<link>http://i-create.org/2010/06/01/html5-jquery-jqpanoramic-plugin-alpha/</link>
		<comments>http://i-create.org/2010/06/01/html5-jquery-jqpanoramic-plugin-alpha/#comments</comments>
		<pubDate>Tue, 01 Jun 2010 05:24:09 +0000</pubDate>
		<dc:creator>Brendon Smith</dc:creator>
				<category><![CDATA[3d]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[i-create]]></category>
		<category><![CDATA[Experiment]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Panoramic]]></category>
		<category><![CDATA[plugin]]></category>

		<guid isPermaLink="false">http://i-create.org/2010/06/01/html5-jquery-jqpanoramic-plugin-alpha/</guid>
		<description><![CDATA[A simple jQuery plugin that allows for creation of Cubic Panoramic Images. This plugin utilizes on CSS3 3D transfoms to complete this task it also relies on jQuery UI. This plugin is an alpha and currently only works for Safari Nightly builds it has been tested against on an Apple running the latest webkit nightly [...]]]></description>
			<content:encoded><![CDATA[<p>A simple jQuery plugin that allows for creation of Cubic Panoramic Images.  This plugin utilizes on <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3dlYmtpdC5vcmcvYmxvZy8zODYvM2QtdHJhbnNmb3Jtcy8=" target=\"_blank\" title=\"3D in CSS on Webkit\" >CSS3 3D transfoms</a> to complete this task it also relies on jQuery UI.  This plugin is an alpha and currently only works for <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL25pZ2h0bHkud2Via2l0Lm9yZy8=" target=\"_blank\" title=\"Get a Nightly Build\" >Safari Nightly builds</a> it has been tested against on an Apple running the latest webkit nightly build on Snow Leopard.  This plugin should also be compatible for the iPad although I have not had time to test it yet.  I will be adding more features to this plugin on a semi weekly basis.  I am an extremely busy person and if you email me for support it might take me awhile to respond.  Cubic panoramics have long been available in Flash and Java.  The reason for creating this was simply to test out the new CSS3 3D properties and hopefully to make a great plugin that will work well on the iPad so users can view panoramics easily on their mobile devices.</p>
<p><a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2ktY3JlYXRlLm9yZy9KYXZhU2NyaXB0L2pxUGFub3JhbWljLw==" title=\"jqPanoramic HTML5 Cubic Panoramic Plugin for jQuery\" target=\"_blank\">This plugin requires a WebKit Nightly Build<br />
<img src="http://i-create.org/JavaScript/jqPanoramic/sc9Panoramic.png"></a></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">jqPanoramic jQuery plugin usage example <span style="color: #339933;">-&gt;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'body'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">jqPanoramic</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
dHeight<span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;640&quot;</span><span style="color: #339933;">,</span>
dWidth<span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;1600&quot;</span><span style="color: #339933;">,</span>
cubeSide1<span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;http://i-create.org/JavaScript/jqPanoramic/cubicSide1.jpg&quot;</span><span style="color: #339933;">,</span>
cubeSide2<span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;http://i-create.org/JavaScript/jqPanoramic/cubicSide2.jpg&quot;</span><span style="color: #339933;">,</span>
cubeSide3<span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;http://i-create.org/JavaScript/jqPanoramic/cubicSide3.jpg&quot;</span><span style="color: #339933;">,</span>
cubeSide4<span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;http://i-create.org/JavaScript/jqPanoramic/cubicSide4.jpg&quot;</span><span style="color: #339933;">,</span>
cubeTop<span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;http://i-create.org/JavaScript/jqPanoramic/top.jpg&quot;</span><span style="color: #339933;">,</span>
cubeBottom<span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;http://i-create.org/JavaScript/jqPanoramic/bottom.jpg&quot;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">//or for the default example just</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'body'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">jqPanoramic</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p><a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2ktY3JlYXRlLm9yZy9KYXZhU2NyaXB0L2pxUGFub3JhbWljL2pxUGFub3JhbWljLnppcA==" title=\"jqPanoramic HTML5 Cubic Panoramic Plugin for jQuery\">Download Plugin</a> / <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2ktY3JlYXRlLm9yZy9KYXZhU2NyaXB0L2pxUGFub3JhbWljLw==" title=\"jqPanoramic HTML5 Cubic Panoramic Plugin for jQuery Example\" target=\"_blank\">Launch Plugin Example</a></p>
 <img src="http://i-create.org/wp-content/plugins/feed-statistics.php?view=1&post_id=822" width="1" height="1" style="display: none;" /><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fi-create.org%2F2010%2F06%2F01%2Fhtml5-jquery-jqpanoramic-plugin-alpha%2F&amp;linkname=HTML5%20jQuery%20jqPanoramic%20Plugin%20Alpha"><img src="http://i-create.org/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://i-create.org/2010/06/01/html5-jquery-jqpanoramic-plugin-alpha/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>WebGL Rendering of BSP Maps</title>
		<link>http://i-create.org/2010/05/14/webgl-renering-of-bsp-maps/</link>
		<comments>http://i-create.org/2010/05/14/webgl-renering-of-bsp-maps/#comments</comments>
		<pubDate>Fri, 14 May 2010 23:42:21 +0000</pubDate>
		<dc:creator>Brendon Smith</dc:creator>
				<category><![CDATA[3d]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[i-create]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Quake]]></category>
		<category><![CDATA[webGL]]></category>

		<guid isPermaLink="false">http://i-create.org/2010/05/14/webgl-renering-of-bsp-maps/</guid>
		<description><![CDATA[It has never been a better time to be a developer. I am really looking forward to full implementations of HTML5 everywhere I believe HTML5 / JavaScript / ActionScript will be an extremly potent combination! I believe their will be proliferation of new devices in the mobile arena. JavaScript and HTML are also becoming more [...]]]></description>
			<content:encoded><![CDATA[<p>It has never been a better time to be a developer.  I am really looking forward to full implementations of HTML5 everywhere I believe  HTML5 / JavaScript / ActionScript will be an extremly potent combination!  I believe their will be proliferation of new devices in the mobile arena.  JavaScript and HTML are also becoming more powerful.  I have been reading about WebGL and experimenting with it for awhile now and the other day I heard about <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5hbWJpZXJhLmNvbS9jb3BwZXJjdWJlL2luZGV4Lmh0bWw=" title=\"CopperCube by Ambiera\" target=\"_blank\">CopperCube by Ambiera</a> based off of the <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2lycmxpY2h0LnNvdXJjZWZvcmdlLm5ldC8=" title=\"Irrlicht Engine\" target=\"_blank\">Irrlicht Engine</a> and I was immediately curious.  It is basically a world editor / game engine for the web that supports Flash and WebGL output.  I have to be honest I think for Flash, I will definitely stick with Away3D.  For WebGL output I am extremely impressed It was easy to use and in the next few months, I will be studying their web <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5hbWJpZXJhLmNvbS9jb3BwZXJsaWNodC9pbmRleC5odG1s" title=\"Copperlicht WebGL\" target=\"_blank\">javascript api copperlicht</a>.  Here are a couple examples of scenes I was easily able to export out with CopperCube.  This stuff can also of course be done with Flash.  You can run Quake in flash using Alchemy.  Alchemy is an extremly innovative software project if you are not familiar with it by now I suggest looking at it.  I have found Bruce Jawn&#8217;s <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2JydWNlLWxhYi5ibG9nc3BvdC5jb20vc2VhcmNoL2xhYmVsL0FsY2hlbXk=" title=\"Bruce Jawn Alchemy\" target=\"_blank\">website</a> to be insightful not only on <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2xhYnMuYWRvYmUuY29tL3RlY2hub2xvZ2llcy9hbGNoZW15Lw==" title=\"What is Alchemy?\" target=\"_blank\">Alchemy</a> but also in regards to <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2JydWNlLWxhYi5ibG9nc3BvdC5jb20vc2VhcmNoL2xhYmVsL3JheS1jYXN0aW5n" title=\"Raycasting in Flash\" target=\"_blank\">Raytracing</a> with flash.</p>
<p>You will only be able to see the example below if you have a webGL compatiable browser.  <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5jM2RsLm9yZy9pbmRleC5waHAvdHV0b3JpYWxzL3R1dG9yaWFsLTEtYnJvd3NlcnMv" title=\"WebGL browser how to\" target=\"_blank\">Here are instructions on how to get a webGL browser.</a></p>
<p><a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2ktY3JlYXRlLm9yZy9KYXZhU2NyaXB0L3F1YWtlLw==" target=\"_blank\" title=\"WebGL Quake Map\">Click Here to View<br />
<img src="http://i-create.org/JavaScript/quake/quakeMap1.jpg" title="Quake Map in JavaScript" /><br />
</a></p>
<p>To create the environment that are displayed above it was easy. I was able to download Quake3 maps from a few sites like <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2x2bHdvcmxkLmNvbS8=" title=\"lvlworld BSP Maps\" target=\"_blank\">lvlworld</a> or <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5tYXAtZmFjdG9yeS5vcmcvcXVha2UtMy8=" title=\"Map-Factory BSP Maps\" target=\"_blank\">Map Factory</a>.  Once the maps have been downloaded and unzipped notice that it has a .pk3 extension change it to a zip file and then extract it.  You will find all you need in that folder from their all you have to do to get it into CopperCube is navigate to the folder named Map and select the .bsp file and from that point on you are good to go.  I have also been attempting to convert these files to <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL25lbWVzaXMudGhld2F2ZWxlbmd0aC5uZXQvaW5kZXgucGhwP3A9NDY=" title=\"Convert .BSP files to .OBJ\" target=\"_blank\">OBJ</a> and then bring them into <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5jbG9zaWVyLm5sL3ByZWZhYi8=" title=\"PreFab\" target=\"_blank\">PreFab</a>.  I will keep you all posted on the updates as I progress.</p>
<p><a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2ktY3JlYXRlLm9yZy9KYXZhU2NyaXB0L3F1YWtlL1EyLw==" title=\"WebGl Quake Map\" target=\"_blank\">Click Here to View<br />
<img src="http://i-create.org/JavaScript/quake/quakeMap2.jpg" title="Quake Map in JavaScript" /><br />
</a></p>
<p>WebGL Libraries:<br />
<a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2MzZGwub3Jn" title=\"C3DL -> Canvas #D Library&#8221; target=&#8221;_blank&#8221;>C3DL</a><br />
<a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5hbWJpZXJhLmNvbS9jb3BwZXJsaWNodC9pbmRleC5odG1s" title=\"Copperlicht WebGL\" target=\"_blank\">Copperlicht</a><br />
<a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5jdWJpY3ZyLm9yZy8=" title=\"CubicVR\" target=\"_blank\">CubicVR</a><br />
<a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2VuZXJnaXplLmNjLw==" title=\"Energize\" target=\"_blank\">Energize</a><br />
<a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5nbGdlLm9yZy8=" title=\"GLGE\" target=\"_blank\">GLGE</a></p>
<p>WebGL / HTML5 Links:<br />
<a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2xlYXJuaW5nd2ViZ2wuY29tL2Jsb2cv" title=\"Learning WebGL\" target=\"_blank\">Learning WebGL</a><br />
<a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5zYXRpbmUub3JnL2FyY2hpdmVzLzIwMDkvMDcvMTEvc25vdy1zdGFjay1pcy1oZXJlLw==" title=\"HTML5 3D Gallery\" target=\"_blank\">HTML5 3D Gallery</a><br />
<a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3RoZWJhY2tidXR0b24uY29tL3Bvc3Rfb2xkYmxvZ3Bvc3RfODY=" title=\"HTML5 Planes and Cubes\" target=\"_blank\">HTML5 Planes and Cubes</a><br />
<a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3BhdWxiYWthdXMuY29tLzIwMDgvMDUvMzEvY292ZXJmbG93LWFueW9uZS8=" title=\"Coverflow in JavaScript\" target=\"_blank\">JavaScript Coverflow</a><br />
<a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL25ldC50dXRzcGx1cy5jb20vdGFnL3ByZW1pdW0v" title=\"Nettuts Premium Tutorial on CSS3 Cubes\" target=\"_blank\">CSS3 Cube NetTuts Premium Tutorial</a></p>
 <img src="http://i-create.org/wp-content/plugins/feed-statistics.php?view=1&post_id=816" width="1" height="1" style="display: none;" /><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fi-create.org%2F2010%2F05%2F14%2Fwebgl-renering-of-bsp-maps%2F&amp;linkname=WebGL%20Rendering%20of%20BSP%20Maps"><img src="http://i-create.org/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://i-create.org/2010/05/14/webgl-renering-of-bsp-maps/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WebGL TweetTank Built with C3DL Part 2</title>
		<link>http://i-create.org/2010/04/26/webgl-tweettank-built-with-c3dl-part-2/</link>
		<comments>http://i-create.org/2010/04/26/webgl-tweettank-built-with-c3dl-part-2/#comments</comments>
		<pubDate>Tue, 27 Apr 2010 04:27:42 +0000</pubDate>
		<dc:creator>Brendon Smith</dc:creator>
				<category><![CDATA[3d]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[MashUp]]></category>
		<category><![CDATA[i-create]]></category>
		<category><![CDATA[C3DL]]></category>
		<category><![CDATA[Experiment]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[webGL]]></category>

		<guid isPermaLink="false">http://i-create.org/2010/04/26/webgl-tweettank-built-with-c3dl-part-2/</guid>
		<description><![CDATA[I have added the ability to search twitter and re-populate the fish tank. So now you can place a search in like &#8220;Tool&#8221; or &#8220;Toledo&#8221; or whatever you query it will pull results from twitter. I have noticed this experiment is resource intensive. In part three of this experiment I will look for ways to [...]]]></description>
			<content:encoded><![CDATA[<p>I have added the ability to search twitter and re-populate the fish tank.  So now you can place a search in like &#8220;Tool&#8221; or &#8220;Toledo&#8221; or whatever you query it will pull results from twitter.  I have noticed this experiment is resource intensive.  In part three of this experiment I will look for ways to tidy up the code make it more reusable and less resource intensive.  I also noticed in <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5jM2RsLm9yZy8=" title=\"C3Dl\" target=\"_blank\">c3dl</a> they already have a nice <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5jM2RsLm9yZy93cC1jb250ZW50L2RvY3VtZW50YXRpb24vMi4wX3VzZXJfZG9jcy9zeW1ib2xzL2MzZGwuaHRtbCMuZ2V0UmFuZG9t" title=\"Random Function\" target=\"_blank\">random number</a> function built in I will have to try and use that in the future.  I am also curious to see if I can&#8217;t use this library to augment the <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3Byb2Nlc3Npbmdqcy5vcmcv" title=\"ProcessingJS\" target=\"_blank\">Processing.JS</a> library I noticed the same group at <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3Byb2Nlc3Npbmdqcy5vcmcvYmxvZy8/Y2F0PTE=" title=\"Students at Seneca Working on ProcessingJS\" target=\"_blank\">Secena</a> is also working on this library I believe they have ported most of the new functions.  I also added two sliders with jQuery to control the camera I am currently using an orbitCamera I think I will change this in the future to utilize a free camera and use the animateAxis function to animate around a vector with an angle.  Currently I am using the Yaw and Pitch functions of the orbitCamera of course it looks kind of awkward to spin it.  I will try to find ways to speed this experiment up, fix the picking result to be more sensitive, clean up the look and feel of it for part three.   If there is a part four it will be about making the fish bound to the sphere and maybe making them so the swim back and forth not in a straight line.</p>
<p>I might also be making a similar experiment with <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2F3YXkzZC5jb20vYXdheTNkLWxpdGUtdjEtMC1mYXN0ZXN0LWFuZC1zbWFsbGVzdC0zZC1lbmdpbmUtaW4tZmxhc2g=" title=\"Away3D Lite\" target=\"_blank\">away3Dlite</a> and the hype framework with flash this weekend.  This has been a fun experiment to play around with.  Maybe Adobe should allocate some of their resources to compiling to javascript and using the webGL and DirectX for IE with the canvas tag (Even though It isn&#8217;t as fast as flash and doensn&#8217;t display the same across browsers).  Haxe I believe currently does this to some extent I am not sure how fast the results are but seems to me their are <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5jaHJvbWVleHBlcmltZW50cy5jb20vZGV0YWlsLzNkLWphdmFzY3JpcHQtd2l0aC1zYW5keS1oeC8=" title=\"sandy3D with haXe on Chrome Experiments\" target=\"_blank\">Sandy3D experiments on Google Experiments</a>.</p>
<p><a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2ktY3JlYXRlLm9yZy9KYXZhU2NyaXB0L3R3aXR0ZXJTZWEvVHdlZXRUYW5rLmh0bWw=" title=\"TweetTank WebGL example Created with C3DL\" target=\"_blank\"><img src="http://i-create.org/JavaScript/twitterSea/tweetTank.jpg" alt="TweetTank WebGL example Created with C3DL" /></a></p>
<p>Here is the code for the experiment:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> CANVAS_WIDTH <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span>window<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">width</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> CANVAS_HEIGHT <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span>window<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">height</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">*</span><span style="color: #CC0000;">2</span><span style="color: #339933;">;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#tweetTank'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">width</span><span style="color: #009900;">&#40;</span>CANVAS_WIDTH<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#tweetTank'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">height</span><span style="color: #009900;">&#40;</span>CANVAS_HEIGHT<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#tweetTank'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'display'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'block'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #003366; font-weight: bold;">var</span> arrayTwit<span style="color: #339933;">;</span>
        <span style="color: #003366; font-weight: bold;">var</span> schooloffish<span style="color: #339933;">;</span>
        <span style="color: #003366; font-weight: bold;">var</span> fishArray <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
        <span style="color: #003366; font-weight: bold;">var</span> bubblesArray <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
        <span style="color: #003366; font-weight: bold;">var</span> bubbles<span style="color: #339933;">;</span>
		<span style="color: #003366; font-weight: bold;">var</span> objectsHit <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;&quot;</span><span style="color: #339933;">;</span>
		<span style="color: #003366; font-weight: bold;">var</span> objectSelected<span style="color: #339933;">;</span>
		<span style="color: #003366; font-weight: bold;">var</span> cam<span style="color: #339933;">;</span>
		<span style="color: #003366; font-weight: bold;">var</span> searchInt <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>
        <span style="color: #003366; font-weight: bold;">function</span> mRandom<span style="color: #009900;">&#40;</span>r<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #003366; font-weight: bold;">var</span> randomInt <span style="color: #339933;">=</span> Math.<span style="color: #660066;">floor</span><span style="color: #009900;">&#40;</span>Math.<span style="color: #660066;">random</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">*</span> r <span style="color: #339933;">+</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #000066; font-weight: bold;">return</span> randomInt<span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        c3dl.<span style="color: #660066;">addModel</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;fish.dae&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        c3dl.<span style="color: #660066;">addModel</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;OceanSphere.dae&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
        <span style="color: #006600; font-style: italic;">// The program main</span>
        <span style="color: #003366; font-weight: bold;">function</span> canvasMain<span style="color: #009900;">&#40;</span>canvasName<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
            <span style="color: #006600; font-style: italic;">// Create new c3dl.Scene object</span>
            scn <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> c3dl.<span style="color: #660066;">Scene</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            scn.<span style="color: #660066;">setCanvasTag</span><span style="color: #009900;">&#40;</span>canvasName<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #006600; font-style: italic;">// Create GL context</span>
            renderer <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> c3dl.<span style="color: #660066;">WebGL</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            renderer.<span style="color: #660066;">addTexture</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;bubble.jpg&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            renderer.<span style="color: #660066;">createRenderer</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #006600; font-style: italic;">// Attach renderer to the scene</span>
            scn.<span style="color: #660066;">setRenderer</span><span style="color: #009900;">&#40;</span>renderer<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            scn.<span style="color: #660066;">init</span><span style="color: #009900;">&#40;</span>canvasName<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #006600; font-style: italic;">//the isReady() function tests whether or not a renderer</span>
            <span style="color: #006600; font-style: italic;">//is attached to a scene.  If the renderer failed to</span>
            <span style="color: #006600; font-style: italic;">//initialize this will return false but only after you</span>
            <span style="color: #006600; font-style: italic;">//try to attach it to a scene.</span>
            <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>renderer.<span style="color: #660066;">isReady</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #006600; font-style: italic;">// Create a Collado object that</span>
                <span style="color: #006600; font-style: italic;">// will contain a imported</span>
                <span style="color: #006600; font-style: italic;">// model of something to put</span>
                <span style="color: #006600; font-style: italic;">// in the scene.</span>
                <span style="color: #003366; font-weight: bold;">var</span> schooloffish <span style="color: #339933;">=</span> mRandom<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">100</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #003366; font-weight: bold;">var</span> ocean <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> c3dl.<span style="color: #660066;">Collada</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                ocean.<span style="color: #660066;">init</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;OceanSphere.dae&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                ocean.<span style="color: #660066;">setAngularVel</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">new</span> Array<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">,</span> .00005<span style="color: #339933;">,</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                ocean.<span style="color: #660066;">scale</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">20.0</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">20.0</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">20.0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                ocean.<span style="color: #660066;">setPickable</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                scn.<span style="color: #660066;">addObjectToScene</span><span style="color: #009900;">&#40;</span>ocean<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
				<span style="color: #006600; font-style: italic;">//console.log(arrayTwit.length);</span>
                <span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> arrayTwit.<span style="color: #660066;">length</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
					<span style="color: #006600; font-style: italic;">//console.log(arrayTwit[i]);</span>
                    fishArray<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> c3dl.<span style="color: #660066;">Collada</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    fishArray<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">init</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;fish.dae&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    fishArray<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">yaw</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">45.0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					fishArray<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">ID</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;Fish&quot;</span> <span style="color: #339933;">+</span> i<span style="color: #339933;">;</span>
                    <span style="color: #006600; font-style: italic;">//fish.roll(25.0);</span>
                    fishArray<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">pitch</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">-</span><span style="color: #CC0000;">86.4</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					fishArray<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">setLinearVel</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">,</span><span style="color: #CC0000;">0</span><span style="color: #339933;">,-</span><span style="color: #CC0000;">2</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    fishArray<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">url</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;http://twitter.com/&quot;</span> <span style="color: #339933;">+</span> arrayTwit<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">from_user</span><span style="color: #339933;">;</span>
                    <span style="color: #006600; font-style: italic;">//fish.setPosition([1200, 100, 700]);</span>
                    fishArray<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">setPosition</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#91;</span>mRandom<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">1200</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> mRandom<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">900</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> mRandom<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">1500</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    scn.<span style="color: #660066;">addObjectToScene</span><span style="color: #009900;">&#40;</span>fishArray<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #009900;">&#125;</span>
                <span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> <span style="color: #CC0000;">7</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                    bubblesArray<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> c3dl.<span style="color: #660066;">ParticleSystem</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    bubblesArray<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">setMinVelocity</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#91;</span><span style="color: #339933;">-</span><span style="color: #CC0000;">2</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">2</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    bubblesArray<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">setMaxVelocity</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">2</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">25</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">2</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    bubblesArray<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">setMinLifetime</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">5.3</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    bubblesArray<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">setMaxLifetime</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">10.7</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    bubblesArray<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">setMinColor</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">0.3</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    bubblesArray<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">setMaxColor</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">0.3</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">0.5</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    bubblesArray<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">setSrcBlend</span><span style="color: #009900;">&#40;</span>c3dl.<span style="color: #660066;">ONE</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    bubblesArray<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">setDstBlend</span><span style="color: #009900;">&#40;</span>c3dl.<span style="color: #660066;">ONE</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    bubblesArray<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">setMinSize</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">0.5</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    bubblesArray<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">setMaxSize</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">5.0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    bubblesArray<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">setTexture</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;bubble.gif&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    bubblesArray<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">setAcceleration</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">9</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    bubblesArray<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">setEmitRate</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">40</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    bubblesArray<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">init</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">150</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    bubblesArray<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">setPosition</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#91;</span>mRandom<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">1200</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> mRandom<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">100</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> mRandom<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">700</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    scn.<span style="color: #660066;">addObjectToScene</span><span style="color: #009900;">&#40;</span>bubblesArray<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #009900;">&#125;</span>
                <span style="color: #006600; font-style: italic;">// Create a camera</span>
                <span style="color: #006600; font-style: italic;">//var cam = new c3dl.FreeCamera();</span>
&nbsp;
&nbsp;
&nbsp;
               <span style="color: #006600; font-style: italic;">// scn.setCamera(cam);</span>
                cam <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> c3dl.<span style="color: #660066;">OrbitCamera</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                cam.<span style="color: #660066;">setFarthestDistance</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">2000</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #006600; font-style: italic;">//cam.pitch(90);</span>
                cam.<span style="color: #660066;">setPosition</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">new</span> Array<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">3000.0</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">300.0</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">200.0</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #006600; font-style: italic;">//cam.setLookAtPoint(new Array(0.0, 0.0, 0.0));</span>
                cam.<span style="color: #660066;">setOrbitPoint</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">new</span> Array<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">800.0</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">100.0</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">200.0</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                cam.<span style="color: #660066;">setClosestDistance</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">200</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                cam.<span style="color: #660066;">setDistance</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">900</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #006600; font-style: italic;">//cam.pitch(1);</span>
                scn.<span style="color: #660066;">setCamera</span><span style="color: #009900;">&#40;</span>cam<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #006600; font-style: italic;">// Start the scene</span>
                scn.<span style="color: #660066;">startScene</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                scn.<span style="color: #660066;">setPickingCallback</span><span style="color: #009900;">&#40;</span>goLink<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #006600; font-style: italic;">//scn.setKeyboardCallback(onKeyUp, onKeyDown);</span>
                scn.<span style="color: #660066;">setMouseCallback</span><span style="color: #009900;">&#40;</span>mouseWheel<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #003366; font-weight: bold;">function</span> goLink<span style="color: #009900;">&#40;</span>pickingObj<span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
 			<span style="color: #003366; font-weight: bold;">var</span> objectsHit <span style="color: #339933;">=</span> pickingObj.<span style="color: #660066;">getObjects</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
 			<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span> objectsHit.<span style="color: #660066;">length</span> <span style="color: #339933;">&gt;</span> <span style="color: #CC0000;">0</span> <span style="color: #009900;">&#41;</span>
			 <span style="color: #009900;">&#123;</span>
 				<span style="color: #003366; font-weight: bold;">var</span> sepiaEffect <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> c3dl.<span style="color: #660066;">Effect</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				sepiaEffect.<span style="color: #660066;">init</span><span style="color: #009900;">&#40;</span>c3dl.<span style="color: #660066;">effects</span>.<span style="color: #660066;">SEPIA</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 				window.<span style="color: #000066;">open</span><span style="color: #009900;">&#40;</span>objectsHit<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span>.<span style="color: #660066;">url</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'_blank'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				objectsHit<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span>.<span style="color: #660066;">setEffect</span><span style="color: #009900;">&#40;</span>sepiaEffect<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 					<span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> arrayTwit.<span style="color: #660066;">length</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
 						<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>objectsHit<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span>.<span style="color: #660066;">url</span> <span style="color: #339933;">==</span> scn.<span style="color: #660066;">getObj</span><span style="color: #009900;">&#40;</span>i<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">url</span><span style="color: #009900;">&#41;</span>
 					scn.<span style="color: #660066;">getObject</span><span style="color: #009900;">&#40;</span>i<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">setEffect</span><span style="color: #009900;">&#40;</span>sepiaEffect<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 					<span style="color: #009900;">&#125;</span>
 				<span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #003366; font-weight: bold;">function</span> mouseWheel<span style="color: #009900;">&#40;</span>event<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #003366; font-weight: bold;">var</span> delta <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>
			<span style="color: #003366; font-weight: bold;">const</span> ZOOM_SENSITIVITY <span style="color: #339933;">=</span> <span style="color: #CC0000;">3</span><span style="color: #339933;">;</span>
            <span style="color: #006600; font-style: italic;">// Chromium</span>
            <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>event.<span style="color: #660066;">wheelDelta</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                delta <span style="color: #339933;">=</span> <span style="color: #339933;">-</span>event.<span style="color: #660066;">wheelDelta</span> <span style="color: #339933;">/</span> <span style="color: #CC0000;">20</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
            <span style="color: #006600; font-style: italic;">// Minefield</span>
            <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>event.<span style="color: #660066;">detail</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                delta <span style="color: #339933;">=</span> event.<span style="color: #660066;">detail</span> <span style="color: #339933;">*</span> <span style="color: #CC0000;">4</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
&nbsp;
            <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>keyD<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                    cam.<span style="color: #660066;">yaw</span><span style="color: #009900;">&#40;</span>delta <span style="color: #339933;">*</span> ZOOM_SENSITIVITY <span style="color: #339933;">/</span> <span style="color: #CC0000;">100</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #009900;">&#125;</span>
                <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
&nbsp;
                    <span style="color: #006600; font-style: italic;">// towards user</span>
                    <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">-</span>delta <span style="color: #339933;">*</span> ZOOM_SENSITIVITY <span style="color: #339933;">&lt;</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                        cam.<span style="color: #660066;">goFarther</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">-</span><span style="color: #CC0000;">1</span> <span style="color: #339933;">*</span> <span style="color: #339933;">-</span>delta <span style="color: #339933;">*</span> ZOOM_SENSITIVITY<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    <span style="color: #009900;">&#125;</span>
&nbsp;
                    <span style="color: #006600; font-style: italic;">// towards screen</span>
                    <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
                        cam.<span style="color: #660066;">goCloser</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">-</span>delta <span style="color: #339933;">*</span> ZOOM_SENSITIVITY<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    <span style="color: #009900;">&#125;</span>
                <span style="color: #009900;">&#125;</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> twitterSearch<span style="color: #009900;">&#40;</span>searchTag<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #006600; font-style: italic;">//console.log(searchTag);</span>
	arrayTwit <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;&quot;</span><span style="color: #339933;">;</span>
	arrayTwit <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Array<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                $.<span style="color: #660066;">getJSON</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;http://search.twitter.com/search.json?q=&quot;</span> <span style="color: #339933;">+</span> searchTag <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;&amp;callback=?&quot;</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>
            $.<span style="color: #660066;">each</span><span style="color: #009900;">&#40;</span>data.<span style="color: #660066;">results</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>i<span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">item</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                twitSeach <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">item</span><span style="color: #339933;">;</span>
                arrayTwit.<span style="color: #660066;">push</span><span style="color: #009900;">&#40;</span>twitSeach<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>
&nbsp;
			<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>searchInt <span style="color: #339933;">&gt;=</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
				searchInt<span style="color: #339933;">++;</span>
				$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#TweetTankBowl'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">html</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#TweetTankBowl'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">html</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'&lt;canvas style=&quot;display: block;&quot; id=&quot;tweetTank&quot; width=&quot;800&quot; height=&quot;800&quot;&gt;&lt;/canvas&gt;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#tweetTank'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">width</span><span style="color: #009900;">&#40;</span>CANVAS_WIDTH<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#tweetTank'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">height</span><span style="color: #009900;">&#40;</span>CANVAS_HEIGHT<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#tweetTank'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'display'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'block'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				canvasMain<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;tweetTank&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span><span style="color: #000066; font-weight: bold;">else</span><span style="color: #009900;">&#123;</span>
				searchInt<span style="color: #339933;">++;</span>	
				c3dl.<span style="color: #660066;">addMainCallBack</span><span style="color: #009900;">&#40;</span>canvasMain<span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;tweetTank&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
		 <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</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>
            twitterSearch<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;fishing&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			sliderGo<span style="color: #009900;">&#40;</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>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> goTwitter<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
<span style="color: #003366; font-weight: bold;">var</span> tweet <span style="color: #339933;">=</span>  $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#tweetSearchTxt'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
twitterSearch<span style="color: #009900;">&#40;</span>tweet<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>	
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> sliderGo<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#sliderVeritcal&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">slider</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
				step<span style="color: #339933;">:</span> <span style="color: #CC0000;">0.15</span><span style="color: #339933;">,</span>
				min<span style="color: #339933;">:</span> <span style="color: #CC0000;">0.00</span><span style="color: #339933;">,</span>
				max<span style="color: #339933;">:</span><span style="color: #CC0000;">360.00</span><span style="color: #339933;">,</span>
				orientation<span style="color: #339933;">:</span> <span style="color: #3366CC;">'vertical'</span><span style="color: #339933;">,</span>
				slide<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>event<span style="color: #339933;">,</span> ui<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>  
					cam.<span style="color: #660066;">pitch</span><span style="color: #009900;">&#40;</span>ui.<span style="color: #660066;">value</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				<span style="color: #009900;">&#125;</span>
			<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#sliderHorizontal&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">slider</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
				step<span style="color: #339933;">:</span> <span style="color: #CC0000;">0.15</span><span style="color: #339933;">,</span>
				min<span style="color: #339933;">:</span> <span style="color: #CC0000;">0.00</span><span style="color: #339933;">,</span>
				max<span style="color: #339933;">:</span><span style="color: #CC0000;">360.00</span><span style="color: #339933;">,</span>
				slide<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>event<span style="color: #339933;">,</span> ui<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>  
					cam.<span style="color: #660066;">yaw</span><span style="color: #009900;">&#40;</span>ui.<span style="color: #660066;">value</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				<span style="color: #009900;">&#125;</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><a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2ktY3JlYXRlLm9yZy9KYXZhU2NyaXB0L3R3aXR0ZXJTZWEvVHdlZXRUYW5rLmh0bWw=" title=\"TweetTank WebGL example Created with C3DL\" target=\"_blank\">Launch Experiment</a> / <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2ktY3JlYXRlLm9yZy9KYXZhU2NyaXB0L3R3aXR0ZXJTZWEuemlw" title=\"TweetTank WebGL example Created with C3DL Download\" target=\"_blank\">Download Code</a></p>
 <img src="http://i-create.org/wp-content/plugins/feed-statistics.php?view=1&post_id=809" width="1" height="1" style="display: none;" /><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fi-create.org%2F2010%2F04%2F26%2Fwebgl-tweettank-built-with-c3dl-part-2%2F&amp;linkname=WebGL%20TweetTank%20Built%20with%20C3DL%20Part%202"><img src="http://i-create.org/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://i-create.org/2010/04/26/webgl-tweettank-built-with-c3dl-part-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WebGL TweetTank Built with C3DL Part 1</title>
		<link>http://i-create.org/2010/04/18/webgl-tweettank-built-with-c3dl-part-1/</link>
		<comments>http://i-create.org/2010/04/18/webgl-tweettank-built-with-c3dl-part-1/#comments</comments>
		<pubDate>Mon, 19 Apr 2010 01:04:01 +0000</pubDate>
		<dc:creator>Brendon Smith</dc:creator>
				<category><![CDATA[3d]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[i-create]]></category>
		<category><![CDATA[C3DL]]></category>
		<category><![CDATA[Experiment]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[MashUp]]></category>
		<category><![CDATA[webGL]]></category>

		<guid isPermaLink="false">http://i-create.org/2010/04/18/webgl-tweettank-built-with-c3dl-part-1/</guid>
		<description><![CDATA[First of all let me mention you will not be able to run this demo unless your browser is WebGL ready. So that means if you want to see this then you have to download a nightly build of FireFox, Chrome, or Safari. You can read how to do this here. My first impressions of [...]]]></description>
			<content:encoded><![CDATA[<p>First of all let me mention you will not be able to run this demo unless your browser is WebGL ready.  So that means if you want to see this then you have to download a nightly build of FireFox, Chrome, or Safari.  You can read how to do this <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5jM2RsLm9yZy9pbmRleC5waHAvdHV0b3JpYWxzL3R1dG9yaWFsLTEtYnJvd3NlcnMv" title=\"Get WebGL Ready Browser!\" target=\"_blank\">here</a>. </p>
<p>My first impressions of WebGL is it is awesome and easy to do.  I believe WebGL will make it easy for any developer to rapidly create a game on the web.  It is fast appears to have decent support meaning that it works awesome on my Apple computers and on one of my Windows7 computers but then fails for me on one of my workstations that has a souped up ATI graphics card humm.. go figure.  It is hard to say how well the graphics rendering will perform on the majority of computers out their but it probably won&#8217;t be that bad and after all these are nightly builds that are pre-alpha for the most part.  It also makes me wonder if the next iPhones will have this feature built into their webkit.  Hard to say.  It is known that out of all the new browsers coming out that ie9 will not support graphics rendering shocking (Not really).  It might be because Microsoft believes that WebGL will be an epic failure or maybe they simply don&#8217;t have the resources to devote to it at this time. </p>
<p>I believe graphic card support in these new browsers will speed up canvas rendering a little but I when looking at the <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2Jsb2cuaTJmbHkuY29tLz9wPTEwODA=" title=\"Flash vs. HTML5\" target=\"_blank\">flash benchmarks</a> that are currently out their it definitely shows you how fast the flash player is in comparison.  In short canvas tag is not even remotely as fast. In the news their has been lots of discussion about flash being dead but this simply isn&#8217;t true.  Here is why forthcoming <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy53aXJlZC5jb20vZXBpY2VudGVyLzIwMTAvMDQvYXMtYXBwbGUtYmFycmljYWRlcy1mbGFzaC1oZHR2LWVtYnJhY2VzLWl0Lw==" title=\"Flash on your TV!\" target=\"_blank\">HDTV/3DTV</a> will support flash, google phones will support flash, blackberry, and windows phones will all support flash.  So as a mobile platform it will be the easiest way to build and deploy to all platforms.  It is too bad Apple doesn&#8217;t see it but oh well.  I guess I will just have to get better at Objective-C to be on that platform.</p>
<p>This is the first part of a two part example.  I created a simple mashup.  To create this example I used <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5jM2RsLm9yZw==" title=\"What is C3DL?\" target=\"_blank\">C3DL</a> and jQuery.  C3DL is an awesome opensouce library put together by the wonderful people at <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5zZW5lY2FjLm9uLmNhLw==" title=\"Seneca College\" target=\"_blank\">Seneca College</a>.  This example pulls a search results from twitter with the search query subject being fishing.  Yes, I know that twitter is all about birds and tweets but after scouring the Google 3D warehouse, I decided that most of the models for birds that are freely available suck.  So I made a virtual fish tank instead.  The tank has bubbles rendered with the C3DL particle library and it also has a school of fish that swim slowly though the tank.  It&#8217;s not really ground shaking stuff pretty simple.  I will work on a future version where it pulls results with ajax.  I noticed the C3DL library attaches an event listener in the init.js that listens for the document to be loaded <img src='http://i-create.org/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  .  This of course makes my search function of twitter fail.  I have looked at overriding this feature a number of ways not limited to jQuery getScript, etc.. I could also put the query on the query string for the window location and then re-load the page but I think that would be kind of wonky so whatever I will do this in the next version of the experiment.  So whatever I will save it for next time.</p>
<p>Check out the experiment here but before you do <strong><a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL25pZ2h0bHkubW96aWxsYS5vcmcv" title=\"MineField Firefox Nightly Build\" target=\"_blank\">download a nightly build of Firefox</a></strong>.</p>
<p><a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2ktY3JlYXRlLm9yZy9KYXZhU2NyaXB0L3R3aXR0ZXJTZWEvVHdlZXRUYW5rLmh0bWw=" title=\"TweetTank WebGL example Created with C3DL\" target=\"_blank\"><img src="http://i-create.org/JavaScript/twitterSea/tweetTank.jpg" alt="TweetTank WebGL example Created with C3DL" /></a></p>
<p>Here is the code for the experiment:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> CANVAS_WIDTH <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span>window<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">width</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> CANVAS_HEIGHT <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span>window<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">height</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">*</span><span style="color: #CC0000;">2</span><span style="color: #339933;">;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#tweetTank'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">width</span><span style="color: #009900;">&#40;</span>CANVAS_WIDTH<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#tweetTank'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">height</span><span style="color: #009900;">&#40;</span>CANVAS_HEIGHT<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#tweetTank'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'display'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'block'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #003366; font-weight: bold;">var</span> arrayTwit<span style="color: #339933;">;</span>
        <span style="color: #003366; font-weight: bold;">var</span> schooloffish<span style="color: #339933;">;</span>
        <span style="color: #003366; font-weight: bold;">var</span> fishArray <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
        <span style="color: #003366; font-weight: bold;">var</span> bubblesArray <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
        <span style="color: #003366; font-weight: bold;">var</span> bubbles<span style="color: #339933;">;</span>
		<span style="color: #003366; font-weight: bold;">var</span> objectsHit <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;&quot;</span><span style="color: #339933;">;</span>
		<span style="color: #003366; font-weight: bold;">var</span> objectSelected<span style="color: #339933;">;</span>
        <span style="color: #003366; font-weight: bold;">function</span> mRandom<span style="color: #009900;">&#40;</span>r<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #003366; font-weight: bold;">var</span> randomInt <span style="color: #339933;">=</span> Math.<span style="color: #660066;">floor</span><span style="color: #009900;">&#40;</span>Math.<span style="color: #660066;">random</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">*</span> r <span style="color: #339933;">+</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #000066; font-weight: bold;">return</span> randomInt<span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        c3dl.<span style="color: #660066;">addModel</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;fish.dae&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        c3dl.<span style="color: #660066;">addModel</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;OceanSphere.dae&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
        <span style="color: #006600; font-style: italic;">// The program main</span>
        <span style="color: #003366; font-weight: bold;">function</span> canvasMain<span style="color: #009900;">&#40;</span>canvasName<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
            <span style="color: #006600; font-style: italic;">// Create new c3dl.Scene object</span>
            scn <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> c3dl.<span style="color: #660066;">Scene</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            scn.<span style="color: #660066;">setCanvasTag</span><span style="color: #009900;">&#40;</span>canvasName<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #006600; font-style: italic;">// Create GL context</span>
            renderer <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> c3dl.<span style="color: #660066;">WebGL</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            renderer.<span style="color: #660066;">addTexture</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;bubble.jpg&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            renderer.<span style="color: #660066;">createRenderer</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #006600; font-style: italic;">// Attach renderer to the scene</span>
            scn.<span style="color: #660066;">setRenderer</span><span style="color: #009900;">&#40;</span>renderer<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            scn.<span style="color: #660066;">init</span><span style="color: #009900;">&#40;</span>canvasName<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #006600; font-style: italic;">//the isReady() function tests whether or not a renderer</span>
            <span style="color: #006600; font-style: italic;">//is attached to a scene.  If the renderer failed to</span>
            <span style="color: #006600; font-style: italic;">//initialize this will return false but only after you</span>
            <span style="color: #006600; font-style: italic;">//try to attach it to a scene.</span>
            <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>renderer.<span style="color: #660066;">isReady</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #006600; font-style: italic;">// Create a Collado object that</span>
                <span style="color: #006600; font-style: italic;">// will contain a imported</span>
                <span style="color: #006600; font-style: italic;">// model of something to put</span>
                <span style="color: #006600; font-style: italic;">// in the scene.</span>
&nbsp;
                <span style="color: #006600; font-style: italic;">//fish.setAngularVel(new Array(0.0, 0.0001, 0.0));</span>
&nbsp;
                <span style="color: #003366; font-weight: bold;">var</span> schooloffish <span style="color: #339933;">=</span> mRandom<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">100</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #003366; font-weight: bold;">var</span> ocean <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> c3dl.<span style="color: #660066;">Collada</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                ocean.<span style="color: #660066;">init</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;OceanSphere.dae&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                ocean.<span style="color: #660066;">setAngularVel</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">new</span> Array<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">,</span> .00005<span style="color: #339933;">,</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                ocean.<span style="color: #660066;">scale</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">20.0</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">20.0</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">20.0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                ocean.<span style="color: #660066;">setPickable</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                scn.<span style="color: #660066;">addObjectToScene</span><span style="color: #009900;">&#40;</span>ocean<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
				<span style="color: #006600; font-style: italic;">//console.log(arrayTwit.length);</span>
                <span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> arrayTwit.<span style="color: #660066;">length</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
					<span style="color: #006600; font-style: italic;">//console.log(arrayTwit[i]);</span>
                    fishArray<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> c3dl.<span style="color: #660066;">Collada</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    fishArray<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">init</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;fish.dae&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    fishArray<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">yaw</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">45.0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					fishArray<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">ID</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;Fish&quot;</span> <span style="color: #339933;">+</span> i<span style="color: #339933;">;</span>
                    <span style="color: #006600; font-style: italic;">//fish.roll(25.0);</span>
                    fishArray<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">pitch</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">-</span><span style="color: #CC0000;">86.4</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					fishArray<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">setLinearVel</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">,</span><span style="color: #CC0000;">0</span><span style="color: #339933;">,-</span><span style="color: #CC0000;">2</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    fishArray<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">url</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;http://twitter.com/&quot;</span> <span style="color: #339933;">+</span> arrayTwit<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">from_user</span><span style="color: #339933;">;</span>
                    <span style="color: #006600; font-style: italic;">//fish.setPosition([1200, 100, 700]);</span>
                    fishArray<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">setPosition</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#91;</span>mRandom<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">1200</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> mRandom<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">900</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> mRandom<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">1500</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    scn.<span style="color: #660066;">addObjectToScene</span><span style="color: #009900;">&#40;</span>fishArray<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #009900;">&#125;</span>
                <span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> <span style="color: #CC0000;">7</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                    bubblesArray<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> c3dl.<span style="color: #660066;">ParticleSystem</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    bubblesArray<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">setMinVelocity</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#91;</span><span style="color: #339933;">-</span><span style="color: #CC0000;">2</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">2</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    bubblesArray<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">setMaxVelocity</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">2</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">25</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">2</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    bubblesArray<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">setMinLifetime</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">5.3</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    bubblesArray<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">setMaxLifetime</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">10.7</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    bubblesArray<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">setMinColor</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">0.3</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    bubblesArray<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">setMaxColor</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">0.3</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">0.5</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    bubblesArray<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">setSrcBlend</span><span style="color: #009900;">&#40;</span>c3dl.<span style="color: #660066;">ONE</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    bubblesArray<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">setDstBlend</span><span style="color: #009900;">&#40;</span>c3dl.<span style="color: #660066;">ONE</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    bubblesArray<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">setMinSize</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">0.5</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    bubblesArray<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">setMaxSize</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">5.0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    bubblesArray<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">setTexture</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;bubble.gif&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    bubblesArray<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">setAcceleration</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">9</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    bubblesArray<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">setEmitRate</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">40</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    bubblesArray<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">init</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">150</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    bubblesArray<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">setPosition</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#91;</span>mRandom<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">1200</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> mRandom<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">100</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> mRandom<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">700</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    scn.<span style="color: #660066;">addObjectToScene</span><span style="color: #009900;">&#40;</span>bubblesArray<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #009900;">&#125;</span>
                <span style="color: #006600; font-style: italic;">// Create a camera</span>
                <span style="color: #006600; font-style: italic;">//var cam = new c3dl.FreeCamera();</span>
&nbsp;
&nbsp;
&nbsp;
               <span style="color: #006600; font-style: italic;">// scn.setCamera(cam);</span>
                cam <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> c3dl.<span style="color: #660066;">OrbitCamera</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                cam.<span style="color: #660066;">setFarthestDistance</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">2000</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #006600; font-style: italic;">//cam.pitch(90);</span>
                cam.<span style="color: #660066;">setPosition</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">new</span> Array<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">3000.0</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">300.0</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">200.0</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #006600; font-style: italic;">//cam.setLookAtPoint(new Array(0.0, 0.0, 0.0));</span>
                cam.<span style="color: #660066;">setOrbitPoint</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">new</span> Array<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">800.0</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">100.0</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">200.0</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                cam.<span style="color: #660066;">setClosestDistance</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">200</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                cam.<span style="color: #660066;">setDistance</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">900</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #006600; font-style: italic;">//cam.pitch(1);</span>
                scn.<span style="color: #660066;">setCamera</span><span style="color: #009900;">&#40;</span>cam<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #006600; font-style: italic;">// Start the scene</span>
                scn.<span style="color: #660066;">startScene</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                scn.<span style="color: #660066;">setPickingCallback</span><span style="color: #009900;">&#40;</span>goLink<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                scn.<span style="color: #660066;">setKeyboardCallback</span><span style="color: #009900;">&#40;</span>onKeyUp<span style="color: #339933;">,</span> onKeyDown<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                scn.<span style="color: #660066;">setMouseCallback</span><span style="color: #009900;">&#40;</span>mouseMove<span style="color: #339933;">,</span> mouseWheel<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #003366; font-weight: bold;">function</span> goLink<span style="color: #009900;">&#40;</span>pickingObj<span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
 			<span style="color: #003366; font-weight: bold;">var</span> objectsHit <span style="color: #339933;">=</span> pickingObj.<span style="color: #660066;">getObjects</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
 			<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span> objectsHit.<span style="color: #660066;">length</span> <span style="color: #339933;">&gt;</span> <span style="color: #CC0000;">0</span> <span style="color: #009900;">&#41;</span>
			 <span style="color: #009900;">&#123;</span>
 				<span style="color: #003366; font-weight: bold;">var</span> sepiaEffect <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> c3dl.<span style="color: #660066;">Effect</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				sepiaEffect.<span style="color: #660066;">init</span><span style="color: #009900;">&#40;</span>c3dl.<span style="color: #660066;">effects</span>.<span style="color: #660066;">SEPIA</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 				window.<span style="color: #000066;">open</span><span style="color: #009900;">&#40;</span>objectsHit<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span>.<span style="color: #660066;">url</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'_blank'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				objectsHit<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span>.<span style="color: #660066;">setEffect</span><span style="color: #009900;">&#40;</span>sepiaEffect<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 					<span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> arrayTwit.<span style="color: #660066;">length</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
 						<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>objectsHit<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span>.<span style="color: #660066;">url</span> <span style="color: #339933;">==</span> scn.<span style="color: #660066;">getObj</span><span style="color: #009900;">&#40;</span>i<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">url</span><span style="color: #009900;">&#41;</span>
 					scn.<span style="color: #660066;">getObject</span><span style="color: #009900;">&#40;</span>i<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">setEffect</span><span style="color: #009900;">&#40;</span>sepiaEffect<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 					<span style="color: #009900;">&#125;</span>
 				<span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span> 
&nbsp;
&nbsp;
        <span style="color: #003366; font-weight: bold;">function</span> onKeyUp<span style="color: #009900;">&#40;</span>event<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>event.<span style="color: #660066;">keyCode</span> <span style="color: #339933;">==</span> <span style="color: #CC0000;">89</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> keyD <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
&nbsp;
        <span style="color: #003366; font-weight: bold;">function</span> mouseWheel<span style="color: #009900;">&#40;</span>event<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #003366; font-weight: bold;">var</span> delta <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #006600; font-style: italic;">// Chromium</span>
            <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>event.<span style="color: #660066;">wheelDelta</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                delta <span style="color: #339933;">=</span> <span style="color: #339933;">-</span>event.<span style="color: #660066;">wheelDelta</span> <span style="color: #339933;">/</span> <span style="color: #CC0000;">20</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
            <span style="color: #006600; font-style: italic;">// Minefield</span>
            <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>event.<span style="color: #660066;">detail</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                delta <span style="color: #339933;">=</span> event.<span style="color: #660066;">detail</span> <span style="color: #339933;">*</span> <span style="color: #CC0000;">4</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
&nbsp;
            <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>keyD<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                    cam.<span style="color: #660066;">yaw</span><span style="color: #009900;">&#40;</span>delta <span style="color: #339933;">*</span> ZOOM_SENSITIVITY <span style="color: #339933;">/</span> <span style="color: #CC0000;">100</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #009900;">&#125;</span>
                <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
&nbsp;
                    <span style="color: #006600; font-style: italic;">// towards user</span>
                    <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">-</span>delta <span style="color: #339933;">*</span> ZOOM_SENSITIVITY <span style="color: #339933;">&lt;</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                        cam.<span style="color: #660066;">goFarther</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">-</span><span style="color: #CC0000;">1</span> <span style="color: #339933;">*</span> <span style="color: #339933;">-</span>delta <span style="color: #339933;">*</span> ZOOM_SENSITIVITY<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    <span style="color: #009900;">&#125;</span>
&nbsp;
                    <span style="color: #006600; font-style: italic;">// towards screen</span>
                    <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
                        cam.<span style="color: #660066;">goCloser</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">-</span>delta <span style="color: #339933;">*</span> ZOOM_SENSITIVITY<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    <span style="color: #009900;">&#125;</span>
                <span style="color: #009900;">&#125;</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
&nbsp;
        <span style="color: #003366; font-weight: bold;">function</span> onKeyDown<span style="color: #009900;">&#40;</span>event<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>event.<span style="color: #660066;">keyCode</span> <span style="color: #339933;">==</span> <span style="color: #CC0000;">65</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                cam.<span style="color: #660066;">setOrbitPoint</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
            <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>event.<span style="color: #660066;">keyCode</span> <span style="color: #339933;">==</span> <span style="color: #CC0000;">89</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                keyD <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #003366; font-weight: bold;">function</span> mouseMove<span style="color: #009900;">&#40;</span>event<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #006600; font-style: italic;">// get mouse coords relative to window</span>
            <span style="color: #003366; font-weight: bold;">var</span> mmx <span style="color: #339933;">=</span> event.<span style="color: #660066;">pageX</span> <span style="color: #339933;">-</span> <span style="color: #CC0000;">1</span><span style="color: #339933;">;</span>
            <span style="color: #003366; font-weight: bold;">var</span> mmy <span style="color: #339933;">=</span> event.<span style="color: #660066;">pageY</span> <span style="color: #339933;">-</span> <span style="color: #CC0000;">1</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
&nbsp;
            <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>mmx <span style="color: #339933;">!=</span> <span style="color: #003366; font-weight: bold;">null</span> <span style="color: #339933;">&amp;&amp;</span> mmy <span style="color: #339933;">!=</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #006600; font-style: italic;">// NDC</span>
                <span style="color: #003366; font-weight: bold;">var</span> normalizedDeviceCoords <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span>
        <span style="color: #009900;">&#40;</span><span style="color: #CC0000;">2</span> <span style="color: #339933;">*</span> mmx <span style="color: #339933;">/</span> CANVAS_WIDTH<span style="color: #009900;">&#41;</span> <span style="color: #339933;">-</span> <span style="color: #CC0000;">1</span><span style="color: #339933;">,</span>
       <span style="color: #339933;">-</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">2</span> <span style="color: #339933;">*</span> mmy <span style="color: #339933;">/</span> CANVAS_HEIGHT<span style="color: #009900;">&#41;</span> <span style="color: #339933;">-</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
        <span style="color: #CC0000;">1</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
                <span style="color: #006600; font-style: italic;">// Sometimes this is called before the perspective transform</span>
                <span style="color: #006600; font-style: italic;">// is setup which causes warnings. This check prevents that.</span>
                <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>c3dl.<span style="color: #660066;">isValidMatrix</span><span style="color: #009900;">&#40;</span>scn.<span style="color: #660066;">getProjectionMatrix</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                    <span style="color: #003366; font-weight: bold;">var</span> iproj <span style="color: #339933;">=</span> c3dl.<span style="color: #660066;">inverseMatrix</span><span style="color: #009900;">&#40;</span>scn.<span style="color: #660066;">getProjectionMatrix</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
                    <span style="color: #006600; font-style: italic;">// To get the clip coords, we multiply the viewspace coordinates by</span>
                    <span style="color: #006600; font-style: italic;">// the projection matrix.</span>
                    <span style="color: #006600; font-style: italic;">// Working backwards across the pipeline, we have to take the normalized</span>
                    <span style="color: #006600; font-style: italic;">// device coordinates and multiply by the inverse projection matrix to get</span>
                    <span style="color: #006600; font-style: italic;">// the clip coordinates.</span>
                    <span style="color: #003366; font-weight: bold;">var</span> clipCoords <span style="color: #339933;">=</span> c3dl.<span style="color: #660066;">multiplyMatrixByVector</span><span style="color: #009900;">&#40;</span>iproj<span style="color: #339933;">,</span> normalizedDeviceCoords<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
                    <span style="color: #006600; font-style: italic;">// perspective divide</span>
                    clipCoords<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">/=</span> clipCoords<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">3</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
                    clipCoords<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">/=</span> clipCoords<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">3</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
                    clipCoords<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">2</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">/=</span> clipCoords<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">3</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
                    clipCoords<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">2</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #339933;">-</span>clipCoords<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">2</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
                    <span style="color: #003366; font-weight: bold;">var</span> rayInitialPoint <span style="color: #339933;">=</span> cam.<span style="color: #660066;">getPosition</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
                    <span style="color: #003366; font-weight: bold;">var</span> x <span style="color: #339933;">=</span> clipCoords<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
                    <span style="color: #003366; font-weight: bold;">var</span> y <span style="color: #339933;">=</span> clipCoords<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
                    <span style="color: #003366; font-weight: bold;">var</span> z <span style="color: #339933;">=</span> clipCoords<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">2</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
                    <span style="color: #003366; font-weight: bold;">var</span> kludge <span style="color: #339933;">=</span> c3dl.<span style="color: #660066;">multiplyVector</span><span style="color: #009900;">&#40;</span>cam.<span style="color: #660066;">getLeft</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    <span style="color: #003366; font-weight: bold;">var</span> viewMatrix <span style="color: #339933;">=</span> c3dl.<span style="color: #660066;">makePoseMatrix</span><span style="color: #009900;">&#40;</span>kludge<span style="color: #339933;">,</span> cam.<span style="color: #660066;">getUp</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> cam.<span style="color: #660066;">getDir</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> cam.<span style="color: #660066;">getPosition</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
                    <span style="color: #003366; font-weight: bold;">var</span> rayTerminalPoint <span style="color: #339933;">=</span> c3dl.<span style="color: #660066;">multiplyMatrixByVector</span><span style="color: #009900;">&#40;</span>viewMatrix<span style="color: #339933;">,</span> <span style="color: #009900;">&#91;</span>x<span style="color: #339933;">,</span> y<span style="color: #339933;">,</span> z<span style="color: #339933;">,</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    <span style="color: #003366; font-weight: bold;">var</span> rayDir <span style="color: #339933;">=</span> c3dl.<span style="color: #660066;">normalizeVector</span><span style="color: #009900;">&#40;</span>rayTerminalPoint<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
                    <span style="color: #006600; font-style: italic;">// get angle</span>
                    <span style="color: #003366; font-weight: bold;">var</span> angle <span style="color: #339933;">=</span> Math.<span style="color: #660066;">acos</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">-</span><span style="color: #CC0000;">1</span> <span style="color: #339933;">*</span> rayDir<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    <span style="color: #003366; font-weight: bold;">var</span> camHeight <span style="color: #339933;">=</span> rayInitialPoint<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
                    <span style="color: #003366; font-weight: bold;">var</span> hyp <span style="color: #339933;">=</span> camHeight <span style="color: #339933;">/</span> Math.<span style="color: #660066;">cos</span><span style="color: #009900;">&#40;</span>angle<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
                    mx <span style="color: #339933;">=</span> hyp <span style="color: #339933;">*</span> rayDir<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">+</span> rayInitialPoint<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
                    my <span style="color: #339933;">=</span> hyp <span style="color: #339933;">*</span> rayDir<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
                    mz <span style="color: #339933;">=</span> hyp <span style="color: #339933;">*</span> rayDir<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">2</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">+</span> rayInitialPoint<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">2</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
                <span style="color: #009900;">&#125;</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
<span style="color: #003366; font-weight: bold;">function</span> twitterSearch<span style="color: #009900;">&#40;</span>searchTag<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #006600; font-style: italic;">//console.log(searchTag);</span>
	arrayTwit <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;&quot;</span><span style="color: #339933;">;</span>
	arrayTwit <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Array<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                $.<span style="color: #660066;">getJSON</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;http://search.twitter.com/search.json?q=&quot;</span> <span style="color: #339933;">+</span> searchTag <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;&amp;callback=?&quot;</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>
            $.<span style="color: #660066;">each</span><span style="color: #009900;">&#40;</span>data.<span style="color: #660066;">results</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>i<span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">item</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                twitSeach <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">item</span><span style="color: #339933;">;</span>
                arrayTwit.<span style="color: #660066;">push</span><span style="color: #009900;">&#40;</span>twitSeach<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;">//c3dl.init();</span>
			c3dl.<span style="color: #660066;">addMainCallBack</span><span style="color: #009900;">&#40;</span>canvasMain<span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;tweetTank&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>
&nbsp;
        <span style="color: #009900;">&#125;</span>
$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</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>
            twitterSearch<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;fishing&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></pre></div></div>

<p><a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2ktY3JlYXRlLm9yZy9KYXZhU2NyaXB0L3R3aXR0ZXJTZWEvVHdlZXRUYW5rLmh0bWw=" title=\"TweetTank WebGL example Created with C3DL\" target=\"_blank\">Launch Experiment</a> / <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2ktY3JlYXRlLm9yZy9KYXZhU2NyaXB0L3R3aXR0ZXJTZWEuemlw" title=\"TweetTank WebGL example Created with C3DL Download\" target=\"_blank\">Download Code</a></p>
<p>I mentioned possibly creating a spider with silverlight.  I still would like to do that in the near future. <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovLzc0LjEyNS40NS4xMzIvc2VhcmNoP3E9Y2FjaGU6TlMwdFdTdHZFRllKOnd3dy5zaWx2ZXJsaWdodHNob3cubmV0L2l0ZW1zL0J1aWxkaW5nLWFuLWludGVyYWN0aXZlLXNwaWRlci1pbi1TaWx2ZXJsaWdodC5hc3B4K3NwaWRlcit3aXRoK3NpbHZlcmxpZ2h0JmFtcDtjZD0xJmFtcDtobD1lbiZhbXA7Y3Q9Y2xuayZhbXA7Z2w9dXMmYW1wO2NsaWVudD1maXJlZm94LWE=" title=\"Silverlight Spider\" target=\"_blank\">I found this cool silverlight examples and would like to study it</a>!  I have installed Visual Studio 2010 on my Windows boxes and it is awesome!</p>
<p>I have also been eying a new tutorial on the <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5oeXBlZnJhbWV3b3JrLm9yZy9ibG9nL2NvbnRlbnQvaHlwZS1nZXRzLWEtbmV3LWRvbWFpbi8=" title=\"What is the Hype Framework?\" target=\"_blank\">Hype Framework</a> in <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5jb21wdXRlcmFydHMuY28udWsv" title=\"Computer Arts\" target=\"_blank\">ComputerArts</a> latest issue(174).  Has a really cool example that teaches you how to use Hype to make music drawings created by <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2NyZWF0aXZld2F4LmNvLnVrLw==" title=\"CreativeWax\" target=\"_blank\">Stewart Hamilton-Arrandale</a>.  I will learn from this code.  I could add this type of functionality into my KulerSplash.</p>
<p>I also found this resource recently on Objective-C really <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5mYWJpZW5zYW5nbGFyZC5uZXQv" title=\"Fabien's Cool - Code Review and Souce Code\" target=\"_blank\">cool web site it was nice of them to share so much</a> Fabien also has some cool JAVA examples as well.</p>
<p>WebGL libraries:<br />
<a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5jM2RsLm9yZw==" title=\"What is C3DL?\" target=\"_blank\">C3DL</a><br />
<a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5hbWJpZXJhLmNvbS9jb3BwZXJsaWNodC8=" title=\"CopperLicht\" target=\"_blank\">CopperLicht</a><br />
<a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5zY2VuZWpzLm9yZy8=" title=\"SceneJS\" target=\"_blank\">SceneJS</a></p>
 <img src="http://i-create.org/wp-content/plugins/feed-statistics.php?view=1&post_id=808" width="1" height="1" style="display: none;" /><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fi-create.org%2F2010%2F04%2F18%2Fwebgl-tweettank-built-with-c3dl-part-1%2F&amp;linkname=WebGL%20TweetTank%20Built%20with%20C3DL%20Part%201"><img src="http://i-create.org/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://i-create.org/2010/04/18/webgl-tweettank-built-with-c3dl-part-1/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>jQuery Abstract Lines Experiment</title>
		<link>http://i-create.org/2010/04/11/jquery-abstract-lines-experiment/</link>
		<comments>http://i-create.org/2010/04/11/jquery-abstract-lines-experiment/#comments</comments>
		<pubDate>Sun, 11 Apr 2010 19:12:06 +0000</pubDate>
		<dc:creator>Brendon Smith</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[QuickTip]]></category>
		<category><![CDATA[i-create]]></category>
		<category><![CDATA[Experiment]]></category>
		<category><![CDATA[JQuery]]></category>

		<guid isPermaLink="false">http://i-create.org/2010/04/11/jquery-abstract-lines-experiment/</guid>
		<description><![CDATA[I have put together a simple experiment that draws semi-transparent lines on an HTML page incrementally for no particular purpose.  This is something I can do with ActionScript the difference is this experiment in ActionScript would be 3 times faster and I would have greater control not only would it be faster but it would [...]]]></description>
			<content:encoded><![CDATA[<p>I have put together a simple experiment that draws semi-transparent   lines on an HTML page incrementally for no particular purpose.  This is something I can do with ActionScript the difference is this experiment  in ActionScript would be 3 times faster and I would have greater control   not only would it be faster but it would also work on every browser and render the exact same way.  I do like JavaScript but it is not   substitution for ActionScript or C#.  Someday I am quite sure it will mature and more and more libraries of code will be ported over but the expectation for things to render the same way cross browser is a long   ways away form a reality.  HTML5 is simply not a Flash or Silverlight Killer. I also know that browsers will need faster JavaScript engines more like <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2NvZGUuZ29vZ2xlLmNvbS9wL3Y4Lw==" title=\"v8 JavaScript Engine\" target=\"_blank\">Google&#8217;s Chrome V8</a> to compete with browser plugins.  I love ActionScript I find it to be a powerful fast solution   with stunning results that cannot be found on the web else where.  In the future I think I will focus most of my JavaScript experiments on jQuery using <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3Byb2Nlc3Npbmdqcy5vcmcv" title=\"processingJS\" target=\"_blank\">processingJS</a> because processing is easy to use fast and is   the weapon of choice I believe for making really cool data visualization mashups.  In this experiment I used a jQuery timer to execute drawing   of lines on the page.  It is a relatively easy experiment and didn&#8217;t take long to make and was fun to create so here you go.</p>
<p><a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2ktY3JlYXRlLm9yZy9KYXZhU2NyaXB0L2Fic3RyYWN0TGluZXMvbGluZXMuaHRtbA==" title=\"simple jQuery Abstract line experiment\" target=\"_blank\"><img src="http://i-create.org/JavaScript/abstractLines/simpleAbstractLines.jpg" alt="simple jQuery Abstract line experiment" /></a></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> bg <span style="color: #339933;">=</span> <span style="color: #3366CC;">'&lt;div class=&quot;lineBg&quot;&gt;&amp;nbsp;&lt;/div&gt;'</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> lpos <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> lint <span style="color: #339933;">=</span> <span style="color: #CC0000;">1</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> midPoint<span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> lineCount <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> mainWidth <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span>window<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">width</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
mainWidth <span style="color: #339933;">=</span> mainWidth <span style="color: #339933;">-</span> <span style="color: #CC0000;">15</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> mainHeight <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span>window<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">height</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
midPoint <span style="color: #339933;">=</span> mainHeight <span style="color: #339933;">/</span> <span style="color: #CC0000;">2</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">function</span> goLines<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#container'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span>bg<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.lineBg'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'top'</span><span style="color: #339933;">,</span> midPoint <span style="color: #339933;">-</span> <span style="color: #CC0000;">100</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.lineBg'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'left'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'0'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.lineBg'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'display'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'block'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">everyTime</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">200</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>lineCount<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	lineCount<span style="color: #339933;">++;</span>									
    randomLines<span style="color: #009900;">&#40;</span>lineCount<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">700</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #003366; font-weight: bold;">function</span> randomLines<span style="color: #009900;">&#40;</span>i<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>	
<span style="color: #003366; font-weight: bold;">var</span> l1 <span style="color: #339933;">=</span> <span style="color: #3366CC;">'&lt;div id=&quot;'</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> l2 <span style="color: #339933;">=</span> <span style="color: #3366CC;">'&quot; class=&quot;line&quot;&gt;&amp;nbsp;&lt;/div&gt;'</span><span style="color: #339933;">;</span>
	 <span style="color: #003366; font-weight: bold;">var</span> l <span style="color: #339933;">=</span> l1<span style="color: #339933;">+</span>i<span style="color: #339933;">+</span>l2<span style="color: #339933;">;</span>	
	 $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#container'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span>l<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	 $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#'</span><span style="color: #339933;">+</span>i<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'left'</span><span style="color: #339933;">,</span> getLeftPos<span style="color: #009900;">&#40;</span>i<span style="color: #339933;">,</span>mainWidth<span style="color: #009900;">&#41;</span><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>isEven<span style="color: #009900;">&#40;</span>i<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
      $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#'</span><span style="color: #339933;">+</span>i<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'top'</span><span style="color: #339933;">,</span>midPoint<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	  $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#'</span><span style="color: #339933;">+</span>i<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>rotate<span style="color: #339933;">:</span> getRotation<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> height<span style="color: #339933;">:</span> getScale<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> opacity<span style="color: #339933;">:</span> <span style="color: #3366CC;">'+=0.5'</span><span style="color: #339933;">,</span> backgroundColor<span style="color: #339933;">:</span><span style="color: #3366CC;">'#01a6fb'</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">300</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</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: #003366; font-weight: bold;">var</span> neg <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
	  $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#'</span><span style="color: #339933;">+</span>i<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'top'</span><span style="color: #339933;">,</span>midPoint <span style="color: #339933;">-</span> <span style="color: #CC0000;">100</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	  $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#'</span><span style="color: #339933;">+</span>i<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>rotate<span style="color: #339933;">:</span> getRotation<span style="color: #009900;">&#40;</span>neg<span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> height<span style="color: #339933;">:</span> getScale<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> opacity<span style="color: #339933;">:</span> <span style="color: #3366CC;">'+=0.5'</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">300</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 	 
	 <span style="color: #009900;">&#125;</span>
	  $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#'</span><span style="color: #339933;">+</span>i<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'display'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'block'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> getLeftPos<span style="color: #009900;">&#40;</span>i<span style="color: #339933;">,</span>mainWidth<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	lPos <span style="color: #339933;">=</span> i<span style="color: #339933;">;</span>
	lPos <span style="color: #339933;">*=</span> <span style="color: #CC0000;">5</span><span style="color: #339933;">;</span>
	<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>lint <span style="color: #339933;">&gt;</span> mainWidth<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		lint <span style="color: #339933;">=</span> <span style="color: #CC0000;">1</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
   <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>lPos <span style="color: #339933;">&gt;</span> mainWidth<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		lPos <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span> <span style="color: #339933;">+</span> lint<span style="color: #339933;">++;</span>
		lPos <span style="color: #339933;">*=</span> <span style="color: #CC0000;">5</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	console.<span style="color: #660066;">log</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Width &quot;</span> <span style="color: #339933;">+</span> mainWidth<span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot; lPos &quot;</span> <span style="color: #339933;">+</span> lPos <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot; lint &quot;</span> <span style="color: #339933;">+</span>lint <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000066; font-weight: bold;">return</span> lPos<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> isEven<span style="color: #009900;">&#40;</span>num<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #339933;">!</span><span style="color: #009900;">&#40;</span>num <span style="color: #339933;">%</span> <span style="color: #CC0000;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> getRotation<span style="color: #009900;">&#40;</span>neg<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>neg <span style="color: #339933;">==</span> undefined<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
<span style="color: #003366; font-weight: bold;">var</span> rotation <span style="color: #339933;">=</span> Math.<span style="color: #660066;">random</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">*</span><span style="color: #CC0000;">100</span><span style="color: #339933;">-</span><span style="color: #CC0000;">50</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> rotation <span style="color: #339933;">=</span> <span style="color: #3366CC;">'-='</span> <span style="color: #339933;">+</span> rotation.<span style="color: #660066;">toString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
console.<span style="color: #660066;">log</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Neg &quot;</span> <span style="color: #339933;">+</span> rotation<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</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: #003366; font-weight: bold;">var</span> rotation <span style="color: #339933;">=</span> Math.<span style="color: #660066;">random</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">*</span><span style="color: #CC0000;">300</span><span style="color: #339933;">-</span><span style="color: #CC0000;">50</span><span style="color: #339933;">;</span>	
<span style="color: #003366; font-weight: bold;">var</span> rotation <span style="color: #339933;">=</span> <span style="color: #3366CC;">'+='</span> <span style="color: #339933;">+</span> rotation.<span style="color: #660066;">toString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
console.<span style="color: #660066;">log</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Pos &quot;</span> <span style="color: #339933;">+</span> rotation<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000066; font-weight: bold;">return</span> rotation<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> getScale<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
<span style="color: #003366; font-weight: bold;">var</span> scale <span style="color: #339933;">=</span> Math.<span style="color: #660066;">random</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">*</span><span style="color: #CC0000;">300</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> scale <span style="color: #339933;">=</span> <span style="color: #3366CC;">'+='</span> <span style="color: #339933;">+</span> scale.<span style="color: #660066;">toString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">return</span> scale<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
&nbsp;
&nbsp;
&nbsp;
$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</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> 					   
<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>$.<span style="color: #660066;">browser</span>.<span style="color: #660066;">msie</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>						   
 goLines<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span><span style="color: #000066; font-weight: bold;">else</span><span style="color: #009900;">&#123;</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#container'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Please don't use this browser it lacks HTML5 capablites and is the bane of Web Development!  Go get &lt;a href='http://www.google.com/chrome/index.html' target='_blank'&gt;Chrome&lt;/a&gt;, &lt;a href='http://www.mozilla.com/en-US/firefox/upgrade.html' target='_blank'&gt;Firefox&lt;/a&gt;, &lt;a href='http://www.apple.com/safari/download/' target='_blank'&gt;Safari&lt;/a&gt;, something!&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p><a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2ktY3JlYXRlLm9yZy9KYXZhU2NyaXB0L2Fic3RyYWN0TGluZXMvbGluZXMuaHRtbA==" title=\"simple jQuery Abstract line experiment\" target=\"_blank\">Launch Experiment</a> / <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2ktY3JlYXRlLm9yZy9KYXZhU2NyaXB0L2Fic3RyYWN0TGluZXMuemlw" title=\"Download Source of simple jQuery Abstract line experiment\" target=\"_blank\">Download Code</a></p>
 <img src="http://i-create.org/wp-content/plugins/feed-statistics.php?view=1&post_id=798" width="1" height="1" style="display: none;" /><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fi-create.org%2F2010%2F04%2F11%2Fjquery-abstract-lines-experiment%2F&amp;linkname=jQuery%20Abstract%20Lines%20Experiment"><img src="http://i-create.org/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://i-create.org/2010/04/11/jquery-abstract-lines-experiment/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Simple jQuery Flower Experiment</title>
		<link>http://i-create.org/2010/04/05/simple-jquery-flower-experiment/</link>
		<comments>http://i-create.org/2010/04/05/simple-jquery-flower-experiment/#comments</comments>
		<pubDate>Tue, 06 Apr 2010 04:00:12 +0000</pubDate>
		<dc:creator>Brendon Smith</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[i-create]]></category>
		<category><![CDATA[Experiment]]></category>
		<category><![CDATA[JQuery]]></category>

		<guid isPermaLink="false">http://i-create.org/2010/04/05/simple-jquery-flower-experiment/</guid>
		<description><![CDATA[Simple flower experiment didn&#8217;t take to long this experiment uses jQuery.  This experiment didn&#8217;t take long to put together but at the same time I can&#8217;t help but think it would be better with Flash/Silverlight/Processing simply because of the way the browser doesn&#8217;t seem to be able to handle the PNG with semi-transparency and the [...]]]></description>
			<content:encoded><![CDATA[<p>Simple flower experiment didn&#8217;t take to long this experiment uses jQuery.  This experiment didn&#8217;t take long to put together but at the same time I can&#8217;t help but think it would be better with <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2VuLndpa2lwZWRpYS5vcmcvd2lraS9BZG9iZV9mbGFzaA==" title=\"What is Flash?\" target=\"_blank\">Flash</a>/<a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2VuLndpa2lwZWRpYS5vcmcvd2lraS9TaWx2ZXJsaWdodA==" title=\"What is Silverlight?\" target=\"_blank\">Silverlight</a>/<a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2VuLndpa2lwZWRpYS5vcmcvd2lraS9Qcm9jZXNzaW5nXyUyOHByb2dyYW1taW5nX2xhbmd1YWdlJTI5" title=\"What is Processing?\" target=\"_blank\">Processing</a> simply because of the way the browser doesn&#8217;t seem to be able to handle the PNG with semi-transparency and the animation ends up being kind of slow might have been better if I would have used <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3Byb2Nlc3NpbmdKUy5vcmc=" title=\"ProcessingJS\" target=\"_blank\">ProcessingJS</a>, but at the same time it was an idea I had and took all of about a half hour to produce.  While searching for a plugin that could rotate the object I also <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2Jsb2cucGFya2VyZm94LmNvLnVrLzIwMDkvMDkvMjIvYmV6aWVyLWN1cnZlcy1hbmQtYXJjcy1pbi1qcXVlcnkv" title=\"Cool jQuery Plugin\" target=\"_blank\">found</a> a cool <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3dlZXB5LmdpdGh1Yi5jb20vanF1ZXJ5LnBhdGgv" title=\"Cool jQuery plugin for bezier, curves, and arcs!\" target=\"_blank\">bezier, curve, arc</a> plugin and really it is kind of fun to play around with jQuery.  This was kind of fun to make although it also kind of reminds me of playing around with a Mandala kids toolkit for drawing (you know those simple toolkits where you get a wheel and you spin it around to create various concentric circles).  Don&#8217;t get me wrong I like both JavaScript and technologies like <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2VuLndpa2lwZWRpYS5vcmcvd2lraS9BZG9iZV9mbGFzaA==" title=\"What is Flash?\" target=\"_blank\">Flash</a>/<a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2VuLndpa2lwZWRpYS5vcmcvd2lraS9TaWx2ZXJsaWdodA==" title=\"What is Silverlight?\" target=\"_blank\">Silverlight</a>/<a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2VuLndpa2lwZWRpYS5vcmcvd2lraS9Qcm9jZXNzaW5nXyUyOHByb2dyYW1taW5nX2xhbmd1YWdlJTI5" title=\"What is Processing?\" target=\"_blank\">Processing</a> but I see those technologies being able to handle extreme graphic rendering extremely well and more importantly consistently.  The catch with no plugin has always been browser support.  Maybe that will go away if the next generation browser all implement the new technologies consistently but honestly I don&#8217;t see that happening anytime soon.  I am also glad to hear that <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2dvb2dsZWNocm9tZXJlbGVhc2VzLmJsb2dzcG90LmNvbS8yMDEwLzAzL2Rldi1jaGFubmVsLXVwZGF0ZV8zMC5odG1s" title=\"Chrome with integrated Flash Player!\" target=\"_blank\">flash is going to be integrated into chrome</a>!  I think flash should honestly be integrated directly into the browsers.  It is also exciting to see the new browsers supporting <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2Fyc3RlY2huaWNhLmNvbS93ZWIvbmV3cy8yMDEwLzA0L2h0bWw1LWFuZC13ZWJnbC1icmluZy1xdWFrZS10by10aGUtYnJvd3Nlci5hcnM=" title=\"QuakeII in WebGL noPlugin!\" target=\"_blank\">WebGL</a>.   I see adobe making future versions of flash with the ability to compile to Canvas just a hunch especially when you start to consider technologies like <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2hheGUub3JnLw==" title=\"haXe\" target=\"_blank\">haXe</a> and <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5qYW5nYXJvby5uZXQvaG9tZS8=" title=\"AS3 to JavaScript\" target=\"_blank\">jangaroo</a></p>
<p><a  title=\"Simple Flower Experiment with jQuery\" href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2ktY3JlYXRlLm9yZy9KYXZhU2NyaXB0L2Zsb3dlci9GbG93ZXIuaHRtbA==" target=\"_blank\"><img alt="simple jQuery Flower Experiment" src="http://i-create.org/JavaScript/flower/simpleFlower.jpg" /></a></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> bloom<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
<span style="color: #003366; font-weight: bold;">var</span> scale <span style="color: #339933;">=</span> <span style="color: #CC0000;">120</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> rotation <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> flower <span style="color: #339933;">=</span> <span style="color: #3366CC;">'&lt;div class=&quot;flower&quot;&gt;&lt;/div&gt;'</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> flower2 <span style="color: #339933;">=</span> <span style="color: #3366CC;">'&lt;div class=&quot;flower2&quot;&gt;&lt;/div&gt;'</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> flower3 <span style="color: #339933;">=</span> <span style="color: #3366CC;">'&lt;div class=&quot;flower3&quot;&gt;&lt;/div&gt;'</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> flower4 <span style="color: #339933;">=</span> <span style="color: #3366CC;">'&lt;div class=&quot;flower4&quot;&gt;&lt;/div&gt;'</span><span style="color: #339933;">;</span>
 <span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span>i<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i<span style="color: #339933;">&lt;</span><span style="color: #CC0000;">40</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
 $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#flowerBed'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span>flower<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#flowerBed'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span>flower2<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#flowerBed'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span>flower4<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#flowerBed'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span>flower3<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.flower'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'top'</span><span style="color: #339933;">,</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#flowerBed'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">height</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">/</span> <span style="color: #CC0000;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.flower'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'left'</span><span style="color: #339933;">,</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#flowerBed'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">width</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">/</span> <span style="color: #CC0000;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.flower'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>rotate<span style="color: #339933;">:</span> <span style="color: #3366CC;">'+=20deg'</span><span style="color: #339933;">,</span> scale<span style="color: #339933;">:</span> <span style="color: #3366CC;">'+=0.06'</span><span style="color: #339933;">,</span> opacity<span style="color: #339933;">:</span> <span style="color: #CC0000;">0.90</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">400</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.flower2'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'top'</span><span style="color: #339933;">,</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#flowerBed'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">height</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">/</span> <span style="color: #CC0000;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.flower2'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'left'</span><span style="color: #339933;">,</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#flowerBed'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">width</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">/</span> <span style="color: #CC0000;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.flower2'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>rotate<span style="color: #339933;">:</span> <span style="color: #3366CC;">'+=40deg'</span><span style="color: #339933;">,</span> scale<span style="color: #339933;">:</span> <span style="color: #3366CC;">'+=0.04'</span><span style="color: #339933;">,</span> opacity<span style="color: #339933;">:</span> <span style="color: #CC0000;">0.60</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">600</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.flower4'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'top'</span><span style="color: #339933;">,</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#flowerBed'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">height</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">/</span> <span style="color: #CC0000;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.flower4'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'left'</span><span style="color: #339933;">,</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#flowerBed'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">width</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">/</span> <span style="color: #CC0000;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.flower4'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>rotate<span style="color: #339933;">:</span> <span style="color: #3366CC;">'+=60deg'</span><span style="color: #339933;">,</span> scale<span style="color: #339933;">:</span> <span style="color: #3366CC;">'+=0.03'</span><span style="color: #339933;">,</span> opacity<span style="color: #339933;">:</span> <span style="color: #CC0000;">0.30</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">800</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
 $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.flower3'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'top'</span><span style="color: #339933;">,</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#flowerBed'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">height</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">/</span> <span style="color: #CC0000;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.flower3'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'left'</span><span style="color: #339933;">,</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#flowerBed'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">width</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">/</span> <span style="color: #CC0000;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.flower3'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>rotate<span style="color: #339933;">:</span> <span style="color: #3366CC;">'+=80deg'</span><span style="color: #339933;">,</span> scale<span style="color: #339933;">:</span> <span style="color: #3366CC;">'+=0.01'</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">1000</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
 <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</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> 
<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>$.<span style="color: #660066;">browser</span>.<span style="color: #660066;">msie</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>						   
 bloom<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</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: #009900;">&#40;</span><span style="color: #3366CC;">'#flowerBed'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Please don't use this browser it lacks HTML5 capablites and is the bane of Web Development!  Go get &lt;a href='http://www.google.com/chrome/index.html' target='_blank'&gt;Chrome&lt;/a&gt;, &lt;a href='http://www.mozilla.com/en-US/firefox/upgrade.html' target='_blank'&gt;Firefox&lt;/a&gt;, &lt;a href='http://www.apple.com/safari/download/' target='_blank'&gt;Safari&lt;/a&gt;, something!&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p><a title=\"Simple Flower Experiment with jQuery\" href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2ktY3JlYXRlLm9yZy9KYXZhU2NyaXB0L2Zsb3dlci9GbG93ZXIuaHRtbA==" target=\"_blank\">Launch Experiment</a> / <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2ktY3JlYXRlLm9yZy9KYXZhU2NyaXB0L2Zsb3dlci56aXA=" title=\"experiment Source Code\">Download Code</a></p>
 <img src="http://i-create.org/wp-content/plugins/feed-statistics.php?view=1&post_id=791" width="1" height="1" style="display: none;" /><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fi-create.org%2F2010%2F04%2F05%2Fsimple-jquery-flower-experiment%2F&amp;linkname=Simple%20jQuery%20Flower%20Experiment"><img src="http://i-create.org/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://i-create.org/2010/04/05/simple-jquery-flower-experiment/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CodeBreaker a Game of Deduction</title>
		<link>http://i-create.org/2010/04/04/codebreaker-a-game-of-deduction/</link>
		<comments>http://i-create.org/2010/04/04/codebreaker-a-game-of-deduction/#comments</comments>
		<pubDate>Sun, 04 Apr 2010 20:01:45 +0000</pubDate>
		<dc:creator>Brendon Smith</dc:creator>
				<category><![CDATA[Game Creation]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[i-create]]></category>
		<category><![CDATA[Experiment]]></category>
		<category><![CDATA[gameCreation]]></category>
		<category><![CDATA[Games]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[RayCasting]]></category>

		<guid isPermaLink="false">http://i-create.org/2010/04/04/codebreaker-a-game-of-deduction/</guid>
		<description><![CDATA[Let me first start of by simply telling you I have been reading Flash Game University by Gary Rosenzweig.  This is an excellent resource for anyone who wants to teach themselves how to create games.  The examples in the book are relatively simple but of course the logic that goes into creating them is not.  [...]]]></description>
			<content:encoded><![CDATA[<p>Let me first start of by simply telling you I have been reading <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5hbWF6b24uY29tL0FjdGlvblNjcmlwdC0zLTAtR2FtZS1Qcm9ncmFtbWluZy1Vbml2ZXJzaXR5L2RwLzA3ODk3MzcwMjcvcmVmPXNyXzFfMT9pZT1VVEY4JiMwMzg7cz1ib29rcyYjMDM4O3FpZD0xMjcwNDA3NDM3JiMwMzg7c3I9OC0x" title=\"Flash Game University by Gary Rosenzweig\" target=\"_blank\">Flash Game University by Gary Rosenzweig</a>.  This is an excellent resource for anyone who wants to teach themselves how to create games.  The examples in the book are relatively simple but of course the logic that goes into creating them is not.  While reading and studying the examples I have decide to convert some of the examples over to JavaScript not because I think JavaScript is better etc. etc. Personally I hate reading articles where people flame Adobe and say flash is dead etc.. Most of the time the people who write these articles can&#8217;t do both I can so I like both!  Simply because I thought it would help me along in the thinking process.  Some people play Bridge, Chess, Sudoku, or Crossword Puzzles to stay sharp I write code and study code to stay sharp.  So in his book he has an example that is similar to the <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2VuLndpa2lwZWRpYS5vcmcvd2lraS9NYXN0ZXJtaW5kXyUyOGJvYXJkX2dhbWUlMjk=" title=\"MasterMind board game\" target=\"_blank\">MasterMind board game</a>.  I decided to port over this game to JavaScript and have done this you can find the example by clicking <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=L0phdmFTY3JpcHQvY29kZUJyZWFrZXIvY29kZUJyZWFrZXIuaHRtbA==" target=\"_blank\" title=\"CodeBreaker a Game of Deduction\">here</a>. If you like this example please purchase his book it is an excellent book and this code was generated by studying his example so please pay him tribute and purchase the <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5hbWF6b24uY29tL0FjdGlvblNjcmlwdC0zLTAtR2FtZS1Qcm9ncmFtbWluZy1Vbml2ZXJzaXR5L2RwLzA3ODk3MzcwMjcvcmVmPXNyXzFfMT9pZT1VVEY4JmFtcDtzPWJvb2tzJmFtcDtxaWQ9MTI3MDQwNzQzNyZhbXA7c3I9OC0x" title=\"Flash Game University by Gary Rosenzweig\" target=\"_blank\">book</a> like I have.  A little background about the game if it says you have a correct spot and the correct color. If it says you have the correct color you have the correct color but it is in the incorrect spot.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"> 		<span style="color: #006600; font-style: italic;">// constants</span>
        <span style="color: #003366; font-weight: bold;">const</span> numPegs <span style="color: #339933;">=</span> <span style="color: #CC0000;">5</span><span style="color: #339933;">;</span>
        <span style="color: #003366; font-weight: bold;">const</span> numColors <span style="color: #339933;">=</span> <span style="color: #CC0000;">5</span><span style="color: #339933;">;</span>
        <span style="color: #003366; font-weight: bold;">const</span> maxTries <span style="color: #339933;">=</span> <span style="color: #CC0000;">10</span><span style="color: #339933;">;</span>
        <span style="color: #003366; font-weight: bold;">const</span> horizOffset <span style="color: #339933;">=</span> <span style="color: #CC0000;">30</span><span style="color: #339933;">;</span>
        <span style="color: #003366; font-weight: bold;">const</span> vertOffset <span style="color: #339933;">=</span> <span style="color: #CC0000;">60</span><span style="color: #339933;">;</span>
        <span style="color: #003366; font-weight: bold;">const</span> pegSpacing <span style="color: #339933;">=</span> <span style="color: #CC0000;">30</span><span style="color: #339933;">;</span>
        <span style="color: #003366; font-weight: bold;">const</span> rowSpacing <span style="color: #339933;">=</span> <span style="color: #CC0000;">30</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #006600; font-style: italic;">// game play variables</span>
        <span style="color: #003366; font-weight: bold;">var</span> solution <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Array<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #003366; font-weight: bold;">var</span> solutionButtonArray<span style="color: #339933;">;</span>
        <span style="color: #003366; font-weight: bold;">var</span> turnNum<span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #006600; font-style: italic;">// references to display objects</span>
		<span style="color: #003366; font-weight: bold;">var</span> buttonImages <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Array<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;img/cbBlack.png&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;img/cbGreen.png&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;img/cbYellow.png&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;img/cbPurple.png&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;img/cbRed.png&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;img/cbBlue.png&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #003366; font-weight: bold;">var</span> currentRow <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Array<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #003366; font-weight: bold;">var</span> currentText<span style="color: #339933;">;</span>
		<span style="color: #003366; font-weight: bold;">var</span> currentButton<span style="color: #339933;">;</span>
	    <span style="color: #003366; font-weight: bold;">var</span> mainIds <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>
		<span style="color: #003366; font-weight: bold;">var</span> myButton<span style="color: #339933;">;</span>
		<span style="color: #003366; font-weight: bold;">function</span> startGame<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i <span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>i<span style="color: #339933;">&lt;</span>numPegs<span style="color: #339933;">;</span>i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				<span style="color: #006600; font-style: italic;">// random, from 0 to 4</span>
				<span style="color: #003366; font-weight: bold;">var</span> r <span style="color: #339933;">=</span> Math.<span style="color: #660066;">floor</span><span style="color: #009900;">&#40;</span>Math.<span style="color: #660066;">random</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">*</span>numColors<span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #CC0000;">1</span><span style="color: #339933;">;</span>
				solution.<span style="color: #660066;">push</span><span style="color: #009900;">&#40;</span>r<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
			turnNum <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>
			createPegRow<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
	   <span style="color: #003366; font-weight: bold;">function</span> createPegRow<span style="color: #009900;">&#40;</span>start<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		   solutionButtonArray <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Array<span style="color: #009900;">&#40;</span><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>start <span style="color: #339933;">==</span> undefined<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		   $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#cbMainGame'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">html</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		   <span style="color: #009900;">&#125;</span>
		   <span style="color: #003366; font-weight: bold;">var</span> cbButton1 <span style="color: #339933;">=</span> <span style="color: #3366CC;">'&lt;div class=&quot;divCButton&quot; id=&quot;div'</span><span style="color: #339933;">;</span>
		   <span style="color: #003366; font-weight: bold;">var</span> cbButton2 <span style="color: #339933;">=</span> <span style="color: #3366CC;">'&quot; onclick=&quot;clickButton(this)&quot;&gt;&lt;img id=&quot;img'</span><span style="color: #339933;">;</span>
		   <span style="color: #003366; font-weight: bold;">var</span> cbButton3 <span style="color: #339933;">=</span> <span style="color: #3366CC;">'&quot; alt=&quot;0&quot; src=&quot;img/cbBlack.png&quot; /&gt;&lt;/div&gt;'</span><span style="color: #339933;">;</span>
		   <span style="color: #003366; font-weight: bold;">var</span> mainWrapper1 <span style="color: #339933;">=</span> <span style="color: #3366CC;">'&lt;div class=&quot;mainWrapper&quot;&gt;'</span><span style="color: #339933;">;</span>
		   <span style="color: #003366; font-weight: bold;">var</span> mainWrapper2 <span style="color: #339933;">=</span> <span style="color: #3366CC;">'&lt;/div&gt;'</span><span style="color: #339933;">;</span>
		   $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#cbMainGame'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span>mainWrapper1<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		   <span style="color: #003366; font-weight: bold;">var</span> btnFinished <span style="color: #339933;">=</span> <span style="color: #3366CC;">'&lt;div class=&quot;imgButton&quot; id=&quot;divButtonFinished'</span><span style="color: #339933;">;</span>
		   <span style="color: #003366; font-weight: bold;">var</span> btnFinished2<span style="color: #339933;">=</span> <span style="color: #3366CC;">'&quot;&gt;&lt;center&gt;&lt;div class=&quot;mainButton&quot; id=&quot;divButtonDone'</span><span style="color: #339933;">;</span>
		   <span style="color: #003366; font-weight: bold;">var</span> btnFinished3<span style="color: #339933;">=</span> <span style="color: #3366CC;">'&quot; onclick=&quot;executeGameQuery(this)&quot;&gt;&lt;span id=&quot;spnMainButton&quot;&gt;Done&lt;/span&gt;&lt;/div&gt;&lt;/center&gt;&lt;/div&gt;'</span><span style="color: #339933;">;</span>
	   	   currentRow <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Array<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		   <span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span>i<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>i<span style="color: #339933;">&lt;</span>numPegs<span style="color: #339933;">;</span>i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#cbMainGame'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span>cbButton1<span style="color: #339933;">+</span>mainIds<span style="color: #339933;">+</span>cbButton2<span style="color: #339933;">+</span>mainIds<span style="color: #339933;">+</span>cbButton3<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				solutionButtonArray.<span style="color: #660066;">push</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;img&quot;</span><span style="color: #339933;">+</span>mainIds<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				mainIds<span style="color: #339933;">++;</span>
			<span style="color: #009900;">&#125;</span>
			$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#cbMainGame'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span>btnFinished<span style="color: #339933;">+</span>mainIds<span style="color: #339933;">+</span>btnFinished2<span style="color: #339933;">+</span>mainIds<span style="color: #339933;">+</span>btnFinished3<span style="color: #339933;">+</span>mainWrapper2<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	   <span style="color: #009900;">&#125;</span>
&nbsp;
	   <span style="color: #003366; font-weight: bold;">function</span> clickButton<span style="color: #009900;">&#40;</span>clicked<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		   <span style="color: #003366; font-weight: bold;">var</span> myButton <span style="color: #339933;">=</span> clicked<span style="color: #339933;">;</span>
		   <span style="color: #003366; font-weight: bold;">var</span> img <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span>clicked<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">find</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'img'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		   <span style="color: #003366; font-weight: bold;">var</span> imageToChange <span style="color: #339933;">=</span> img<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span>.<span style="color: #660066;">alt</span>.<span style="color: #660066;">toString</span><span style="color: #009900;">&#40;</span><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>imageToChange <span style="color: #339933;">==</span> <span style="color: #CC0000;">6</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
			imageToChange <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>   
		   <span style="color: #009900;">&#125;</span>
		   <span style="color: #006600; font-style: italic;">//console.log(imageToChange);</span>
		   $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#&quot;</span><span style="color: #339933;">+</span>img<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span>.<span style="color: #660066;">id</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;src&quot;</span><span style="color: #339933;">,</span>buttonImages<span style="color: #009900;">&#91;</span>parseInt<span style="color: #009900;">&#40;</span>imageToChange<span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		   $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#&quot;</span><span style="color: #339933;">+</span>img<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span>.<span style="color: #660066;">id</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;alt&quot;</span><span style="color: #339933;">,</span> parseInt<span style="color: #009900;">&#40;</span>imageToChange<span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	   <span style="color: #009900;">&#125;</span>
&nbsp;
	   <span style="color: #003366; font-weight: bold;">function</span> executeGameQuery<span style="color: #009900;">&#40;</span>mainButton<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		   <span style="color: #003366; font-weight: bold;">var</span> buttonClicked <span style="color: #339933;">=</span> mainButton<span style="color: #339933;">;</span>
		   <span style="color: #003366; font-weight: bold;">var</span> changeThis <span style="color: #339933;">=</span> buttonClicked.<span style="color: #660066;">id</span><span style="color: #339933;">;</span>
		   <span style="color: #003366; font-weight: bold;">var</span> currentColorList <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Array<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		   <span style="color: #003366; font-weight: bold;">var</span> colorList <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Array<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">,</span><span style="color: #CC0000;">0</span><span style="color: #339933;">,</span><span style="color: #CC0000;">0</span><span style="color: #339933;">,</span><span style="color: #CC0000;">0</span><span style="color: #339933;">,</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		   <span style="color: #003366; font-weight: bold;">var</span> soltionList <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Array<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">,</span><span style="color: #CC0000;">0</span><span style="color: #339933;">,</span><span style="color: #CC0000;">0</span><span style="color: #339933;">,</span><span style="color: #CC0000;">0</span><span style="color: #339933;">,</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		   changeThis <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#&quot;</span><span style="color: #339933;">+</span>changeThis<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">parent</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">parent</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		   <span style="color: #006600; font-style: italic;">//console.log(changeThis);</span>
		   <span style="color: #003366; font-weight: bold;">var</span> numberCorrect <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>
		   <span style="color: #003366; font-weight: bold;">var</span> numberColorsCorrect <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>
		   turnNum<span style="color: #339933;">++;</span>
		   <span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span>i<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i<span style="color: #339933;">&lt;</span>numPegs<span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
			   currentColorList.<span style="color: #660066;">push</span><span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#&quot;</span><span style="color: #339933;">+</span>solutionButtonArray<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;alt&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			   $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#&quot;</span><span style="color: #339933;">+</span>solutionButtonArray<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">parent</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">removeAttr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;onclick&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		   <span style="color: #009900;">&#125;</span>
		   <span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span>i<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i<span style="color: #339933;">&lt;</span>numPegs<span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
			  <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>currentColorList<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> solution<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
				  numberCorrect<span style="color: #339933;">++;</span>
			  <span style="color: #009900;">&#125;</span><span style="color: #000066; font-weight: bold;">else</span><span style="color: #009900;">&#123;</span>
				  soltionList<span style="color: #009900;">&#91;</span>solution<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">++;</span>
				  colorList<span style="color: #009900;">&#91;</span>parseInt<span style="color: #009900;">&#40;</span>currentColorList<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">++;</span>
			  <span style="color: #009900;">&#125;</span>
		   <span style="color: #009900;">&#125;</span>
		   <span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span>i<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i<span style="color: #339933;">&lt;</span>numColors<span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
			   <span style="color: #003366; font-weight: bold;">var</span> test <span style="color: #339933;">=</span> Math.<span style="color: #660066;">min</span><span style="color: #009900;">&#40;</span>soltionList<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>colorList<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				numberColorsCorrect <span style="color: #339933;">=</span> numberColorsCorrect <span style="color: #339933;">+</span> Math.<span style="color: #660066;">min</span><span style="color: #009900;">&#40;</span>soltionList<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>colorList<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
		   $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#&quot;</span><span style="color: #339933;">+</span>buttonClicked.<span style="color: #660066;">id</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">remove</span><span style="color: #009900;">&#40;</span><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>numberCorrect <span style="color: #339933;">==</span> numPegs<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		   $<span style="color: #009900;">&#40;</span>changeThis<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">html</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'You Got It!&lt;br/&gt;&lt;div class=&quot;imgButton&quot;&gt;&lt;center&gt;&lt;div onclick=&quot;startGame()&quot; id=&quot;divButtonDone5&quot; class=&quot;mainButton&quot;&gt;&lt;span id=&quot;spnMainButton&quot;&gt;Play Again&lt;/span&gt;&lt;/div&gt;&lt;/center&gt;&lt;/div&gt;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		   <span style="color: #009900;">&#125;</span><span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>turnNum <span style="color: #339933;">==</span> maxTries<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
			   $<span style="color: #009900;">&#40;</span>changeThis<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">html</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'I regret to infrom you just lost next time do it quicker! &lt;br/&gt;&lt;div class=&quot;imgButton&quot;&gt;&lt;center&gt;&lt;div onclick=&quot;startGame()&quot; id=&quot;divButtonDone5&quot; class=&quot;mainButton&quot;&gt;&lt;span id=&quot;spnMainButton&quot;&gt;Play Again&lt;/span&gt;&lt;/div&gt;&lt;/center&gt;&lt;/div&gt;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		   <span style="color: #009900;">&#125;</span>
		   <span style="color: #000066; font-weight: bold;">else</span><span style="color: #009900;">&#123;</span>
		   $<span style="color: #009900;">&#40;</span>changeThis<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">html</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Correct Spot: &quot;</span><span style="color: #339933;">+</span>numberCorrect<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;, Correct Color: &quot;</span><span style="color: #339933;">+</span>numberColorsCorrect<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		   <span style="color: #003366; font-weight: bold;">var</span> start <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
		   createPegRow<span style="color: #009900;">&#40;</span>start<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		   <span style="color: #009900;">&#125;</span>
	   <span style="color: #009900;">&#125;</span>
$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</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> 
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#cbMainGame'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span>startGameHTML<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></pre></div></div>

<p><a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=L0phdmFTY3JpcHQvY29kZUJyZWFrZXIvY29kZUJyZWFrZXIuaHRtbA==" target=\"_blank\" title=\"CodeBreaker a Game of Deduction\">Launch Game</a> / <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=L0phdmFTY3JpcHQvY29kZUJyZWFrZXIuemlw">Download Code</a></p>
<p>I have also been spending some time playing around with <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2xhYnMuYWRvYmUuY29tL3RlY2hub2xvZ2llcy9hbGNoZW15Lw==" title=\"Alchemy\" target=\"_blank\">Alchemy</a> last post I displayed some examples of <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2VuLndpa2lwZWRpYS5vcmcvd2lraS9SYXlfY2FzdGluZw==" title=\"What is a Ray Caster?\" target=\"_blank\">RayCasters</a> the old style 3d of Games like Wolfenstien and Doom.  In short most of the raycasters out their follow this <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5zdHVkZW50Lmt1bGV1dmVuLmJlL35tMDIxNjkyMi9DRy9yYXljYXN0aW5nLmh0bWw=" title=\"RayCaster Example\" target=\"_blank\">example</a>  this example is a c++ example and Adobe has a project in their labs   called Alchemy.  Alchemy allows you to port existing C/C++ to   ActionScript.  Which is really cool but also extremely difficult to do:)  Right now I need to rewrite a chunk of it that uses <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5saWJzZGwub3Jn" title=\"lib SDL\" target=\"_blank\">SDL lib</a> an old library that was used to create most video games years ago.  I searched to see if someone was doing something similar and sure enough   someone is  <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2JydWNlLWxhYi5ibG9nc3BvdC5jb20vMjAwOS8wOC9hZG9iZS1hbGNoZW15LXJheS1jYXN0ZXItcG9ydC5odG1s" title=\"RayCaster in Flash Via Alchemy\" target=\"_blank\">Bruce Jawn</a>.  He informed me that instead of using SDL I need to pass it to the screen buffer as a byte array.  So that is currently what I am trying to do he also mentioned posting his Make file under Google code in the near future.  Hopefully he does I have also noticed <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2xpYi5oYXhlLm9yZy9wL25tZQ==" title=\"haXe SDL Wrapper\" target=\"_blank\">haXe has an SDL wrapper</a>.  This might also be   useful to study <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5iYWRzZWN0b3JhY3VsYS5jb20vcGVwb25pL3JheWZhc3RlcjIv" title=\"RayFaster2\" target=\"_blank\">RayFaster2</a> this is a RayCaster built with haXe that is super fast.  Their are   numerous examples of RayCasters written in ActionScript but I am looking for speed.  I might think about also just writing one from scratch and implementing a JavaScript version of it as well.  I could have spent   this weekend working on my new portfolio but unfortunately I didn&#8217;t do that:(  I will have to extend it deadline beyond the 4 days time limit   once again:(</p>
 <img src="http://i-create.org/wp-content/plugins/feed-statistics.php?view=1&post_id=785" width="1" height="1" style="display: none;" /><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fi-create.org%2F2010%2F04%2F04%2Fcodebreaker-a-game-of-deduction%2F&amp;linkname=CodeBreaker%20a%20Game%20of%20Deduction"><img src="http://i-create.org/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://i-create.org/2010/04/04/codebreaker-a-game-of-deduction/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Next Chapter</title>
		<link>http://i-create.org/2010/03/28/next-chapter/</link>
		<comments>http://i-create.org/2010/03/28/next-chapter/#comments</comments>
		<pubDate>Mon, 29 Mar 2010 03:54:12 +0000</pubDate>
		<dc:creator>Brendon Smith</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[MashUp]]></category>
		<category><![CDATA[i-create]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[Processing]]></category>
		<category><![CDATA[ProcessingJS]]></category>
		<category><![CDATA[Yahoo Pipes]]></category>

		<guid isPermaLink="false">http://i-create.org/?p=769</guid>
		<description><![CDATA[Well the good news is I am officially a Rich Internet Application Developer! So I will mainly be focusing on creating reusable controls with JavaScript and ActionScript for the retail store Hayneedle! I will miss working with all the wonderful developers at infoGroup. I was fortunate enough to start their as a Graphical User Interface [...]]]></description>
			<content:encoded><![CDATA[<p>Well the good news is I am officially a Rich Internet Application Developer!  So I will mainly be focusing on creating reusable controls with JavaScript and ActionScript for the retail store <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5oYXluZWVkbGUuY29tLz9zb3VyY2U9Z29vZ2xlYXcmIzAzODtrd2lkPWhheW5lZWRsZSYjMDM4O3RpZD1leGFjdA==" title=\"Hayneedle\" target=\"_blank\">Hayneedle</a>!  I will miss working with all the wonderful developers at <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2luZm9ncm91cC5jb20v" title=\"infoGroup\" target=\"_blank\">infoGroup</a>.  I was fortunate enough to start their as a Graphical User Interface Developer and end as a Software Engineer.  I have learned a tremendous amount from working at infoGroup and will miss all of them.  I will also never forget all the knowledge they shared with me.  C# is an awesome language and so is Ruby on Rails!  I will continue to use both in the future!  While working at infoGroup I worked on numerous projects 2 newer versions of Salesgenie.com and one entirely new product SalesDesk a real-time CRM.   I utilized <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2pxdWVyeS5jb20v" title=\"jQuery\" target=\"_blank\">jQuery</a>, CSS, ASP.NET 2.0, ASP.NET 3.5 (MVC), and Ruby on Rails.  I will continue to learn and use new languages at my new post at Hayneedle I will be using ColdFusion, JavaScript, and ActionScript.  I think it will be fun to have a change of pace and I am really excited to be a part of their development / user experience group!  I believe this job will enable me to use my creative side a little more; so I think that will be enjoyable and I think I will learn a tremendous amount by working with the new team they are an extremely innovative group.  It is always good to challenge yourself and change things, and have new experiences, I will miss infoGroup.  This month I have been extremely busy I am currently working with two clients in the Omaha Metro area and I will be teaming up with <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL21pbm9yd2hpdGVzdHVkaW9zLmNvbS9ibG9nLw==" title=\"MinorWhiteStudios\" target=\"_blank\">MinorWhiteStudios</a> on future projects so I am excited to be working with them.  I believe they are the best photographers / designers in town.  I hadn&#8217;t talked to Scott in years and it was nice of him to call me.  His whole team is extremely creative and I belive I will also learn a great deal working with them!</p>
<p>I have really been sitting around and reading a great deal at home.  I don&#8217;t get out much anymore.  I find myself playing with new technologies on my off time.  I have also been working on a game for a client of mine and hopefully I can have a demo of that soon!  Lately I have been playing around with <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3Byb2Nlc3Npbmdqcy5vcmcv" title=\"ProcessingJS\" target=\"_blank\">ProcessingJS</a> and here is a new experiment.  This example uses a font from <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5kYWZvbnQuY29tL2xhdXJlbi10aG9tcHNvbi5kMTk5Nw==" title=\"DaFont\" target=\"_blank\">DaFont</a>.  This example also borrows from this <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3Byb2Nlc3Npbmdqcy5vcmcvc291cmNlL2NhbnZhcy10ZXh0LWxpbmtzL2NhbnZhcy10ZXh0LWxpbmsuaHRtbA==" title=\"processin link example\" target=\"_blank\">example</a> thanks to <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2h5cGVyLW1ldHJpeC5jb20=" title=\"@F1LT3R\" target=\"_blank\">@F1LT3R</a> for sharing this example.  You know it&#8217;s fun using Processing with jQuery I will continue to watch and play with this framework because its fun:)</p>
<p><a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2ktY3JlYXRlLm9yZy9KYXZhU2NyaXB0L3Byb2Nlc3NpbkpTX1lhaG9vUGlwZXMveWFob29QaXBlLmh0bWw=" target=\"_blank\" title=\"ProcessingJS and jQuery Simple MashUp\" ><img src="/JavaScript/processinJS_YahooPipes/processingMashUp.jpg" title="Processing JS mashUp using JSON and Yahoo Pipes" /></a></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> jData<span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> objClik <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Array<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> colorPool <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Array<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#075997&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;#079714&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;#970744&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;#079792&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;#970769&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;#078497&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;#970718&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;#075197&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;#079733&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;#079707&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">function</span> loadFeed<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	jQuery.<span style="color: #660066;">getJSON</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;http://pipes.yahoo.com/pipes/pipe.run?_id=2432dea4d4d6afa353c425dc5e542fb4&amp;_render=json&amp;_callback=?&quot;</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>json<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	jData <span style="color: #339933;">=</span> json<span style="color: #339933;">;</span>
	jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#YahooPipe'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">width</span><span style="color: #009900;">&#40;</span>jQuery<span style="color: #009900;">&#40;</span>window<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">width</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#YahooPipe'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">height</span><span style="color: #009900;">&#40;</span>jQuery<span style="color: #009900;">&#40;</span>window<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">height</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	loadProcessing<span style="color: #009900;">&#40;</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: #009900;">&#125;</span>
jQuery<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</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> 
<span style="color: #000066; font-weight: bold;">try</span><span style="color: #009900;">&#123;</span>
<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>jQuery.<span style="color: #660066;">browser</span>.<span style="color: #660066;">msie</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
loadFeed<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #000066; font-weight: bold;">else</span><span style="color: #009900;">&#123;</span>
	jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#result'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Sorry you are using Internet Explorer an inferior browser please utilize a next generation browser like FireFox, Chrome, or Safari!&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #000066; font-weight: bold;">catch</span><span style="color: #009900;">&#40;</span>err<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#result'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Sorry Pipe Failed to Load Please refresh and try again:)&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> loadProcessing<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		<span style="color: #003366; font-weight: bold;">var</span> script <span style="color: #339933;">=</span> document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span> <span style="color: #3366CC;">'linkScript'</span> <span style="color: #009900;">&#41;</span>.<span style="color: #660066;">text</span><span style="color: #339933;">;</span>
		<span style="color: #003366; font-weight: bold;">var</span> canvas <span style="color: #339933;">=</span> document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span> <span style="color: #3366CC;">'YahooPipe'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		Processing<span style="color: #009900;">&#40;</span>canvas<span style="color: #339933;">,</span> script<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
&nbsp;
<span style="color: #000066; font-weight: bold;">void</span> setup<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  strokeWeight<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  noStroke<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  size<span style="color: #009900;">&#40;</span>jQuery<span style="color: #009900;">&#40;</span>window<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">width</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>jQuery<span style="color: #009900;">&#40;</span>window<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">height</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  background<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">255</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  smooth<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
PFont font <span style="color: #339933;">=</span> loadFont<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Champagne_Limousines.svg&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">void</span> draw<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> 
<span style="color: #009900;">&#123;</span>
  <span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span>i <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> jData.<span style="color: #660066;">value</span>.<span style="color: #660066;">items</span>.<span style="color: #660066;">length</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
  int pointX <span style="color: #339933;">=</span> random<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">,</span>jQuery<span style="color: #009900;">&#40;</span>window<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">width</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  int pointY <span style="color: #339933;">=</span> random<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">,</span>jQuery<span style="color: #009900;">&#40;</span>window<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">height</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  int fSize <span style="color: #339933;">=</span> random<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">30</span><span style="color: #339933;">,</span><span style="color: #CC0000;">65</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  objClik.<span style="color: #660066;">push</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">new</span> alinked<span style="color: #009900;">&#40;</span>pointX<span style="color: #339933;">,</span>pointY<span style="color: #339933;">,</span>fSize<span style="color: #339933;">,</span>jData.<span style="color: #660066;">value</span>.<span style="color: #660066;">items</span><span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">link</span><span style="color: #339933;">,</span> jData.<span style="color: #660066;">value</span>.<span style="color: #660066;">items</span><span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">title</span><span style="color: #339933;">,</span> colorPool<span style="color: #009900;">&#91;</span>Math.<span style="color: #660066;">floor</span><span style="color: #009900;">&#40;</span>Math.<span style="color: #660066;">random</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">*</span> colorPool.<span style="color: #660066;">length</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>colorPool<span style="color: #009900;">&#91;</span>Math.<span style="color: #660066;">floor</span><span style="color: #009900;">&#40;</span>Math.<span style="color: #660066;">random</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">*</span> colorPool.<span style="color: #660066;">length</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
&nbsp;
  <span style="color: #009900;">&#125;</span>
  forLinks<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'render'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  exit<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
&nbsp;
<span style="color: #000066; font-weight: bold;">void</span> forLinks<span style="color: #009900;">&#40;</span>mode<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
  <span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span>int i<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>i <span style="color: #339933;">&lt;</span> objClik.<span style="color: #660066;">length</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    t<span style="color: #339933;">=</span>objClik<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
    <span style="color: #000066; font-weight: bold;">switch</span><span style="color: #009900;">&#40;</span>mode<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
      <span style="color: #000066; font-weight: bold;">case</span> <span style="color: #3366CC;">'render'</span><span style="color: #339933;">:</span>objClik<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">render</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>break<span style="color: #339933;">;</span>
      <span style="color: #000066; font-weight: bold;">case</span> <span style="color: #3366CC;">'detect'</span><span style="color: #339933;">:</span>
        mouseX <span style="color: #339933;">&gt;</span> objClik<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">x</span> <span style="color: #339933;">&amp;&amp;</span>   
        mouseY <span style="color: #339933;">&gt;</span> objClik<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">y</span> <span style="color: #339933;">&amp;&amp;</span>
        mouseY <span style="color: #339933;">&lt;</span> objClik<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">y</span><span style="color: #339933;">+</span>t.<span style="color: #660066;">size</span> <span style="color: #339933;">&amp;&amp;</span>
        mouseX <span style="color: #339933;">&lt;</span> objClik<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">x</span><span style="color: #339933;">+</span>t.<span style="color: #660066;">anchorWidth</span><span style="color: #339933;">?</span>
          objClik<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">rollOver</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span>
          objClik<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">rollOut</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span>
      <span style="color: #000066; font-weight: bold;">case</span> <span style="color: #3366CC;">'clicks'</span><span style="color: #339933;">:</span>objClik<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">mouseOver</span><span style="color: #339933;">?</span>objClik<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">clicked</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000066; font-weight: bold;">void</span> mouseMoved<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>forLinks<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'detect'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span>
<span style="color: #000066; font-weight: bold;">void</span> mouseClicked<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>forLinks<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'clicks'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">class</span> alinked<span style="color: #009900;">&#123;</span>
  boolean mouseOver<span style="color: #339933;">;</span>
  color current_col<span style="color: #339933;">;</span>
  float anchorWidth<span style="color: #339933;">;</span>
  alinked<span style="color: #009900;">&#40;</span>float x<span style="color: #339933;">,</span> float y<span style="color: #339933;">,</span> float size<span style="color: #339933;">,</span> String href<span style="color: #339933;">,</span>String anchor<span style="color: #339933;">,</span> Color text_col<span style="color: #339933;">,</span> Color hover_col<span style="color: #009900;">&#41;</span>
  <span style="color: #009900;">&#123;</span>
    href<span style="color: #339933;">=</span>href<span style="color: #339933;">;</span>    
    anchor<span style="color: #339933;">=</span>anchor<span style="color: #339933;">;</span>    
    <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">size</span><span style="color: #339933;">=</span>size<span style="color: #339933;">;</span>
    <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">x</span><span style="color: #339933;">=</span>x<span style="color: #339933;">,</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">y</span><span style="color: #339933;">=</span>y<span style="color: #339933;">;</span>
    text_col<span style="color: #339933;">=</span>text_col<span style="color: #339933;">;</span>
    hover_col<span style="color: #339933;">=</span>hover_col<span style="color: #339933;">;</span>
    current_col<span style="color: #339933;">=</span>text_col<span style="color: #339933;">;</span>
    mouseOver<span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>    
  <span style="color: #009900;">&#125;</span>
  <span style="color: #000066; font-weight: bold;">void</span> render<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    anchorWidth<span style="color: #339933;">=</span>font.<span style="color: #660066;">width</span><span style="color: #009900;">&#40;</span>anchor<span style="color: #009900;">&#41;</span><span style="color: #339933;">*</span>size<span style="color: #339933;">;</span>    
    clear<span style="color: #009900;">&#40;</span>x<span style="color: #339933;">,</span>y<span style="color: #339933;">,</span>anchorWidth<span style="color: #339933;">,</span>size<span style="color: #339933;">+</span><span style="color: #CC0000;">4</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    textFont<span style="color: #009900;">&#40;</span>font<span style="color: #339933;">,</span>size<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    fill<span style="color: #009900;">&#40;</span>current_col<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    mouseOver<span style="color: #339933;">?</span>rect<span style="color: #009900;">&#40;</span>x<span style="color: #339933;">,</span>y<span style="color: #339933;">+</span>size<span style="color: #339933;">+</span><span style="color: #CC0000;">2</span><span style="color: #339933;">,</span>anchorWidth<span style="color: #339933;">,</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>
    text<span style="color: #009900;">&#40;</span>anchor<span style="color: #339933;">,</span>x<span style="color: #339933;">,</span>y<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>    
  <span style="color: #009900;">&#125;</span>
  <span style="color: #000066; font-weight: bold;">void</span> rollOver<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>mouseOver<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>      
      mouseOver<span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
      cursor<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'pointer'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      current_col<span style="color: #339933;">=</span>hover_col<span style="color: #339933;">;</span>
      render<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #000066; font-weight: bold;">void</span> rollOut<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>mouseOver<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
      mouseOver<span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
      cursor<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'auto'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      current_col<span style="color: #339933;">=</span>text_col<span style="color: #339933;">;</span>
      render<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #000066; font-weight: bold;">void</span> clicked<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    link<span style="color: #009900;">&#40;</span>href<span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;_blank&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p><a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2ktY3JlYXRlLm9yZy9KYXZhU2NyaXB0L3Byb2Nlc3NpbkpTX1lhaG9vUGlwZXMveWFob29QaXBlLmh0bWw=" target=\"_blank\" title=\"ProcessingJS and jQuery Simple MashUp\" >Launch Example</a> / <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2ktY3JlYXRlLm9yZy9KYXZhU2NyaXB0L3Byb2Nlc3NpbkpTX1lhaG9vUGlwZXMuemlw" target=\"_blank\" title=\"ProcessingJS and jQuery Simple MashUp Code Download\" >Download Example</a></p>
<p>This experiment simply grabs a yahoo pipe parses the JSON and then adds the links to the Canvas tag.  It is really amazing to see all the progress of HTML5 and all the cool new JavaScript libraries.  Please note internet explorer users will not be able to view this example because IE does not support the Canvas tag:(.  Sometimes I have also noticed it fails to capture the JSON but I have a try catch so it should tell you to try again.  I am not going to add a JAVA version of this project simply because I don&#8217;t have time too right now. I noticed ProcessingJS is now supporting some of the 3D functions of Processing (JAVA) I haven&#8217;t had time to play with them lately but I will make a data mashup with it as soon as I can find the time.  I am also still working on my new Portfolio the never ending project maybe within the next two weeks I will actually post it!  I am looking forward to <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2NzNS5vcmcv" title=\"CS5!\" target=\"_blank\">CS5</a> and purchasing Flash Builder 4!   I have also noticed that with libraries like <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3NjcmlwdHkyLmNvbS8=" title=\"Scripty2\" target=\"_blank\">Scripty2</a> it might be a fun to port over some Flash Games (AS2) utilize JavaScript so they can be enjoyed with out a plugin!</p>
<p><a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5icmlnaHRodWIuY29tL2h1YmZvbGlvL21hdHRoZXctY2FzcGVyc29uL2Jsb2cvYXJjaGl2ZS8yMDA5LzA3LzA4L2ZsYXNoLWFuZC1qYXZhc2NyaXB0LTNkLXdpdGgtc2FuZHktaHguYXNweA==" title=\"Sandy3D haXe 2 JavaScript Examples\" target=\"_blank\">Sandy3D haXe 2 JavaScript Examples</a><br />
<a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5hbnNjYW1vYmlsZS5jb20vY29yb25hLw==" title=\"Corona SDK \" target=\"_blank\">Corona SDK </a><br />
<a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5zcHJvdXRjb3JlLmNvbS8=" title=\"SproutCore JavaScript FrameWork\" target=\"_blank\">SproutCore JavaScript FrameWork</a><br />
<a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3NjcmlwdHkyLmNvbS8=" title=\"Scripty2 JavaScript Framework\" target=\"_blank\">Scripty2</a><br />
<a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5zdHVkZW50Lmt1bGV1dmVuLmJlL35tMDIxNjkyMi9DRy9yYXljYXN0aW5nLmh0bWw=" title=\"Excellent C++ RayCaster Example\" target=\"_blank\">Excellent C++ RayCaster Example</a><br />
<a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2FqYXhuYS5jb2RlcGxleC5jb20v" title=\"Ajax RayCaster Example\" target=\"_blank\">Ajax RayCaster Example</a><br />
<a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3JheWNhc3RlcnguY29kZXBsZXguY29tLw==" title=\"XNA C# RayCaster\" target=\"_blank\">XNA C# RayCaster</a></p>
 <img src="http://i-create.org/wp-content/plugins/feed-statistics.php?view=1&post_id=769" width="1" height="1" style="display: none;" /><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fi-create.org%2F2010%2F03%2F28%2Fnext-chapter%2F&amp;linkname=Next%20Chapter"><img src="http://i-create.org/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://i-create.org/2010/03/28/next-chapter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery CenterIT</title>
		<link>http://i-create.org/2010/02/07/jquery-centerit/</link>
		<comments>http://i-create.org/2010/02/07/jquery-centerit/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 00:37:54 +0000</pubDate>
		<dc:creator>Brendon Smith</dc:creator>
				<category><![CDATA[3d]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[QuickTip]]></category>
		<category><![CDATA[JavaScript programming language]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[quick tip]]></category>
		<category><![CDATA[webGL]]></category>

		<guid isPermaLink="false">http://i-create.org/?p=765</guid>
		<description><![CDATA[Have you ever had to deal with the hassle of centering modal windows? I made this function to automagically center windows I call this function after I load a modal and it centers the object perfectly for every browser. It takes the hassle of wondering if something is perfectly center in every browser. The only [...]]]></description>
			<content:encoded><![CDATA[<p>Have you ever had to deal with the hassle of centering modal windows?  I made this function to automagically center windows I call this function after I load a modal and it centers the object perfectly for every browser.  It takes the hassle of wondering if something is perfectly center in every browser.  The only thing I do to use it is send it the main containing div that the object should be centered in and the div that I want to be centered.  It grabs the offset does a little basic math and that&#8217;s it.  No more hassle with centering now it will be perfectly centered.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> CenterIT<span style="color: #009900;">&#40;</span>mainModal<span style="color: #339933;">,</span> mainContainer<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #003366; font-weight: bold;">var</span> modalW <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span>mainModal<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">width</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">/</span> <span style="color: #CC0000;">2</span><span style="color: #339933;">;</span>
    <span style="color: #003366; font-weight: bold;">var</span> windowW <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span>mainContainer<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">width</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">/</span> <span style="color: #CC0000;">2</span><span style="color: #339933;">;</span>
    <span style="color: #003366; font-weight: bold;">var</span> modalH <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span>mainModal<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">height</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">/</span> <span style="color: #CC0000;">2</span><span style="color: #339933;">;</span>
    <span style="color: #003366; font-weight: bold;">var</span> windowH <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span>mainContainer<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">height</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">/</span> <span style="color: #CC0000;">2</span><span style="color: #339933;">;</span>
    <span style="color: #003366; font-weight: bold;">var</span> centerPointW <span style="color: #339933;">=</span> windowW <span style="color: #339933;">-</span> modalW<span style="color: #339933;">;</span>
    <span style="color: #003366; font-weight: bold;">var</span> centerPointH <span style="color: #339933;">=</span> windowH <span style="color: #339933;">-</span> modalH<span style="color: #339933;">;</span>
    <span style="color: #003366; font-weight: bold;">var</span> myPoint <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span>mainContainer<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">offset</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    centerPointW <span style="color: #339933;">=</span> myPoint.<span style="color: #660066;">left</span> <span style="color: #339933;">+</span> centerPointW<span style="color: #339933;">;</span>
    centerPointH <span style="color: #339933;">=</span> myPoint.<span style="color: #660066;">top</span> <span style="color: #339933;">+</span> centerPointH<span style="color: #339933;">;</span>
    $<span style="color: #009900;">&#40;</span>mainModal<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'left'</span><span style="color: #339933;">,</span> centerPointW<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    $<span style="color: #009900;">&#40;</span>mainModal<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'top'</span><span style="color: #339933;">,</span> centerPointH<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>   
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Some Useful/Interesting Flash Links:<br />
<a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5jbG9zaWVyLm5sL3ByZWZhYi8=" title=\"PreFab\" target=\"_blank\">Prefab</a> &#8211; Highly useful tool when it comes to 3D in flash with <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2F3YXkzZC5jb20v" title=\"Away3D\" target=\"_blank\">Away3D</a><br />
<a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3Nub29rLmNhL2FyY2hpdmVzL29waW5pb24vYWRvYmUtaHRtbDUtY2FudmFz" title=\"Snook on HTML5 and Adobe\" target=\"_blank\">Snook on HTML5 and Adobe</a></p>
<p>Some Useful/Interesting JavaScript Links:<br />
<a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5hcmd1aW5nd2l0aG15c2VsZi5jb20vYXJjaGl2ZXMvMTI0LXJheWNhc3Rlci12ZXJzaW9uLTU=" title=\"RayCaster\" target=\"_blank\">Javascript RayCaster</a><br />
<a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5oeXBlci1tZXRyaXguY29tLyNCdXJzdA==" title=\"Burst Engine\" target=\"_blank\">Burst Engine for SVG in JavaScript</a><br />
<a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5jM2RsLm9yZy8=" title=\"Canvas 3D\" target=\"_blank\">Canvas 3D</a><br />
<a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy53eHMuY2EvanMzZC8jZGVtb3M=" title=\"JS3D\" target=\"_blank\">JS3D library</a><br />
<a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2FqYXhpYW4uY29tL2FyY2hpdmVzLzNkY3NzP3V0bV9zb3VyY2U9ZmVlZGJ1cm5lciYjMDM4O3V0bV9tZWRpdW09ZmVlZCYjMDM4O3V0bV9jYW1wYWlnbj1GZWVkJTNBK2FqYXhpYW4rJTI4QWpheGlhbitCbG9nJTI5" title=\"Parallax in CSS\" target=\"_blank\">Parallax in CSS</a><br />
<a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5yb3plbmdhaW4uY29tL2Jsb2cvMjAxMC8wMi8wNC9ibGVuZGVyLXRvLXdlYmdsLWphdmFzY3JpcHQtZXhwb3J0ZXIv" title=\"WebGL\" target=\"_blank\">WebGL Example</a></p>
 <img src="http://i-create.org/wp-content/plugins/feed-statistics.php?view=1&post_id=765" width="1" height="1" style="display: none;" /><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fi-create.org%2F2010%2F02%2F07%2Fjquery-centerit%2F&amp;linkname=jQuery%20CenterIT"><img src="http://i-create.org/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://i-create.org/2010/02/07/jquery-centerit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>404 Errors Hyped With PaperVision3d pt. 2</title>
		<link>http://i-create.org/2010/02/07/404-errors-hyped-with-papervision3d-pt-2/</link>
		<comments>http://i-create.org/2010/02/07/404-errors-hyped-with-papervision3d-pt-2/#comments</comments>
		<pubDate>Sun, 07 Feb 2010 20:14:32 +0000</pubDate>
		<dc:creator>Brendon Smith</dc:creator>
				<category><![CDATA[3d]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[MashUp]]></category>
		<category><![CDATA[i-create]]></category>
		<category><![CDATA[Adobe Flash]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[Computer programming]]></category>
		<category><![CDATA[Experiment]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://i-create.org/?p=761</guid>
		<description><![CDATA[Capture URL for search with JavaScript and Pass it to Flash Search Google from URL parsing Use of Random Range Create an Array of Spheres that holds the Google results Apply the title field to a Text3D and add that as a child to the Sphere Apply an Event to the Sphere to navigate to [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3NlYWNsb3VkOS5vcmcvUHJvY2Vzc2luZy5vcmc=" title=\"404 Error MashUp\" target=\"_blank\"><br />
<img src="http://i-create.org/img404e.jpg" title="404 Error MashUp" /></a></p>
<ol>
<li>Capture URL for search with JavaScript and Pass it to Flash</li>
<li>Search Google from URL parsing</li>
<li>Use of Random Range</li>
<li>Create an Array of Spheres that holds the Google results</li>
<li>Apply the title field to a Text3D and add that as a child to the Sphere</li>
<li>Apply an Event to the Sphere to navigate to the Google result.</li>
<li>How to trace out events from flash to Firebug</li>
</ol>
<p>This tutorial uses the following libraries of code:<br />
<a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2h5cGUuam9zaHVhZGF2aXMuY29t" title=\"Hype\" target=\"_blank\">Hype</a><br />
<a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2Jsb2cucGFwZXJ2aXNpb24zZC5vcmcv" title=\"PaperVision3d\" target=\"_blank\">PaperVision3d</a><br />
<a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2NvZGUuZ29vZ2xlLmNvbS9wL2dvb2dsZWFzM2FwaS8=" title=\"googleas3api\" target=\"_blank\">googleas3api</a></p>
<p>I chose to omit the parallax effect.  You can find an excellent example of the parallax effect on <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2dvdG9hbmRsZWFybi5jb20=" title=\"parallax effect\" target=\"_blank\">gotoandlearn.com</a>, <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5uZXRtYWcuY28udWsvemluZS9mbGFzaC0xL3RoZS1hcnQtb2YtcGFyYWxsYXgtc2Nyb2xsaW5n" title=\".Net Paralax Effect\" target=\"_blank\">.Net</a> , and <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=IGh0dHA6Ly93d3cud2ViZGVzaWduZXJtYWcuY28udWsvdHV0b3JpYWwtZmlsZXMvaXNzdWUtMTY1LXR1dG9yaWFsLWZpbGVzLw==" title=\"web designer Paralax Effect\" target=\"_blank\">web designer magazine</a>.  I might modify this swf later to have youtube results and render them as planes.   If you go to seacloud9.org and look for a page that you know is not on that web server it  will serve up google results and display them in three dimensions randomly.  This page is distracting on purpose but It was kind of fun to make.  You can go to the page results by clicking on the sphere.  You can move the viewport of the search results by moving the sliders. </p>
<p>JavaScript to retrieve the url location and parse it:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">    <span style="color: #003366; font-weight: bold;">var</span> gResult<span style="color: #339933;">;</span>
    <span style="color: #003366; font-weight: bold;">var</span> gResultL<span style="color: #339933;">;</span>
    <span style="color: #003366; font-weight: bold;">function</span> getQueryString<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #003366; font-weight: bold;">var</span> qString <span style="color: #339933;">=</span> window.<span style="color: #660066;">location</span><span style="color: #339933;">;</span>
    myReg  <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> RegExp<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;http://seacloud9.org/&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #003366; font-weight: bold;">var</span> url <span style="color: #339933;">=</span> qString.<span style="color: #660066;">href</span>.<span style="color: #660066;">replace</span><span style="color: #009900;">&#40;</span>myReg<span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000066; font-weight: bold;">return</span> url<span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #003366; font-weight: bold;">function</span> googleResultArray<span style="color: #009900;">&#40;</span>googleResult<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        gResult <span style="color: #339933;">=</span> googleResult<span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #003366; font-weight: bold;">function</span> getGoogleTitle<span style="color: #009900;">&#40;</span>titleNum<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #000066; font-weight: bold;">return</span> gResult<span style="color: #009900;">&#91;</span>titleNum<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span></pre></div></div>

<p>ActionScript 3 Code behind for SWF all Google Search code and Debugging</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">package <span style="color: #66cc66;">&#123;</span>
    <span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #66cc66;">*</span>;
    <span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #66cc66;">*</span>;
    <span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #006600;">Event</span>;
    <span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">filters</span>.<span style="color: #006600;">BitmapFilterQuality</span>;
    <span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">filters</span>.<span style="color: #006600;">BlurFilter</span>;
    <span style="color: #0066CC;">import</span> fl.<span style="color: #006600;">transitions</span>.<span style="color: #66cc66;">*</span>;
    <span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">media</span>.<span style="color: #0066CC;">Sound</span>;
    <span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">net</span>.<span style="color: #006600;">URLLoader</span>;
    <span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">net</span>.<span style="color: #006600;">URLRequest</span>;
    <span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">net</span>.<span style="color: #006600;">URLRequestMethod</span>;
    <span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">net</span>.<span style="color: #006600;">navigateToURL</span>;
    <span style="color: #0066CC;">import</span> org.<span style="color: #006600;">papervision3d</span>.<span style="color: #006600;">cameras</span>.<span style="color: #006600;">Camera3D</span>;
    <span style="color: #0066CC;">import</span> org.<span style="color: #006600;">papervision3d</span>.<span style="color: #006600;">objects</span>.<span style="color: #006600;">primitives</span>.<span style="color: #006600;">Plane</span>;
    <span style="color: #0066CC;">import</span> org.<span style="color: #006600;">papervision3d</span>.<span style="color: #006600;">objects</span>.<span style="color: #006600;">primitives</span>.<span style="color: #006600;">Sphere</span>;
    <span style="color: #0066CC;">import</span> org.<span style="color: #006600;">papervision3d</span>.<span style="color: #006600;">render</span>.<span style="color: #006600;">BasicRenderEngine</span>;
    <span style="color: #0066CC;">import</span> org.<span style="color: #006600;">papervision3d</span>.<span style="color: #006600;">scenes</span>.<span style="color: #006600;">Scene3D</span>;
    <span style="color: #0066CC;">import</span> org.<span style="color: #006600;">papervision3d</span>.<span style="color: #006600;">view</span>.<span style="color: #006600;">Viewport3D</span>;
    <span style="color: #0066CC;">import</span> org.<span style="color: #006600;">papervision3d</span>.<span style="color: #006600;">typography</span>.<span style="color: #006600;">Font3D</span>;
    <span style="color: #0066CC;">import</span> org.<span style="color: #006600;">papervision3d</span>.<span style="color: #006600;">typography</span>.<span style="color: #006600;">Text3D</span>;
    <span style="color: #0066CC;">import</span> org.<span style="color: #006600;">papervision3d</span>.<span style="color: #006600;">materials</span>.<span style="color: #006600;">BitmapFileMaterial</span>;
    <span style="color: #0066CC;">import</span> org.<span style="color: #006600;">papervision3d</span>.<span style="color: #006600;">materials</span>.<span style="color: #006600;">special</span>.<span style="color: #006600;">Letter3DMaterial</span>;
    <span style="color: #0066CC;">import</span> org.<span style="color: #006600;">papervision3d</span>.<span style="color: #006600;">typography</span>.<span style="color: #006600;">fonts</span>.<span style="color: #006600;">HelveticaBold</span>;
    <span style="color: #0066CC;">import</span> org.<span style="color: #006600;">papervision3d</span>.<span style="color: #006600;">materials</span>.<span style="color: #006600;">MovieMaterial</span>;
    <span style="color: #0066CC;">import</span> org.<span style="color: #006600;">papervision3d</span>.<span style="color: #006600;">materials</span>.<span style="color: #66cc66;">*</span>;
    <span style="color: #0066CC;">import</span> org.<span style="color: #006600;">papervision3d</span>.<span style="color: #006600;">events</span>.<span style="color: #006600;">InteractiveScene3DEvent</span>;
    <span style="color: #0066CC;">import</span> hype.<span style="color: #006600;">framework</span>.<span style="color: #006600;">core</span>.<span style="color: #006600;">TimeType</span>;
    <span style="color: #0066CC;">import</span> hype.<span style="color: #006600;">framework</span>.<span style="color: #006600;">rhythm</span>.<span style="color: #006600;">SimpleRhythm</span>;
    <span style="color: #0066CC;">import</span> hype.<span style="color: #006600;">framework</span>.<span style="color: #0066CC;">sound</span>.<span style="color: #006600;">SoundAnalyzer</span>;
    <span style="color: #0066CC;">import</span> org.<span style="color: #006600;">papervision3d</span>.<span style="color: #006600;">lights</span>.<span style="color: #006600;">PointLight3D</span>;
    <span style="color: #0066CC;">import</span> org.<span style="color: #006600;">papervision3d</span>.<span style="color: #006600;">materials</span>.<span style="color: #006600;">shadematerials</span>.<span style="color: #006600;">CellMaterial</span>;
    <span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">external</span>.<span style="color: #006600;">ExternalInterface</span>;
    <span style="color: #0066CC;">import</span> be.<span style="color: #006600;">boulevart</span>.<span style="color: #006600;">google</span>.<span style="color: #006600;">events</span>.<span style="color: #66cc66;">*</span>;
    <span style="color: #0066CC;">import</span>     be.<span style="color: #006600;">boulevart</span>.<span style="color: #006600;">google</span>.<span style="color: #006600;">ajaxapi</span>.<span style="color: #006600;">search</span>.<span style="color: #006600;">web</span>.<span style="color: #66cc66;">*</span>;
    <span style="color: #0066CC;">import</span>     be.<span style="color: #006600;">boulevart</span>.<span style="color: #006600;">google</span>.<span style="color: #006600;">ajaxapi</span>.<span style="color: #006600;">search</span>.<span style="color: #006600;">web</span>.<span style="color: #0066CC;">data</span>.<span style="color: #66cc66;">*</span>;
    <span style="color: #0066CC;">import</span>     be.<span style="color: #006600;">boulevart</span>.<span style="color: #006600;">google</span>.<span style="color: #006600;">ajaxapi</span>.<span style="color: #006600;">search</span>.<span style="color: #66cc66;">*</span>;
&nbsp;
&nbsp;
    <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> e404 <span style="color: #0066CC;">extends</span> <span style="color: #0066CC;">MovieClip</span> <span style="color: #66cc66;">&#123;</span>
        <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> viewport:Viewport3D;
        <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> scene:Scene3D;
        <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">camera</span>:Camera3D;
        <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> viewport2:Viewport3D;
        <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> scene2:Scene3D;
        <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> camera2:Camera3D;
        <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> plane:Plane;
        <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> plane2:Plane;
        <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> plane3:Plane;
        <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> sphere:Sphere;
        <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> font3d:Font3D;
        <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> text3d:Text3D;
        <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> fontMat:Letter3DMaterial;
        <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> cell:CellMaterial;
        <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> sphereArr:<span style="color: #0066CC;">Array</span>;
        <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> light:PointLight3D;
        <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> renderer:BasicRenderEngine;
        <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> renderer2:BasicRenderEngine;
        <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> googleTitle:<span style="color: #0066CC;">Array</span> = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">Array</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
        <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> googleLink:<span style="color: #0066CC;">Array</span> = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">Array</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
        <span style="color: #0066CC;">public</span> <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>;
        <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> googURL:URLRequest;
&nbsp;
&nbsp;
        <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> e404<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
            addEventListener<span style="color: #66cc66;">&#40;</span> Event.<span style="color: #006600;">ENTER_FRAME</span>, e404Go <span style="color: #66cc66;">&#41;</span>;
&nbsp;
        <span style="color: #66cc66;">&#125;</span>
        <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: #000000; font-weight: bold;">var</span> resultObject:GoogleSearchResult=<span style="color: #0066CC;">e</span>.<span style="color: #0066CC;">data</span> as GoogleSearchResult;
            ExternalInterface.<span style="color: #0066CC;">call</span><span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">&quot;console.log&quot;</span> ,<span style="color: #ff0000;">&quot;Estimated Number of Results: &quot;</span>+resultObject.<span style="color: #006600;">estimatedNumResults</span><span style="color: #66cc66;">&#41;</span>;
            ExternalInterface.<span style="color: #0066CC;">call</span><span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">&quot;console.log&quot;</span> ,<span style="color: #ff0000;">&quot;Current page index: &quot;</span>+resultObject.<span style="color: #006600;">currentPageIndex</span><span style="color: #66cc66;">&#41;</span>;
            ExternalInterface.<span style="color: #0066CC;">call</span><span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">&quot;console.log&quot;</span> ,<span style="color: #ff0000;">&quot;Number of pages: &quot;</span>+resultObject.<span style="color: #006600;">numPages</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
            <span style="color: #b1b100;">for</span> each <span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> result:GoogleWebItem <span style="color: #b1b100;">in</span> resultObject.<span style="color: #006600;">results</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
                googleTitle.<span style="color: #0066CC;">push</span><span style="color: #66cc66;">&#40;</span>result.<span style="color: #006600;">title</span><span style="color: #66cc66;">&#41;</span>;
                googURL = <span style="color: #000000; font-weight: bold;">new</span> URLRequest <span style="color: #66cc66;">&#40;</span>result.<span style="color: #0066CC;">url</span><span style="color: #66cc66;">&#41;</span>;
                googleLink.<span style="color: #0066CC;">push</span><span style="color: #66cc66;">&#40;</span>googURL<span style="color: #66cc66;">&#41;</span>;
                ExternalInterface.<span style="color: #0066CC;">call</span><span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">&quot;console.log&quot;</span> ,<span style="color: #ff0000;">&quot;link:&quot;</span>+result.<span style="color: #0066CC;">url</span>+<span style="color: #ff0000;">&quot;title:&quot;</span>+result.<span style="color: #006600;">title</span> <span style="color: #66cc66;">&#41;</span>;
            <span style="color: #66cc66;">&#125;</span>
&nbsp;
            ExternalInterface.<span style="color: #0066CC;">call</span><span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">&quot;googleResultArray&quot;</span> , googleTitle <span style="color: #66cc66;">&#41;</span>;
            <span style="color: #808080; font-style: italic;">//build 3d world now that we have our google search!</span>
            init3D<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
            createSearch<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
            addEventListeners<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
        <span style="color: #66cc66;">&#125;</span>
&nbsp;
        <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> onAPIError<span style="color: #66cc66;">&#40;</span>evt:GoogleAPIErrorEvent<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;An API error has occured: &quot;</span> + evt.<span style="color: #006600;">responseDetails</span>, <span style="color: #ff0000;">&quot;responseStatus was: &quot;</span> + evt.<span style="color: #006600;">responseStatus</span><span style="color: #66cc66;">&#41;</span>;
        <span style="color: #66cc66;">&#125;</span>
&nbsp;
        <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> e404Go<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
            removeEventListener<span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">ENTER_FRAME</span>,e404Go <span style="color: #66cc66;">&#41;</span>;
            <span style="color: #808080; font-style: italic;">// Create the container Sprite</span>
            <span style="color: #0066CC;">stage</span>.<span style="color: #0066CC;">scaleMode</span>=StageScaleMode.<span style="color: #006600;">NO_SCALE</span>;
            <span style="color: #0066CC;">stage</span>.<span style="color: #0066CC;">align</span>=StageAlign.<span style="color: #006600;">TOP_LEFT</span>;
            <span style="color: #808080; font-style: italic;">//this javascript function returns the query string from the window location</span>
            googleWebSearch.<span style="color: #006600;">search</span><span style="color: #66cc66;">&#40;</span>ExternalInterface.<span style="color: #0066CC;">call</span><span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">&quot;getQueryString&quot;</span> <span style="color: #66cc66;">&#41;</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #ff0000;">&quot;english&quot;</span><span style="color: #66cc66;">&#41;</span>;
            googleWebSearch.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>GoogleAPIErrorEvent.<span style="color: #006600;">API_ERROR</span>,onAPIError<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: #66cc66;">&#125;</span>
&nbsp;
        <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> init3D<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
            <span style="color: #808080; font-style: italic;">// VIEWPORT</span>
            viewport=<span style="color: #000000; font-weight: bold;">new</span> Viewport3D<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #000000; font-weight: bold;">true</span>,<span style="color: #000000; font-weight: bold;">false</span><span style="color: #66cc66;">&#41;</span>;
            viewport2=<span style="color: #000000; font-weight: bold;">new</span> Viewport3D<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">stage</span>.<span style="color: #0066CC;">width</span>,<span style="color: #0066CC;">stage</span>.<span style="color: #0066CC;">height</span>,<span style="color: #000000; font-weight: bold;">true</span>,<span style="color: #000000; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span>;
            addChild<span style="color: #66cc66;">&#40;</span> viewport <span style="color: #66cc66;">&#41;</span>;
            addChild<span style="color: #66cc66;">&#40;</span> viewport2 <span style="color: #66cc66;">&#41;</span>;
            <span style="color: #808080; font-style: italic;">//</span>
            <span style="color: #808080; font-style: italic;">// RENDERER</span>
            renderer = <span style="color: #000000; font-weight: bold;">new</span> BasicRenderEngine<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
            renderer2 = <span style="color: #000000; font-weight: bold;">new</span> BasicRenderEngine<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
            <span style="color: #808080; font-style: italic;">//</span>
            <span style="color: #808080; font-style: italic;">// SCENE</span>
            scene = <span style="color: #000000; font-weight: bold;">new</span> Scene3D<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
            scene2 = <span style="color: #000000; font-weight: bold;">new</span> Scene3D<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
            <span style="color: #808080; font-style: italic;">//</span>
            <span style="color: #808080; font-style: italic;">// CAMERA</span>
            <span style="color: #0066CC;">camera</span> = <span style="color: #000000; font-weight: bold;">new</span> Camera3D<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
            <span style="color: #0066CC;">camera</span>.<span style="color: #006600;">zoom</span>=<span style="color: #cc66cc;">11</span>;
            <span style="color: #0066CC;">camera</span>.<span style="color: #006600;">focus</span>=<span style="color: #cc66cc;">100</span>;
&nbsp;
            camera2 = <span style="color: #000000; font-weight: bold;">new</span> Camera3D<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
            camera2.<span style="color: #006600;">zoom</span>=<span style="color: #cc66cc;">11</span>;
            camera2.<span style="color: #006600;">focus</span>=<span style="color: #cc66cc;">100</span>;
        <span style="color: #66cc66;">&#125;</span>
&nbsp;
        <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> createSearch<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
            <span style="color: #808080; font-style: italic;">// Set some colors so we can see if loading is still happening,</span>
            <span style="color: #808080; font-style: italic;">// or if it failed</span>
            BitmapFileMaterial.<span style="color: #006600;">LOADING_COLOR</span>=0x000000;
            BitmapFileMaterial.<span style="color: #006600;">ERROR_COLOR</span>=0xFF0000;
            <span style="color: #808080; font-style: italic;">//</span>
            <span style="color: #000000; font-weight: bold;">var</span> material:BitmapFileMaterial=<span style="color: #000000; font-weight: bold;">new</span> BitmapFileMaterial<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;404e.png&quot;</span><span style="color: #66cc66;">&#41;</span>;
            material.<span style="color: #006600;">doubleSided</span>=<span style="color: #000000; font-weight: bold;">true</span>;
            <span style="color: #000000; font-weight: bold;">var</span> material2:BitmapFileMaterial=<span style="color: #000000; font-weight: bold;">new</span> BitmapFileMaterial<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;404e2.png&quot;</span><span style="color: #66cc66;">&#41;</span>;
            material2.<span style="color: #006600;">doubleSided</span>=<span style="color: #000000; font-weight: bold;">true</span>;
            <span style="color: #000000; font-weight: bold;">var</span> material3:ColorMaterial=<span style="color: #000000; font-weight: bold;">new</span> ColorMaterial<span style="color: #66cc66;">&#40;</span>0xFC0606,.3<span style="color: #66cc66;">&#41;</span>;
            material3.<span style="color: #006600;">doubleSided</span>=<span style="color: #000000; font-weight: bold;">true</span>;
            light=<span style="color: #000000; font-weight: bold;">new</span> PointLight3D<span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span>;
            light.<span style="color: #006600;">z</span>=<span style="color: #cc66cc;">0</span>;
            light.<span style="color: #006600;">y</span>=randomRange<span style="color: #66cc66;">&#40;</span>-<span style="color: #cc66cc;">30</span>,<span style="color: #cc66cc;">280</span><span style="color: #66cc66;">&#41;</span>;
            light.<span style="color: #006600;">x</span>=randomRange<span style="color: #66cc66;">&#40;</span>-<span style="color: #cc66cc;">350</span>,<span style="color: #cc66cc;">500</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
&nbsp;
            <span style="color: #808080; font-style: italic;">//</span>
            plane=<span style="color: #000000; font-weight: bold;">new</span> Plane<span style="color: #66cc66;">&#40;</span>material,<span style="color: #cc66cc;">300</span>,<span style="color: #cc66cc;">100</span>,<span style="color: #cc66cc;">10</span>,<span style="color: #cc66cc;">10</span><span style="color: #66cc66;">&#41;</span>;
            plane.<span style="color: #006600;">x</span>=-<span style="color: #cc66cc;">350</span>;
            plane.<span style="color: #006600;">y</span>=<span style="color: #cc66cc;">265</span>;
&nbsp;
            <span style="color: #808080; font-style: italic;">// Second ViewPort objects sphere and text from google</span>
            sphereArr = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">Array</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
            <span style="color: #b1b100;">for</span> <span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> i:<span style="color: #0066CC;">int</span> = <span style="color: #cc66cc;">0</span>; i <span style="color: #66cc66;">&lt;</span> googleTitle.<span style="color: #0066CC;">length</span>; i++<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
                <span style="color: #000000; font-weight: bold;">var</span> myPattern:RegExp = <span style="color: #66cc66;">/&lt;</span>b<span style="color: #66cc66;">&gt;/</span>g;
                <span style="color: #000000; font-weight: bold;">var</span> myPattern2:RegExp = <span style="color: #66cc66;">/&lt;</span>\<span style="color: #66cc66;">/</span>b<span style="color: #66cc66;">&gt;/</span>g;
                <span style="color: #000000; font-weight: bold;">var</span> googSearch:<span style="color: #0066CC;">String</span> = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">String</span><span style="color: #66cc66;">&#40;</span>googleTitle<span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span>.<span style="color: #0066CC;">toString</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
                googSearch = googSearch.<span style="color: #006600;">replace</span><span style="color: #66cc66;">&#40;</span>myPattern, <span style="color: #ff0000;">&quot;&quot;</span><span style="color: #66cc66;">&#41;</span>;
                googSearch = googSearch.<span style="color: #006600;">replace</span><span style="color: #66cc66;">&#40;</span>myPattern2, <span style="color: #ff0000;">&quot;&quot;</span><span style="color: #66cc66;">&#41;</span>;
                sphere=<span style="color: #000000; font-weight: bold;">new</span> Sphere<span style="color: #66cc66;">&#40;</span>buildCell<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>,randomRange<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">10</span>,<span style="color: #cc66cc;">100</span><span style="color: #66cc66;">&#41;</span>,randomRange<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">5</span>,<span style="color: #cc66cc;">20</span><span style="color: #66cc66;">&#41;</span>,<span style="color: #cc66cc;">10</span><span style="color: #66cc66;">&#41;</span>;
                sphere.<span style="color: #006600;">x</span>=randomRange<span style="color: #66cc66;">&#40;</span>-<span style="color: #cc66cc;">500</span>,<span style="color: #cc66cc;">500</span><span style="color: #66cc66;">&#41;</span>;
                sphere.<span style="color: #006600;">y</span>=randomRange<span style="color: #66cc66;">&#40;</span>-<span style="color: #cc66cc;">500</span>,<span style="color: #cc66cc;">500</span><span style="color: #66cc66;">&#41;</span>;
                sphere.<span style="color: #006600;">z</span>=randomRange<span style="color: #66cc66;">&#40;</span>-<span style="color: #cc66cc;">500</span>,<span style="color: #cc66cc;">500</span><span style="color: #66cc66;">&#41;</span>;
                <span style="color: #0066CC;">try</span><span style="color: #66cc66;">&#123;</span>
                <span style="color: #000000; font-weight: bold;">var</span> colorPoolCell:<span style="color: #0066CC;">Array</span> = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">Array</span><span style="color: #66cc66;">&#40;</span>0x9F3F11, 0xFC0606, 0x9FC1BE, 0x787D29, 0xE0D4BA, 0x911F15, 0xBFCDF2, 0xF0EEF1<span style="color: #66cc66;">&#41;</span>;
                <span style="color: #000000; font-weight: bold;">var</span> colorID:<span style="color: #0066CC;">int</span> = randomRange<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">7</span>, <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span>;   
                fontMat = <span style="color: #000000; font-weight: bold;">new</span> Letter3DMaterial<span style="color: #66cc66;">&#40;</span>colorPoolCell<span style="color: #66cc66;">&#91;</span>colorID<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;
                font3d = <span style="color: #000000; font-weight: bold;">new</span> HelveticaBold<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
                text3d = <span style="color: #000000; font-weight: bold;">new</span> Text3D<span style="color: #66cc66;">&#40;</span>googSearch, font3d,  fontMat<span style="color: #66cc66;">&#41;</span>;
                text3d.<span style="color: #006600;">x</span> = sphere.<span style="color: #006600;">x</span> + googSearch.<span style="color: #0066CC;">length</span> + <span style="color: #cc66cc;">10</span>;
                text3d.<span style="color: #006600;">y</span> = sphere.<span style="color: #006600;">y</span> + <span style="color: #cc66cc;">10</span>;
                <span style="color: #808080; font-style: italic;">//text3d.z = sphere.z + 10;</span>
                sphere.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span>text3d<span style="color: #66cc66;">&#41;</span>;
                sphere.<span style="color: #006600;">id</span> = i;
                scene2.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span> sphere <span style="color: #66cc66;">&#41;</span>;
                sphereArr.<span style="color: #0066CC;">push</span><span style="color: #66cc66;">&#40;</span>sphere<span style="color: #66cc66;">&#41;</span>;
                <span style="color: #66cc66;">&#125;</span>
                <span style="color: #0066CC;">catch</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:<span style="color: #0066CC;">Error</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
                    <span style="color: #808080; font-style: italic;">// Sometimes the google title font3D will fail but we can catch it so it doesn't</span>
                    <span style="color: #808080; font-style: italic;">// have a nasty flash epic fail warning..</span>
                    ExternalInterface.<span style="color: #0066CC;">call</span><span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">&quot;console.log&quot;</span> , <span style="color: #ff0000;">&quot;Error Reached = &quot;</span> + <span style="color: #0066CC;">e</span><span style="color: #66cc66;">&#41;</span>;
                <span style="color: #66cc66;">&#125;</span>
&nbsp;
&nbsp;
&nbsp;
            <span style="color: #66cc66;">&#125;</span>
            <span style="color: #808080; font-style: italic;">//create the 3D planes for the first ViewPort</span>
&nbsp;
            plane2=<span style="color: #000000; font-weight: bold;">new</span> Plane<span style="color: #66cc66;">&#40;</span>material2,<span style="color: #cc66cc;">300</span>,<span style="color: #cc66cc;">100</span>,<span style="color: #cc66cc;">10</span>,<span style="color: #cc66cc;">10</span><span style="color: #66cc66;">&#41;</span>;
            plane2.<span style="color: #006600;">x</span>=-<span style="color: #cc66cc;">350</span>;
            plane2.<span style="color: #006600;">y</span>=<span style="color: #cc66cc;">265</span>;
            plane2.<span style="color: #006600;">z</span>=-<span style="color: #cc66cc;">60</span>;
            plane3=<span style="color: #000000; font-weight: bold;">new</span> Plane<span style="color: #66cc66;">&#40;</span>material3,<span style="color: #cc66cc;">800</span>,<span style="color: #cc66cc;">150</span>,<span style="color: #cc66cc;">10</span>,<span style="color: #cc66cc;">10</span><span style="color: #66cc66;">&#41;</span>;
            plane3.<span style="color: #006600;">x</span>=-<span style="color: #cc66cc;">350</span>;
            plane3.<span style="color: #006600;">y</span>=<span style="color: #cc66cc;">285</span>;
            plane3.<span style="color: #006600;">z</span>=<span style="color: #cc66cc;">80</span>;
            <span style="color: #808080; font-style: italic;">//</span>
            scene.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span> plane <span style="color: #66cc66;">&#41;</span>;
            scene.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span> plane2 <span style="color: #66cc66;">&#41;</span>;
            scene.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span> plane3 <span style="color: #66cc66;">&#41;</span>;
            addListner<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
        <span style="color: #66cc66;">&#125;</span>
        <span style="color: #000000; font-weight: bold;">function</span> addListner<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><span style="color: #66cc66;">&#123;</span>
            <span style="color: #b1b100;">for</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> i:<span style="color: #0066CC;">int</span> = <span style="color: #cc66cc;">0</span>; i <span style="color: #66cc66;">&lt;</span> sphereArr.<span style="color: #0066CC;">length</span>; i++<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
            <span style="color: #0066CC;">try</span><span style="color: #66cc66;">&#123;</span>
            sphereArr<span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span> InteractiveScene3DEvent.<span style="color: #006600;">OBJECT_PRESS</span>, callLink <span style="color: #66cc66;">&#41;</span>;
            ExternalInterface.<span style="color: #0066CC;">call</span><span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">&quot;console.log&quot;</span> , <span style="color: #ff0000;">&quot;Event Added&quot;</span> + i<span style="color: #66cc66;">&#41;</span>;
            <span style="color: #66cc66;">&#125;</span><span style="color: #0066CC;">catch</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:<span style="color: #0066CC;">Error</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
                ExternalInterface.<span style="color: #0066CC;">call</span><span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">&quot;console.log&quot;</span> , <span style="color: #0066CC;">e</span><span style="color: #66cc66;">&#41;</span>;
            <span style="color: #66cc66;">&#125;</span>
            <span style="color: #66cc66;">&#125;</span>
        <span style="color: #66cc66;">&#125;</span>
        <span style="color: #000000; font-weight: bold;">function</span> callLink<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:InteractiveScene3DEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
            <span style="color: #0066CC;">try</span> <span style="color: #66cc66;">&#123;</span>
                navigateToURL<span style="color: #66cc66;">&#40;</span>googleLink<span style="color: #66cc66;">&#91;</span><span style="color: #0066CC;">e</span>.<span style="color: #0066CC;">target</span>.<span style="color: #006600;">id</span><span style="color: #66cc66;">&#93;</span>, <span style="color: #ff0000;">'_blank'</span><span style="color: #66cc66;">&#41;</span>;
                ExternalInterface.<span style="color: #0066CC;">call</span><span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">&quot;console.log&quot;</span> , <span style="color: #ff0000;">&quot;link Clicked --&quot;</span> + <span style="color: #0066CC;">e</span>.<span style="color: #0066CC;">target</span>.<span style="color: #006600;">id</span> + <span style="color: #ff0000;">&quot;Link Called - &quot;</span> + googleLink<span style="color: #66cc66;">&#91;</span><span style="color: #0066CC;">e</span>.<span style="color: #0066CC;">target</span>.<span style="color: #006600;">id</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;
            <span style="color: #66cc66;">&#125;</span> <span style="color: #0066CC;">catch</span> <span style="color: #66cc66;">&#40;</span>err:<span style="color: #0066CC;">Error</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
                ExternalInterface.<span style="color: #0066CC;">call</span><span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">&quot;console.log&quot;</span> , err + <span style="color: #ff0000;">&quot; id: &quot;</span> + <span style="color: #0066CC;">e</span>.<span style="color: #0066CC;">target</span>.<span style="color: #006600;">id</span> + <span style="color: #ff0000;">&quot;Errored on: &quot;</span> + googleLink<span style="color: #66cc66;">&#91;</span><span style="color: #0066CC;">e</span>.<span style="color: #0066CC;">target</span>.<span style="color: #006600;">id</span><span style="color: #66cc66;">&#93;</span>.<span style="color: #0066CC;">toString</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span>;
            <span style="color: #66cc66;">&#125;</span>
        <span style="color: #66cc66;">&#125;</span>
&nbsp;
&nbsp;
&nbsp;
        <span style="color: #000000; font-weight: bold;">function</span> buildCell<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:CellMaterial <span style="color: #66cc66;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">var</span> colorPoolCell:<span style="color: #0066CC;">Array</span> = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">Array</span><span style="color: #66cc66;">&#40;</span>0x9F3F11, 0xFC0606, 0x9FC1BE, 0x787D29, 0xE0D4BA, 0x911F15, 0xBFCDF2, 0xF0EEF1<span style="color: #66cc66;">&#41;</span>;
            <span style="color: #000000; font-weight: bold;">var</span> colorID:<span style="color: #0066CC;">int</span> = randomRange<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">7</span>, <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span>;
            <span style="color: #000000; font-weight: bold;">var</span> colorID2:<span style="color: #0066CC;">int</span> = randomRange<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">7</span>, <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span>;
            <span style="color: #808080; font-style: italic;">//random color material generation returns cellMaterial</span>
            <span style="color: #808080; font-style: italic;">//cell=new CellMaterial(light,Math.round(Math.random()*0xFFFFFF),Math.round(Math.random()*0xFFFFFF),100);</span>
            cell=<span style="color: #000000; font-weight: bold;">new</span> CellMaterial<span style="color: #66cc66;">&#40;</span>light,colorPoolCell<span style="color: #66cc66;">&#91;</span>colorID<span style="color: #66cc66;">&#93;</span>,colorPoolCell<span style="color: #66cc66;">&#91;</span>colorID2<span style="color: #66cc66;">&#93;</span>,<span style="color: #cc66cc;">100</span><span style="color: #66cc66;">&#41;</span>;
            cell.<span style="color: #006600;">interactive</span>=<span style="color: #000000; font-weight: bold;">true</span>;
            <span style="color: #b1b100;">return</span> cell;
        <span style="color: #66cc66;">&#125;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">function</span> randomRange<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">max</span>:<span style="color: #0066CC;">Number</span>, <span style="color: #0066CC;">min</span>:<span style="color: #0066CC;">Number</span> = <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">Number</span> <span style="color: #66cc66;">&#123;</span>
            <span style="color: #b1b100;">return</span> <span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">random</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">*</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">max</span> - <span style="color: #0066CC;">min</span><span style="color: #66cc66;">&#41;</span> + <span style="color: #0066CC;">min</span>;
        <span style="color: #66cc66;">&#125;</span>
&nbsp;
&nbsp;
        <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> addEventListeners<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
            addEventListener<span style="color: #66cc66;">&#40;</span> Event.<span style="color: #006600;">ENTER_FRAME</span>, __onEnterFrame <span style="color: #66cc66;">&#41;</span>;
        <span style="color: #66cc66;">&#125;</span>
&nbsp;
        <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> removeEventListeners<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
            removeEventListener<span style="color: #66cc66;">&#40;</span> Event.<span style="color: #006600;">ENTER_FRAME</span>, __onEnterFrame <span style="color: #66cc66;">&#41;</span>;
        <span style="color: #66cc66;">&#125;</span>
&nbsp;
        <span style="color: #808080; font-style: italic;">/*===================================================================\\
        ||Listener Functions ||
        \\===================================================================*/</span>
&nbsp;
        <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> __onEnterFrame<span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">e</span>:Event <span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
            <span style="color: #808080; font-style: italic;">//moves the error planes viewort according to mouse position</span>
            plane.<span style="color: #006600;">rotationY</span>=viewport.<span style="color: #006600;">mouseX</span><span style="color: #66cc66;">/</span><span style="color: #cc66cc;">4</span>;
            plane.<span style="color: #006600;">rotationX</span>=viewport.<span style="color: #006600;">mouseY</span><span style="color: #66cc66;">/</span><span style="color: #cc66cc;">4</span>;
            plane2.<span style="color: #006600;">rotationY</span>=viewport.<span style="color: #006600;">mouseX</span><span style="color: #66cc66;">/</span><span style="color: #cc66cc;">4</span>;
            plane2.<span style="color: #006600;">rotationX</span>=viewport.<span style="color: #006600;">mouseY</span><span style="color: #66cc66;">/</span><span style="color: #cc66cc;">4</span>;
            plane3.<span style="color: #006600;">rotationY</span>=viewport.<span style="color: #006600;">mouseX</span><span style="color: #66cc66;">/</span><span style="color: #cc66cc;">4</span>;
            plane3.<span style="color: #006600;">rotationX</span>=viewport.<span style="color: #006600;">mouseY</span><span style="color: #66cc66;">/</span><span style="color: #cc66cc;">4</span>;
            light.<span style="color: #006600;">rotationX</span>=viewport2.<span style="color: #006600;">mouseY</span><span style="color: #66cc66;">/</span><span style="color: #cc66cc;">4</span>;
            light.<span style="color: #006600;">rotationY</span>=viewport2.<span style="color: #006600;">mouseY</span><span style="color: #66cc66;">/</span><span style="color: #cc66cc;">4</span>;
            <span style="color: #808080; font-style: italic;">//</span>
            sldWorld.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;change&quot;</span>, updateWorldAxisValue<span style="color: #66cc66;">&#41;</span>;
            sldZoomCam.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;change&quot;</span>, updateCamerValue<span style="color: #66cc66;">&#41;</span>;
            <span style="color: #0066CC;">this</span>.<span style="color: #006600;">setChildIndex</span><span style="color: #66cc66;">&#40;</span>sldWorld, <span style="color: #0066CC;">this</span>.<span style="color: #006600;">numChildren</span>-<span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>;
            <span style="color: #0066CC;">this</span>.<span style="color: #006600;">setChildIndex</span><span style="color: #66cc66;">&#40;</span>sldZoomCam, <span style="color: #0066CC;">this</span>.<span style="color: #006600;">numChildren</span>-<span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>;
            renderer.<span style="color: #006600;">renderScene</span><span style="color: #66cc66;">&#40;</span> scene, <span style="color: #0066CC;">camera</span>, viewport <span style="color: #66cc66;">&#41;</span>;
            renderer2.<span style="color: #006600;">renderScene</span><span style="color: #66cc66;">&#40;</span> scene2, camera2, viewport2 <span style="color: #66cc66;">&#41;</span>;
        <span style="color: #66cc66;">&#125;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">function</span> updateWorldAxisValue<span style="color: #66cc66;">&#40;</span>argument<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">var</span> sldWorld_value:<span style="color: #0066CC;">Number</span>=<span style="color: #0066CC;">this</span>.<span style="color: #006600;">sldWorld</span>.<span style="color: #006600;">value</span>;
            camera2.<span style="color: #006600;">rotationY</span>=sldWorld_value;
&nbsp;
&nbsp;
        <span style="color: #66cc66;">&#125;</span>
        <span style="color: #000000; font-weight: bold;">function</span> updateCamerValue<span style="color: #66cc66;">&#40;</span>argument<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">var</span> sldZoomCam_value:<span style="color: #0066CC;">Number</span>=<span style="color: #0066CC;">this</span>.<span style="color: #006600;">sldZoomCam</span>.<span style="color: #006600;">value</span>;
            camera2.<span style="color: #006600;">zoom</span>=sldZoomCam_value;
&nbsp;
        <span style="color: #66cc66;">&#125;</span>
    <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>ActionScript3 Timeline Code for Sound Analysis and Image Effects</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">import</span> hype.<span style="color: #006600;">extended</span>.<span style="color: #006600;">behavior</span>.<span style="color: #006600;">FunctionTracker</span>;
<span style="color: #0066CC;">import</span> hype.<span style="color: #006600;">extended</span>.<span style="color: #006600;">behavior</span>.<span style="color: #006600;">Oscillator</span>;
<span style="color: #0066CC;">import</span> hype.<span style="color: #006600;">extended</span>.<span style="color: #0066CC;">color</span>.<span style="color: #006600;">ColorPool</span>;
<span style="color: #0066CC;">import</span> hype.<span style="color: #006600;">extended</span>.<span style="color: #006600;">layout</span>.<span style="color: #006600;">GridLayout</span>;
<span style="color: #0066CC;">import</span> hype.<span style="color: #006600;">framework</span>.<span style="color: #006600;">display</span>.<span style="color: #006600;">BitmapCanvas</span>;
<span style="color: #0066CC;">import</span> hype.<span style="color: #006600;">framework</span>.<span style="color: #0066CC;">sound</span>.<span style="color: #006600;">SoundAnalyzer</span>;
<span style="color: #0066CC;">import</span> hype.<span style="color: #006600;">extended</span>.<span style="color: #006600;">behavior</span>.<span style="color: #006600;">FixedVibration</span>;
<span style="color: #000000; font-weight: bold;">var</span> myWidth = <span style="color: #0066CC;">stage</span>.<span style="color: #006600;">stageWidth</span>;
<span style="color: #000000; font-weight: bold;">var</span> myHeight = <span style="color: #0066CC;">stage</span>.<span style="color: #006600;">stageHeight</span>;
&nbsp;
<span style="color: #000000; font-weight: bold;">var</span> clipCanvas:BitmapCanvas = <span style="color: #000000; font-weight: bold;">new</span> BitmapCanvas<span style="color: #66cc66;">&#40;</span>myWidth, myHeight<span style="color: #66cc66;">&#41;</span>;
addChild<span style="color: #66cc66;">&#40;</span>clipCanvas<span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #000000; font-weight: bold;">var</span> clipContainer:Sprite = <span style="color: #000000; font-weight: bold;">new</span> Sprite<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #000000; font-weight: bold;">var</span> soundAnalyzer:SoundAnalyzer = <span style="color: #000000; font-weight: bold;">new</span> SoundAnalyzer<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
soundAnalyzer.<span style="color: #0066CC;">start</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #000000; font-weight: bold;">var</span> colorPool:ColorPool = <span style="color: #000000; font-weight: bold;">new</span> ColorPool<span style="color: #66cc66;">&#40;</span>
    0x9F3F11, 0xFC0606, 0x9FC1BE, 0x787D29, 0xE0D4BA, 0x911F15, 0xBFCDF2, 0xF0EEF1
<span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">// xStart, yStart, xSpacing, ySpacing, columns</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">var</span> layout:GridLayout = <span style="color: #000000; font-weight: bold;">new</span> GridLayout<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span>, myHeight <span style="color: #66cc66;">/</span> <span style="color: #cc66cc;">2</span>, <span style="color: #cc66cc;">10</span>, <span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">34</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #000000; font-weight: bold;">var</span> numItems:<span style="color: #0066CC;">int</span> = <span style="color: #cc66cc;">64</span>;
<span style="color: #000000; font-weight: bold;">var</span> freq:<span style="color: #0066CC;">int</span> = <span style="color: #cc66cc;">120</span>;
&nbsp;
<span style="color: #b1b100;">for</span> <span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> i:uint = <span style="color: #cc66cc;">0</span>; i <span style="color: #66cc66;">&lt;</span> numItems; ++i<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">var</span> clip:MySquare = <span style="color: #000000; font-weight: bold;">new</span> MySquare<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
    layout.<span style="color: #006600;">applyLayout</span><span style="color: #66cc66;">&#40;</span>clip<span style="color: #66cc66;">&#41;</span>;
    colorPool.<span style="color: #006600;">colorChildren</span><span style="color: #66cc66;">&#40;</span>clip<span style="color: #66cc66;">&#41;</span>;
&nbsp;
    <span style="color: #808080; font-style: italic;">// object, property, soundAnalyzer.getFrequencyRange, [startRange, endRange, min, max]</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">var</span> aTracker:FunctionTracker = <span style="color: #000000; font-weight: bold;">new</span> FunctionTracker<span style="color: #66cc66;">&#40;</span>clip.<span style="color: #006600;">myFill</span>, <span style="color: #ff0000;">&quot;alpha&quot;</span>, soundAnalyzer.<span style="color: #006600;">getFrequencyRange</span>, <span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">*</span><span style="color: #cc66cc;">4</span>, i<span style="color: #66cc66;">*</span><span style="color: #cc66cc;">4</span>+<span style="color: #cc66cc;">4</span>, <span style="color: #cc66cc;">0.25</span>, <span style="color: #cc66cc;">1.0</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;
    <span style="color: #000000; font-weight: bold;">var</span> sTracker:FunctionTracker = <span style="color: #000000; font-weight: bold;">new</span> FunctionTracker<span style="color: #66cc66;">&#40;</span>clip.<span style="color: #006600;">myFill</span>, <span style="color: #ff0000;">&quot;scaleY&quot;</span>, soundAnalyzer.<span style="color: #006600;">getFrequencyRange</span>, <span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">*</span><span style="color: #cc66cc;">4</span>, i<span style="color: #66cc66;">*</span><span style="color: #cc66cc;">4</span>+<span style="color: #cc66cc;">4</span>, <span style="color: #cc66cc;">0.5</span>, <span style="color: #cc66cc;">30.0</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;
    aTracker.<span style="color: #0066CC;">start</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
    sTracker.<span style="color: #0066CC;">start</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
    <span style="color: #808080; font-style: italic;">// target Object, property, waveFunction, frequency, min, max, start value</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">var</span> yOsc:Oscillator = <span style="color: #000000; font-weight: bold;">new</span> Oscillator<span style="color: #66cc66;">&#40;</span>clip, <span style="color: #ff0000;">&quot;y&quot;</span>, Oscillator.<span style="color: #006600;">sineWave</span>, freq, <span style="color: #cc66cc;">60</span>, <span style="color: #cc66cc;">600</span>, i<span style="color: #66cc66;">/</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">180</span><span style="color: #66cc66;">/</span><span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;   
    yOsc.<span style="color: #0066CC;">start</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
    clipContainer.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span>clip<span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
clipCanvas.<span style="color: #006600;">startCapture</span><span style="color: #66cc66;">&#40;</span>clipContainer, <span style="color: #000000; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">sound</span>:<span style="color: #0066CC;">Sound</span> = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">Sound</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #0066CC;">sound</span>.<span style="color: #0066CC;">load</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> URLRequest<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;http://i-create.org/actionscript/404e/shortCircuitE1.mp3&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #0066CC;">sound</span>.<span style="color: #0066CC;">play</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #000000; font-weight: bold;">var</span> aVibration:FixedVibration = <span style="color: #000000; font-weight: bold;">new</span> FixedVibration<span style="color: #66cc66;">&#40;</span>cBagHead, <span style="color: #ff0000;">&quot;alpha&quot;</span>, <span style="color: #cc66cc;">0.9</span>, <span style="color: #cc66cc;">0.1</span>, <span style="color: #cc66cc;">0.0</span>, <span style="color: #cc66cc;">1.0</span>, <span style="color: #000000; font-weight: bold;">false</span><span style="color: #66cc66;">&#41;</span>;
aVibration.<span style="color: #0066CC;">start</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>You find working examples of this 404 error page working at the following location:<br />
<a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3NlYWNsb3VkOS5vcmcvcHJvY2Vzc2luZy5vcmc=" title=\"404 Error\" target=\"_blank\">http://seacloud9.org/Processing.org</a><br />
<a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3NlYWNsb3VkOS5vcmcvQ29udGV4dCBGcmVlIEFydA==" title=\"404 Error\" target=\"_blank\">http://seacloud9.org/Context Free Art</a><br />
<a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3NlYWNsb3VkOS5vcmcvR2VuZXJhdGl2ZSBBcnQ=" title=\"404 Error\" target=\"_blank\">http://seacloud9.org/Generative Art</a></p>
<p>A few articles that are good reads:<br />
<a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3RoZWZsYXNoYmxvZy5jb20vP3A9MTc0Mw==" title =\"Web development will become much more complicated\" target=\"_blank\">Web development will become much more complicated </a><br />
<a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy50ZWNoY3J1bmNoLmNvbS8yMDEwLzAyLzA1L3RoZS1mdXR1cmUtb2Ytd2ViLWNvbnRlbnQtaHRtbDUtZmxhc2gtbW9iaWxlLWFwcHMv" title =\"The Future of Web Content\" target=\"_blank\">The Future of Web Content</a></p>
 <img src="http://i-create.org/wp-content/plugins/feed-statistics.php?view=1&post_id=761" width="1" height="1" style="display: none;" /><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fi-create.org%2F2010%2F02%2F07%2F404-errors-hyped-with-papervision3d-pt-2%2F&amp;linkname=404%20Errors%20Hyped%20With%20PaperVision3d%20pt.%202"><img src="http://i-create.org/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://i-create.org/2010/02/07/404-errors-hyped-with-papervision3d-pt-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://i-create.org/actionscript/404e/shortCircuitE1.mp3" length="157078" type="audio/mpeg" />
		</item>
		<item>
		<title>When Pigs Fly With jQuery</title>
		<link>http://i-create.org/2009/12/08/when-pigs-fly-with-jquery/</link>
		<comments>http://i-create.org/2009/12/08/when-pigs-fly-with-jquery/#comments</comments>
		<pubDate>Wed, 09 Dec 2009 02:37:27 +0000</pubDate>
		<dc:creator>Brendon Smith</dc:creator>
				<category><![CDATA[MashUp]]></category>
		<category><![CDATA[Web 3.0]]></category>
		<category><![CDATA[i-create]]></category>
		<category><![CDATA[Experiment]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[Yahoo Pipes]]></category>

		<guid isPermaLink="false">http://i-create.org/?p=708</guid>
		<description><![CDATA[Here is yet another tutorial. This tutorial demonstrates numerous JQuery methods: Show how to embed a font. How to use offset() on divs to get the divs position to pass to another item. How to use JSON with jQuery. How to pull Twitter Searches How to consume Yahoo Pipes JSON. How to parse content and [...]]]></description>
			<content:encoded><![CDATA[<p>Here is yet another tutorial.  This tutorial demonstrates numerous JQuery methods:</p>
<ol>
<li>Show how to embed a font.</li>
<li>How to use offset() on divs to get the divs position to pass to another item.</li>
<li>How to use JSON with jQuery.</li>
<li>How to pull Twitter Searches</li>
<li>How to consume Yahoo Pipes JSON.</li>
<li>How to parse content and only display a series of Images tags in JSON content.</li>
<li>How to animate using jQuery.</li>
<li>How to export Yahoo Pipes KML and Render.</li>
</ol>
<p><a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2ktY3JlYXRlLm9yZy9KYXZhU2NyaXB0L3NjOU5ld3Mv" title=\"Click here to Launch Finished Project\" target=\"_blank\">Click here to Launch Finished Project</a></p>
<p><a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2ktY3JlYXRlLm9yZy9KYXZhU2NyaXB0L3lhaG9vUGlwZXNKc29uLnppcA==" title=\"Yahoo Pipes and JSON Project Download Code\" target=\"_blank\">Click here to download all associated Code</a></p>
<p><a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2ktY3JlYXRlLm9yZy9KYXZhU2NyaXB0L3NjOU5ld3Mv" title=\"Click here to Launch Finished Project\" target=\"_blank\"><img src="http://i-create.org/JavaScript/sc9News/whenPigsFly.jpg" alt="When Pigs Fly" /> </a></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">&nbsp;
        <span style="color: #003366; font-weight: bold;">var</span> flickrDescription <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Array<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #003366; font-weight: bold;">var</span> arrayTwit <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Array<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #003366; font-weight: bold;">var</span> twitSearch <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Object<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #003366; font-weight: bold;">var</span> map<span style="color: #339933;">;</span>
        <span style="color: #003366; font-weight: bold;">var</span> geoXml<span style="color: #339933;">;</span>
        <span style="color: #003366; font-weight: bold;">function</span> myFeedObject<span style="color: #009900;">&#40;</span>packPipe<span style="color: #339933;">,</span> location<span style="color: #339933;">,</span> type<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">descList</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Array<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">itemList</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;&quot;</span><span style="color: #339933;">;</span>
            <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">type</span> <span style="color: #339933;">=</span> type<span style="color: #339933;">;</span>
            fireUpYahooPipe<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #339933;">,</span> packPipe<span style="color: #339933;">,</span> location<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #003366; font-weight: bold;">function</span> output_feed_items<span style="color: #009900;">&#40;</span>obj<span style="color: #339933;">,</span> json<span style="color: #339933;">,</span> location<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #003366; font-weight: bold;">var</span> heading <span style="color: #339933;">=</span> <span style="color: #3366CC;">'&lt;h3&gt;'</span> <span style="color: #339933;">+</span> json.<span style="color: #660066;">value</span>.<span style="color: #660066;">title</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">'&lt;/h3&gt;'</span><span style="color: #339933;">;</span>
            <span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span>i <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> json.<span style="color: #660066;">count</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>obj.<span style="color: #660066;">type</span> <span style="color: #339933;">==</span> <span style="color: #3366CC;">&quot;generic&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                    obj.<span style="color: #660066;">itemList</span> <span style="color: #339933;">+=</span> make_feed_item<span style="color: #009900;">&#40;</span>obj<span style="color: #339933;">,</span> json.<span style="color: #660066;">value</span>.<span style="color: #660066;">items</span><span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> i<span style="color: #339933;">,</span> location<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</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: #003366; font-weight: bold;">var</span> ypipeImage <span style="color: #339933;">=</span> json.<span style="color: #660066;">value</span>.<span style="color: #660066;">items</span><span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">description</span><span style="color: #339933;">;</span>
                    ypipeImage <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span>ypipeImage<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">find</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'img'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                    <span style="color: #000066; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
                        <span style="color: #003366; font-weight: bold;">var</span> ypipeOBJ <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Object<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                        <span style="color: #003366; font-weight: bold;">var</span> myReg <span style="color: #339933;">=</span> <span style="color: #009966; font-style: italic;">/cdn.c.ooyala.com/</span><span style="color: #339933;">;</span>
                        <span style="color: #003366; font-weight: bold;">var</span> myQuestion <span style="color: #339933;">=</span> ypipeImage<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span>.<span style="color: #660066;">src</span><span style="color: #339933;">;</span>
                        <span style="color: #003366; font-weight: bold;">var</span> myResult <span style="color: #339933;">=</span> myQuestion.<span style="color: #660066;">match</span><span style="color: #009900;">&#40;</span>myReg<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>myResult <span style="color: #339933;">==</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                            ypipeOBJ.<span style="color: #660066;">image</span> <span style="color: #339933;">=</span> ypipeImage<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span>.<span style="color: #660066;">src</span><span style="color: #339933;">;</span>
                            ypipeOBJ.<span style="color: #660066;">linked</span> <span style="color: #339933;">=</span> json.<span style="color: #660066;">value</span>.<span style="color: #660066;">items</span><span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">link</span><span style="color: #339933;">;</span>
                            obj.<span style="color: #660066;">itemList</span> <span style="color: #339933;">+=</span> make_feed_item_images<span style="color: #009900;">&#40;</span>obj<span style="color: #339933;">,</span> ypipeOBJ<span style="color: #339933;">,</span> i<span style="color: #339933;">,</span> location<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                        <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
                            ypipeOBJ.<span style="color: #660066;">image</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">;</span>
                        <span style="color: #009900;">&#125;</span>
                    <span style="color: #009900;">&#125;</span>
                    <span style="color: #000066; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span>err<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                        <span style="color: #006600; font-style: italic;">//console.log(err + &quot;Lame&quot;);</span>
                    <span style="color: #009900;">&#125;</span>
                <span style="color: #009900;">&#125;</span>
                obj.<span style="color: #660066;">descList</span>.<span style="color: #660066;">push</span><span style="color: #009900;">&#40;</span>make_feed_desc<span style="color: #009900;">&#40;</span>obj<span style="color: #339933;">,</span> json.<span style="color: #660066;">value</span>.<span style="color: #660066;">items</span><span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> i<span style="color: #339933;">,</span> location<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
            <span style="color: #000066; font-weight: bold;">return</span> obj.<span style="color: #660066;">itemList</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #003366; font-weight: bold;">function</span> make_feed_item_images<span style="color: #009900;">&#40;</span>obj<span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">item</span><span style="color: #339933;">,</span> item_id<span style="color: #339933;">,</span> location<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #003366; font-weight: bold;">var</span> Quo <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;<span style="color: #000099; font-weight: bold;">\'</span>&quot;</span><span style="color: #339933;">;</span>
            <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #3366CC;">'&lt;div id=&quot;heading-'</span> <span style="color: #339933;">+</span> item_id <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;_&quot;</span> <span style="color: #339933;">+</span> location <span style="color: #339933;">+</span> <span style="color: #3366CC;">'&quot; style=&quot;float:left&quot;&gt;'</span> <span style="color: #339933;">+</span>
      <span style="color: #3366CC;">'&lt;a href=&quot;'</span> <span style="color: #339933;">+</span> <span style="color: #000066; font-weight: bold;">item</span>.<span style="color: #660066;">linked</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">'&quot; target=&quot;_blank&quot; onMouseover=&quot;toggle_feed_desc('</span> <span style="color: #339933;">+</span> location <span style="color: #339933;">+</span> <span style="color: #3366CC;">' ,'</span> <span style="color: #339933;">+</span> item_id <span style="color: #339933;">+</span> <span style="color: #3366CC;">', '</span> <span style="color: #339933;">+</span> Quo <span style="color: #339933;">+</span> location <span style="color: #339933;">+</span> Quo <span style="color: #339933;">+</span> <span style="color: #3366CC;">' );&quot; onMouseout=&quot;goHide('</span> <span style="color: #339933;">+</span> Quo <span style="color: #339933;">+</span> location <span style="color: #339933;">+</span> Quo <span style="color: #339933;">+</span> <span style="color: #3366CC;">' ,'</span> <span style="color: #339933;">+</span> item_id <span style="color: #339933;">+</span> <span style="color: #3366CC;">', '</span> <span style="color: #339933;">+</span> Quo <span style="color: #339933;">+</span> location <span style="color: #339933;">+</span> Quo <span style="color: #339933;">+</span> <span style="color: #3366CC;">' )&quot;&gt;&lt;img src=<span style="color: #000099; font-weight: bold;">\&quot;</span>'</span> <span style="color: #339933;">+</span>
      <span style="color: #000066; font-weight: bold;">item</span>.<span style="color: #660066;">image</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">'<span style="color: #000099; font-weight: bold;">\&quot;</span>/&gt;&lt;/a&gt;&lt;/div&gt;'</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #003366; font-weight: bold;">function</span> make_feed_item<span style="color: #009900;">&#40;</span>obj<span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">item</span><span style="color: #339933;">,</span> item_id<span style="color: #339933;">,</span> location<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #003366; font-weight: bold;">var</span> Quo <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;<span style="color: #000099; font-weight: bold;">\'</span>&quot;</span><span style="color: #339933;">;</span>
            <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #3366CC;">'&lt;li id=&quot;li&quot; class=&quot;ui-state-default&quot;&gt;&lt;h4 id=&quot;heading-'</span> <span style="color: #339933;">+</span> item_id <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;_&quot;</span> <span style="color: #339933;">+</span> location <span style="color: #339933;">+</span> <span style="color: #3366CC;">'&quot;&gt;'</span> <span style="color: #339933;">+</span>
      <span style="color: #3366CC;">'&lt;a href=&quot;'</span> <span style="color: #339933;">+</span> <span style="color: #000066; font-weight: bold;">item</span>.<span style="color: #660066;">link</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">'&quot; target=&quot;_blank&quot; style=&quot;color:#0E1836;&quot; onMouseover=&quot;toggle_feed_desc('</span> <span style="color: #339933;">+</span> location <span style="color: #339933;">+</span> <span style="color: #3366CC;">' ,'</span> <span style="color: #339933;">+</span> item_id <span style="color: #339933;">+</span> <span style="color: #3366CC;">', '</span> <span style="color: #339933;">+</span> Quo <span style="color: #339933;">+</span> location <span style="color: #339933;">+</span> Quo <span style="color: #339933;">+</span> <span style="color: #3366CC;">' );&quot; onMouseout=&quot;goHide('</span> <span style="color: #339933;">+</span> Quo <span style="color: #339933;">+</span> location <span style="color: #339933;">+</span> Quo <span style="color: #339933;">+</span> <span style="color: #3366CC;">' ,'</span> <span style="color: #339933;">+</span> item_id <span style="color: #339933;">+</span> <span style="color: #3366CC;">', '</span> <span style="color: #339933;">+</span> Quo <span style="color: #339933;">+</span> location <span style="color: #339933;">+</span> Quo <span style="color: #339933;">+</span> <span style="color: #3366CC;">' )&quot;&gt;'</span> <span style="color: #339933;">+</span>
      <span style="color: #000066; font-weight: bold;">item</span>.<span style="color: #660066;">title</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">'&lt;/a&gt;&lt;/h4&gt;&lt;/li&gt;'</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #003366; font-weight: bold;">function</span> goHide<span style="color: #009900;">&#40;</span>obj<span style="color: #339933;">,</span> item_id<span style="color: #339933;">,</span> location<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #003366; font-weight: bold;">var</span> myDescription <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;#desc-&quot;</span><span style="color: #339933;">;</span>
            $<span style="color: #009900;">&#40;</span>myDescription <span style="color: #339933;">+</span> item_id <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;_&quot;</span> <span style="color: #339933;">+</span> location<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'display'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'none'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #003366; font-weight: bold;">function</span> make_feed_desc<span style="color: #009900;">&#40;</span>obj<span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">item</span><span style="color: #339933;">,</span> item_id<span style="color: #339933;">,</span> location<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #003366; font-weight: bold;">var</span> desc_info <span style="color: #339933;">=</span> <span style="color: #3366CC;">'&lt;span=&quot;item-submitted&quot;&gt;Published: '</span> <span style="color: #339933;">+</span> <span style="color: #000066; font-weight: bold;">item</span>.<span style="color: #660066;">pubDate</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">'&lt;/span&gt;'</span><span style="color: #339933;">;</span>
            <span style="color: #003366; font-weight: bold;">var</span> desc_info <span style="color: #339933;">=</span> <span style="color: #3366CC;">'&lt;div class=&quot;item-info&quot;&gt;'</span> <span style="color: #339933;">+</span> desc_info <span style="color: #339933;">+</span> <span style="color: #3366CC;">'&lt;/div&gt;'</span><span style="color: #339933;">;</span>
            <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>obj.<span style="color: #660066;">type</span> <span style="color: #339933;">==</span> <span style="color: #3366CC;">&quot;images&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #3366CC;">'&lt;div class=&quot;hoverY&quot; id=&quot;desc-'</span> <span style="color: #339933;">+</span> item_id <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;_&quot;</span> <span style="color: #339933;">+</span> location <span style="color: #339933;">+</span> <span style="color: #3366CC;">'&quot;&gt;'</span> <span style="color: #339933;">+</span>
    desc_info <span style="color: #339933;">+</span> <span style="color: #000066; font-weight: bold;">item</span>.<span style="color: #660066;">description</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">'&lt;/div&gt;'</span><span style="color: #339933;">;</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: #000066; font-weight: bold;">return</span> <span style="color: #3366CC;">'&lt;div class=&quot;hover&quot; id=&quot;desc-'</span> <span style="color: #339933;">+</span> item_id <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;_&quot;</span> <span style="color: #339933;">+</span> location <span style="color: #339933;">+</span> <span style="color: #3366CC;">'&quot;&gt;&lt;div class=&quot;arrowUp&quot;&gt;&lt;div class=&quot;arrowUp2&quot;&gt;&lt;/div&gt;&lt;/div&gt;'</span> <span style="color: #339933;">+</span>
    desc_info <span style="color: #339933;">+</span> <span style="color: #000066; font-weight: bold;">item</span>.<span style="color: #660066;">description</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">'&lt;/div&gt;'</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #003366; font-weight: bold;">function</span> toggle_feed_desc<span style="color: #009900;">&#40;</span>obj<span style="color: #339933;">,</span> item_id<span style="color: #339933;">,</span> location<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #003366; font-weight: bold;">var</span> heading <span style="color: #339933;">=</span> <span style="color: #3366CC;">'#heading-'</span> <span style="color: #339933;">+</span> item_id <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;_&quot;</span> <span style="color: #339933;">+</span> location<span style="color: #339933;">;</span>
            <span style="color: #003366; font-weight: bold;">var</span> desc <span style="color: #339933;">=</span> <span style="color: #3366CC;">'#desc-'</span> <span style="color: #339933;">+</span> item_id <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;_&quot;</span> <span style="color: #339933;">+</span> location<span style="color: #339933;">;</span>
            <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>obj.<span style="color: #660066;">type</span> <span style="color: #339933;">==</span> <span style="color: #3366CC;">&quot;images&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #006600; font-style: italic;">//Pay attention the code below automagically gets the dom x and y to set the item_div x,y :)</span>
                <span style="color: #003366; font-weight: bold;">var</span> x <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span>heading<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">offset</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">left</span><span style="color: #339933;">;</span>
                <span style="color: #003366; font-weight: bold;">var</span> y <span style="color: #339933;">=</span> <span style="color: #CC0000;">80</span><span style="color: #339933;">;</span>
                <span style="color: #003366; font-weight: bold;">var</span> wi <span style="color: #339933;">=</span> x <span style="color: #339933;">/</span> <span style="color: #CC0000;">2</span><span style="color: #339933;">;</span>
                x <span style="color: #339933;">=</span> x <span style="color: #339933;">-</span> wi<span style="color: #339933;">;</span>
                <span style="color: #003366; font-weight: bold;">var</span> item_div <span style="color: #339933;">=</span> obj.<span style="color: #660066;">descList</span><span style="color: #009900;">&#91;</span>item_id<span style="color: #009900;">&#93;</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;_&quot;</span> <span style="color: #339933;">+</span> location<span style="color: #339933;">;</span>
                $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#contentForVideo'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span>obj.<span style="color: #660066;">descList</span><span style="color: #009900;">&#91;</span>item_id<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</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: #009900;">&#40;</span>heading<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">after</span><span style="color: #009900;">&#40;</span>obj.<span style="color: #660066;">descList</span><span style="color: #009900;">&#91;</span>item_id<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #003366; font-weight: bold;">function</span> twitterSearch<span style="color: #009900;">&#40;</span>searchTag<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            $<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</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>
                $.<span style="color: #660066;">getJSON</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;http://search.twitter.com/search.json?q=&quot;</span> <span style="color: #339933;">+</span> searchTag <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;&amp;callback=?&quot;</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>
            $.<span style="color: #660066;">each</span><span style="color: #009900;">&#40;</span>data.<span style="color: #660066;">results</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>i<span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">item</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                twitSeach <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">item</span><span style="color: #339933;">;</span>
                arrayTwit.<span style="color: #660066;">push</span><span style="color: #009900;">&#40;</span>twitSeach<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>
            whenPigsFly<span style="color: #009900;">&#40;</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: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #003366; font-weight: bold;">function</span> fireUpYahooPipe<span style="color: #009900;">&#40;</span>obj<span style="color: #339933;">,</span> packPipe<span style="color: #339933;">,</span> location<span style="color: #339933;">,</span> type<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            $<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</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>
                <span style="color: #003366; font-weight: bold;">var</span> content <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;&quot;</span><span style="color: #339933;">;</span>
                $.<span style="color: #660066;">getJSON</span><span style="color: #009900;">&#40;</span>packPipe<span style="color: #339933;">,</span>
   <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>json<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
       <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>json.<span style="color: #660066;">count</span> <span style="color: #339933;">&gt;</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
           content <span style="color: #339933;">=</span> output_feed_items<span style="color: #009900;">&#40;</span>obj<span style="color: #339933;">,</span> json<span style="color: #339933;">,</span> location<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</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>
               $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#&quot;</span> <span style="color: #339933;">+</span> location<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">sortable</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
               $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#&quot;</span> <span style="color: #339933;">+</span> location<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">disableSelection</span><span style="color: #009900;">&#40;</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: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
           content <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;The request did not return results.&quot;</span><span style="color: #339933;">;</span>
       <span style="color: #009900;">&#125;</span>
       $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#ldr&quot;</span> <span style="color: #339933;">+</span> location<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">remove</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
       $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#&quot;</span> <span style="color: #339933;">+</span> location<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">html</span><span style="color: #009900;">&#40;</span>content<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><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #003366; font-weight: bold;">function</span> myFlickerImages<span style="color: #009900;">&#40;</span>tag<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            $<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</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>
                $.<span style="color: #660066;">getJSON</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;http://api.flickr.com/services/feeds/photos_public.gne?tags=&quot;</span> <span style="color: #339933;">+</span> tag <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;&amp;tagmode=any&amp;format=json&amp;jsoncallback=?&quot;</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>
            <span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span>i <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> <span style="color: #CC0000;">10</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;img id ='img&quot;</span> <span style="color: #339933;">+</span> i <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;' /&gt;&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;src&quot;</span><span style="color: #339933;">,</span> data.<span style="color: #660066;">items</span><span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">media</span>.<span style="color: #660066;">m</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">appendTo</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#public_images&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">wrap</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;a id='aimg&quot;</span> <span style="color: #339933;">+</span> i <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;' href='&quot;</span> <span style="color: #339933;">+</span> data.<span style="color: #660066;">items</span><span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">link</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;' target='_blank' onMouseover='toggle_flickr_desc(&quot;</span> <span style="color: #339933;">+</span> i <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;)' onMouseout='goHideFlickr(&quot;</span> <span style="color: #339933;">+</span> i <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;)'&gt;&lt;/a&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #003366; font-weight: bold;">var</span> myFlickerDes <span style="color: #339933;">=</span> make_flickr_desc<span style="color: #009900;">&#40;</span>data.<span style="color: #660066;">items</span><span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> i<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                flickrDescription.<span style="color: #660066;">push</span><span style="color: #009900;">&#40;</span>myFlickerDes<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</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: #009900;">&#125;</span>
&nbsp;
        <span style="color: #003366; font-weight: bold;">function</span> make_scrollController<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'newsContainer'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">after</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'&lt;div id=&quot;ScrollerContoller&quot; &gt;&lt;span id=&quot;Go&quot; style=&quot;color:#fff; cursor:pointer; font-weight:bold;float:left;&quot; onclick=&quot;goMove(<span style="color: #000099; font-weight: bold;">\'</span>+=210px<span style="color: #000099; font-weight: bold;">\'</span>);&quot;/&amp;uarr;&lt;/span&gt;&lt;span style=&quot;color:#fff; cursor:pointer; font-weight:bold; float:left;&quot; onclick=&quot;goMove(<span style="color: #000099; font-weight: bold;">\'</span>-=210px<span style="color: #000099; font-weight: bold;">\'</span>);&quot;/&gt;&amp;darr;&lt;/span&gt;&lt;/div&gt;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #003366; font-weight: bold;">function</span> make_flickr_desc<span style="color: #009900;">&#40;</span>data<span style="color: #339933;">,</span> i<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #003366; font-weight: bold;">var</span> desc_info <span style="color: #339933;">=</span> <span style="color: #3366CC;">'&lt;span=&quot;item-submitted&quot;&gt;Title: '</span> <span style="color: #339933;">+</span> data.<span style="color: #660066;">title</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">'&lt;/span&gt;'</span><span style="color: #339933;">;</span>
            <span style="color: #003366; font-weight: bold;">var</span> desc_info <span style="color: #339933;">=</span> <span style="color: #3366CC;">'&lt;div class=&quot;item-info&quot;&gt;'</span> <span style="color: #339933;">+</span> desc_info <span style="color: #339933;">+</span> <span style="color: #3366CC;">'&lt;/div&gt;'</span><span style="color: #339933;">;</span>
            <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #3366CC;">'&lt;div class=&quot;hoverF imgNone&quot; id=&quot;desc-'</span> <span style="color: #339933;">+</span> i <span style="color: #339933;">+</span> <span style="color: #3366CC;">'&quot;&gt;&lt;div class=&quot;arrowUp&quot;&gt;&lt;div class=&quot;arrowUp2&quot;&gt; &lt;/div&gt;&lt;/div&gt;'</span> <span style="color: #339933;">+</span>
    desc_info <span style="color: #339933;">+</span> data.<span style="color: #660066;">description</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">'&lt;/div&gt;'</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #003366; font-weight: bold;">function</span> toggle_flickr_desc<span style="color: #009900;">&#40;</span>i<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #003366; font-weight: bold;">var</span> heading <span style="color: #339933;">=</span> <span style="color: #3366CC;">'#img'</span> <span style="color: #339933;">+</span> i<span style="color: #339933;">;</span>
            <span style="color: #006600; font-style: italic;">//Pay attention the code below automagically gets the dom x and y to set the item_div x,y :)</span>
            <span style="color: #003366; font-weight: bold;">var</span> x <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span>heading<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">offset</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">left</span><span style="color: #339933;">;</span>
            <span style="color: #003366; font-weight: bold;">var</span> y <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span>heading<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">offset</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">top</span><span style="color: #339933;">;</span>
            y <span style="color: #339933;">=</span> y <span style="color: #339933;">+</span> <span style="color: #CC0000;">160</span><span style="color: #339933;">;</span>
            <span style="color: #003366; font-weight: bold;">var</span> item_div <span style="color: #339933;">=</span> <span style="color: #3366CC;">'div#desc-'</span> <span style="color: #339933;">+</span> i<span style="color: #339933;">;</span>
            $<span style="color: #009900;">&#40;</span>heading<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">after</span><span style="color: #009900;">&#40;</span>flickrDescription<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            $<span style="color: #009900;">&#40;</span>item_div<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'left'</span><span style="color: #339933;">,</span> x<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            $<span style="color: #009900;">&#40;</span>item_div<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'top'</span><span style="color: #339933;">,</span> y<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #003366; font-weight: bold;">function</span> goHideFlickr<span style="color: #009900;">&#40;</span>i<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #003366; font-weight: bold;">var</span> myDescription <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;#desc-&quot;</span><span style="color: #339933;">;</span>
            $<span style="color: #009900;">&#40;</span>myDescription <span style="color: #339933;">+</span> i<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'display'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'none'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
&nbsp;
        <span style="color: #003366; font-weight: bold;">function</span> goMove<span style="color: #009900;">&#40;</span>goDirection<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#videoYoutube'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'width'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'880px'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#videoYoutube'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'position'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'absolute'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#videoYoutube&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span> <span style="color: #3366CC;">&quot;top&quot;</span><span style="color: #339933;">:</span> goDirection <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;slow&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #003366; font-weight: bold;">function</span> whenPigsFly<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #003366; font-weight: bold;">var</span> randomPiggyNote <span style="color: #339933;">=</span> Math.<span style="color: #660066;">floor</span><span style="color: #009900;">&#40;</span>Math.<span style="color: #660066;">random</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">*</span> arrayTwit.<span style="color: #660066;">length</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #003366; font-weight: bold;">var</span> randomY <span style="color: #339933;">=</span> Math.<span style="color: #660066;">floor</span><span style="color: #009900;">&#40;</span>Math.<span style="color: #660066;">random</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">*</span> <span style="color: #CC0000;">60</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #003366; font-weight: bold;">var</span> piggy <span style="color: #339933;">=</span> <span style="color: #3366CC;">'&lt;div id=&quot;divPigsFlying&quot; onMouseOver=&quot;stopFlyingPig();&quot; onMouseOut=&quot;continueFlyingPig();&quot; &gt;&lt;div&gt;&lt;a id=&quot;twitLink&quot; href=&quot;&quot; target=&quot;_blank&quot; style=&quot;color:#fff&quot;&gt;&lt;div id=&quot;divPiggContent&quot; style=&quot;height:40px; display:inline-block; font-weight:1.4em; color:#0E1836; border:none;&quot;  &gt;&lt;/div&gt;&lt;img class=&quot;pigsFly&quot; src=&quot;images/when_pigs_fly.png&quot; style=&quot;border:none;&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;'</span><span style="color: #339933;">;</span>
            $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#divWhenPigsFly'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">html</span><span style="color: #009900;">&#40;</span>piggy<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #003366; font-weight: bold;">var</span> goLink <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;http://twitter.com/&quot;</span> <span style="color: #339933;">+</span> arrayTwit<span style="color: #009900;">&#91;</span>randomPiggyNote<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">from_user</span><span style="color: #339933;">;</span>
            $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#twitLink'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'href'</span><span style="color: #339933;">,</span> goLink<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #003366; font-weight: bold;">var</span> HowFatisThePig <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#divPigsFlying'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">width</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #003366; font-weight: bold;">var</span> myPiggyStartLocation <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span> <span style="color: #339933;">-</span> HowFatisThePig<span style="color: #339933;">;</span>
            $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#divPigsFlying'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'left'</span><span style="color: #339933;">,</span> myPiggyStartLocation<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#divPigsFlying'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'top'</span><span style="color: #339933;">,</span> randomY<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#divPiggContent'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span>arrayTwit<span style="color: #009900;">&#91;</span>randomPiggyNote<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#divPigsFlying'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">fadeIn</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">1000</span><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: #003366; font-weight: bold;">var</span> left <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#divPigsFlying'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">offset</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">left</span><span style="color: #339933;">;</span>
                <span style="color: #003366; font-weight: bold;">var</span> goDistance <span style="color: #339933;">=</span> window.<span style="color: #660066;">innerWidth</span><span style="color: #339933;">;</span>
                left <span style="color: #339933;">=</span> left <span style="color: #339933;">+</span> <span style="color: #CC0000;">900</span><span style="color: #339933;">;</span>
                $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#divPigsFlying'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'position'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'absolute'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#divPigsFlying'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span> left<span style="color: #339933;">:</span> goDistance <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">20000</span><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: #009900;">&#40;</span><span style="color: #3366CC;">'#divPigsFlying'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">fadeOut</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">1000</span><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> whenPigsFly<span style="color: #009900;">&#40;</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: #009900;">&#125;</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: #009900;">&#125;</span>
&nbsp;
        <span style="color: #003366; font-weight: bold;">function</span> stopFlyingPig<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#divPigsFlying'</span><span style="color: #009900;">&#41;</span>.<span style="color: #000066;">stop</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #003366; font-weight: bold;">function</span> continueFlyingPig<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #003366; font-weight: bold;">var</span> goDistance <span style="color: #339933;">=</span> window.<span style="color: #660066;">innerWidth</span><span style="color: #339933;">;</span>
            $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#divPigsFlying'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span> left<span style="color: #339933;">:</span> goDistance <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">20000</span><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: #009900;">&#40;</span><span style="color: #3366CC;">'#divPigsFlying'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">fadeOut</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">1000</span><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> whenPigsFly<span style="color: #009900;">&#40;</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: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #003366; font-weight: bold;">function</span> goSearch<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #003366; font-weight: bold;">var</span> Quo <span style="color: #339933;">=</span> <span style="color: #3366CC;">'<span style="color: #000099; font-weight: bold;">\&quot;</span>'</span><span style="color: #339933;">;</span>
            $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#public_images'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">html</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #003366; font-weight: bold;">var</span> content <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#Search'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            videoYoutube <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> myFeedObject<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'http://pipes.yahoo.com/pipes/pipe.run?Search='</span> <span style="color: #339933;">+</span> content <span style="color: #339933;">+</span> <span style="color: #3366CC;">'&amp;_id=aE4GjZv63BGt4u90l7okhQ&amp;_render=json&amp;_callback=?'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'videoYoutube'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'images'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            myFlickerImages<span style="color: #009900;">&#40;</span>content<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            twitterSearch<span style="color: #009900;">&#40;</span>content<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#geoCodeNewsMain'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">html</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            loadGmap<span style="color: #009900;">&#40;</span>content<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #003366; font-weight: bold;">function</span> loadGmap<span style="color: #009900;">&#40;</span>content<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>GBrowserIsCompatible<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                map <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> GMap2<span style="color: #009900;">&#40;</span>document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;geoCodeNewsMain&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                geoXml <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> GGeoXml<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;http://pipes.yahoo.com/pipes/pipe.run?_id=5157b1e8036007e4334fd092860f7372&amp;_render=kml&amp;textinput1=&quot;</span> <span style="color: #339933;">+</span> content<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                map.<span style="color: #660066;">setCenter</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                map.<span style="color: #660066;">addOverlay</span><span style="color: #009900;">&#40;</span>geoXml<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #006600; font-style: italic;">// Note it is important to name the location the same as the ul id and object name the same because I use location to send the toggle object look at the code. http://pipes.yahoo.com/pipes/pipe.run?Search=generative+art&amp;_id=aE4GjZv63BGt4u90l7okhQ&amp;_render=json</span>
&nbsp;
        AdobeNews <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> myFeedObject<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'http://pipes.yahoo.com/pipes/pipe.run?_id=af4c93eb0e4fd18859cc9ab840c5f745&amp;_render=json&amp;_callback=?'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'AdobeNews'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'generic'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        riaNews <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> myFeedObject<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'http://pipes.yahoo.com/pipes/pipe.run?_id=f207a19ea9a846e4ca242c5239a0d0df&amp;_render=json&amp;_callback=?'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'riaNews'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'generic'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        MSDNNews <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> myFeedObject<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'http://pipes.yahoo.com/pipes/pipe.run?_id=8250c5383b9990d7c8b0ef8129d820db&amp;_render=json&amp;_callback=?'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'MSDNNews'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'generic'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        videoYoutube <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> myFeedObject<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'http://pipes.yahoo.com/pipes/pipe.run?Search=art&amp;_id=aE4GjZv63BGt4u90l7okhQ&amp;_render=json&amp;_callback=?'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'videoYoutube'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'images'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		worldNews <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> myFeedObject<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'http://pipes.yahoo.com/pipes/pipe.run?_id=e946b09b5c463a833d53699438633056&amp;_render=json&amp;_callback=?'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'worldNews'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'generic'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		blogSphere <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> myFeedObject<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'http://pipes.yahoo.com/pipes/pipe.run?_id=8f6ff698cbc6531b78bd76aa12850541&amp;_render=json&amp;delmax=10&amp;diggmin=200&amp;redmax=10&amp;slashmin=100&amp;trunc=50&amp;_callback=?'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'blogSphere'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'generic'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		OpenCourse <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> myFeedObject<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'http://pipes.yahoo.com/pipes/pipe.run?_id=fc65cd7d5080b4e32744fd730d49bfff&amp;_render=json&amp;_callback=?'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'OpenCourse'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'generic'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
        myFlickerImages<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;art&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        $<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</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>
            twitterSearch<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;when pigs fly&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            loadGmap<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;war&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></pre></div></div>

<p>JavaScript is becoming more and more important on front end interfaces these days and it is essential for front end developers to utilize jQuery.  JavaScript used to be such a hassle but with jQuery it becomes extremely easy to utilize and manage.  This example shows a twitter search that has been animated as a banner of flying pigs( everyone enjoys flying pigs).  It also demonstrates Yahoo Pipes json feeds etc..  When I started creating this example I first searched to see what was out their in the wild and I found this post <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5zZW8tZXhwZXJ0LWJsb2cuY29tL2Jsb2cvcGFyc2luZy15YWhvby1waXBlcy1qc29uLWZlZWRzLXdpdGgtanF1ZXJ5" target=\"_blank\"  title=\"Parsing Yahoo Pipes With jQuery - by Ramiro Gómez\">Parsing Yahoo Pipes With jQuery &#8211; by Ramiro Gómez</a> .  I liked the example but I of course had to modify it and make it a little more reusable.  Hopefully the seo-expert will like the changes.  Anyone reading this post that is not familiar with <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3BpcGVzLnlhaG9vLmNvbS9waXBlcy8=" title=\"Yahoo Pipes\" target=\"_blank\">Yahoo Pipes</a> should know this about pipes.  Yahoo Pipes allows its users to quickly make mashups on the web and then redistribute them to web pages by embedding them, sending RSS feeds and JSON.  Yahoo Pipes is also intesting because it kind of serves as a cloud based middle-ware to create other applications.  You don&#8217;t have to keep the pipe you create on a yahoo site you can also incorporate these feeds into various wordpress pages, durpal pages, etc..  Yahoo Pipes while it might sound complex it is actually very simple to use.  The pipe IDE is all visually rendered for the user and you can rapidly mash information on the web.  JavaScript Object Notation is easy when using jQuery; I believe many people get frustrated with JavaScript because it can be challenging to debug.  I would heavily recommend <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2dldGZpcmVidWcuY29tLw==" title=\"firebug\">Firebug</a> on Firefox it really helps to demystify JavaScript it allows developers to easily debug their code, add watches, and utilize a console window.  If you are a more visual person than it might benefit you to print out the JSON object with PHP the way seo-expert shows other wise just use Firebug.  Feel free to download the example and use it or modify it.  I also found it exceptionally easy to use the built in jQuery animation methods.  I used them in this sample to fly pigs across the screen and also scroll th div that is filled with images from a yahoo pipe.  I have also been looking into <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2QuaGF0ZW5hLm5lLmpwL3NlY29uZGxpZmUvMjAwNzA5MjMvMTE5MDQ4MjM5Mw==" title=\"JsTweener\" target=\"_blank\">JsTweener</a> if I can do something that is more like a flash animation I will do it.  It seems to me the animation easing effects are not as easy to use as they are with flash but then again flash has numerous tween libraries.  I do belive we will only see more of JavaScript libraries in the future that are based off of existing code libraries that many people currently use.  I guess an obvious benefit of using something like JS Tweener is I am already familiar with the syntax and would save myself a Google search.  I also added a twitter search to this project that pull the results when pigs fly (Note when you hover over the pig it stops).  You will notice that a pig flys by on an occasion and has the related twitter post trailing.  When the user hits search it also fetches new JSON feeds for the video, flickr and Twitter feeds.  Play around with it.  I also used type select a library that allows you to embed fonts.  I embedded a font but that font is not available in the download because I had to pay for the font.  I highly recommend checking out <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy50eXBlc2VsZWN0Lm9yZy8=" target=\"_blank\" title=\"Type Select\" >Type Select</a> for embedding fonts it seemed to work out for me just fine.  I have noticed on various platforms I get different results.  Vista IE works/ Firefox doesn&#8217;t etc.. Apple just works hmm go figure.  I also noticed sometimes the Twitter Search Pipe Fails this is because Twitter goes down sometimes hence the service breaks may be I should have wrapped it in a try catch oh well.  I had a fun time putting this together and managed to teach myself a little more about jQuery it makes JavaScript easy!</p>
<p>You can also find numerous videos on how to use Yahoo Pipes here is one of those videos by Scott Has a Mac:<br />
<object width="325" height="244"><param name="movie" value="http://www.youtube.com/v/nPHBKnkCtfA&#038;hl=en_US&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/nPHBKnkCtfA&#038;hl=en_US&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="325" height="244"></embed></object></p>
<p>Long story short check out Yahoo Pipes you can manipulate information easily and visualize it rapidly.</p>
<p>I think the future of JavaScript will be interesting I am also looking forward to utilizing haXe to convert some flash libraries to JavaScript. <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5jaHJvbWVleHBlcmltZW50cy5jb20vZGV0YWlsLzNkLWphdmFzY3JpcHQtd2l0aC1zYW5keS1oeC8=" title=\"3D JavaScript with Sandy-HX\" target=\"_blank\">Check out this experiment on Chrome Experiment</a> they used <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2hheGUub3JnLw==" title=\"haXe\" target=\"_blank\">haXe</a> to convert Sandy3D to JavaScript. Please Note You have to view this with a <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5nb29nbGUuY29tL2Nocm9tZQ==" title=\"Chrome Browser\" target=\"_blank\">Chrome Browser</a>.  I am also very curious to see the results.  I believe haXe will be an interesting platform I think it could expand by adding support for C# and JAVA.  I think then it would be used more and I know they have plans to add support for java at least that is what they were doing at Google summer of code.  I think it is interesting that haXe is not about the runtime but utilizing the language of choice and then targeting a runtime this I believe is a <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2VuLndpa2lwZWRpYS5vcmcvd2lraS9QYXJhZGlnbV9zaGlmdA==" title=\"paradigm shift\" target=\"_blank\">paradigm shift</a>.  Traditionally platforms are built around the runtime and not the opposite way around.  I don&#8217;t mind JavaScript but I really like Flash and Silverlight you can count on the same experience across multiple platforms the truth is not of course the same for JavaScript because it is dependent on the browser rendering / JavaScript engine.  jQuery really speeds up development and makes JavaScript more like other programing languages.</p>
<p>Links:<br />
<a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2Jsb2cubmloaWxvZ2ljLmRrLw==" title=\"Cool JavaScript Experiments by nihilogic\" target=\"_blank\">Cool JavaScript Experiments by nihilogic</a><br />
<a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5jaHJvbWVleHBlcmltZW50cy5jb20=" title=\"Chrome Experiments\" target=\"_blank\">Chrome Experiments</a><br />
<a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3BpcGVzLnlhaG9vLmNvbS9waXBlcy8=" title=\"Yahoo Pipes MashUp Creator\" target=\"_blank\">Yahoo Pipes MashUp Creator</a><br />
<a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5zZW8tZXhwZXJ0LWJsb2cuY29tL2Jsb2cvcGFyc2luZy15YWhvby1waXBlcy1qc29uLWZlZWRzLXdpdGgtanF1ZXJ5" target=\"_blank\"  title=\"Parsing Yahoo Pipes With jQuery - by Ramiro Gómez\">Parsing Yahoo Pipes With jQuery &#8211; by Ramiro Gómez</a><br />
<a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2pxdWVyeS5jb20v" title=\"jQuery\" target=\"_blank\">jQuery</a><br />
<a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2Fyc3RlY2huaWNhLmNvbS93ZWIvbmV3cy8yMDA5LzEyL2NvbW1vbmpzLWVmZm9ydC1zZXRzLWphdmFzY3JpcHQtb24tcGF0aC1mb3Itd29ybGQtZG9taW5hdGlvbi5hcnM=" title=\"Future of JavaScript?\" target=\"_blank\">Future of JavaScript?</a></p>
<p>Other Cool JavaScript Libraries:<br />
<a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL21vb3Rvb2xzLm5ldC8=" title=\"Moo Tools\" target=\"_blank\">Moo Tools</a><br />
<a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5wcm90b3R5cGVqcy5vcmcv" title=\"ProtoType\" target=\"_blank\">ProtoType</a><br />
<a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2RlYW5tLmdpdGh1Yi5jb20vcHJlM2Qv" title=\"Pre3d\" target=\"_blank\">Pre3d</a><br />
<a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3Byb2Nlc3Npbmdqcy5vcmcv" title=\"ProcessingJS\" target=\"_blank\">ProcessingJS</a><br />
<a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2QuaGF0ZW5hLm5lLmpwL3NlY29uZGxpZmUvMjAwNzA5MjMvMTE5MDQ4MjM5Mw==" title=\"JsTweener\" target=\"_blank\">JsTweener</a><br />
<a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy50eXBlc2VsZWN0Lm9yZy8=" target=\"_blank\" title=\"Type Select\" >Type Select</a></p>
<p>This Project&#8217;s Associated Files<br />
<a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2ktY3JlYXRlLm9yZy9KYXZhU2NyaXB0L3NjOU5ld3Mv" title=\"Click here to Launch Finished Project\" target=\"_blank\">Click here to Launch Finished Project</a><br />
<a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2ktY3JlYXRlLm9yZy9KYXZhU2NyaXB0L3NjOU5ld3MveWFob29QaXBlc0pzb24uemlw" title=\"Yahoo Pipes and JSON Project Download Code\" target=\"_blank\">Click here to download all associated Code</a></p>
 <img src="http://i-create.org/wp-content/plugins/feed-statistics.php?view=1&post_id=708" width="1" height="1" style="display: none;" /><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fi-create.org%2F2009%2F12%2F08%2Fwhen-pigs-fly-with-jquery%2F&amp;linkname=When%20Pigs%20Fly%20With%20jQuery"><img src="http://i-create.org/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://i-create.org/2009/12/08/when-pigs-fly-with-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Processing JS</title>
		<link>http://i-create.org/2009/11/14/processing-js/</link>
		<comments>http://i-create.org/2009/11/14/processing-js/#comments</comments>
		<pubDate>Sun, 15 Nov 2009 00:45:51 +0000</pubDate>
		<dc:creator>Brendon Smith</dc:creator>
				<category><![CDATA[art]]></category>
		<category><![CDATA[i-create]]></category>
		<category><![CDATA[Experiment]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Processing]]></category>

		<guid isPermaLink="false">http://i-create.org/?p=695</guid>
		<description><![CDATA[Well on occasion I like to play around with Processing.  Processing is an awesome language for generating generative art and data visualizations etc..  Processing has been around for several years and it was originally created by Ben Fry and Casey Reas at MIT.  Processing has traditionally depended on java to run.  When you create sketches [...]]]></description>
			<content:encoded><![CDATA[<p>Well on occasion I like to play around with <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3Byb2Nlc3Npbmcub3JnLw==" title=\"Processing\" target=\"_blank\">Processing</a>.  Processing is  an awesome language for generating generative art and data  visualizations etc..  Processing has been around for several years and  it was originally created by <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2JlbmZyeS5jb20v" title=\"Ben Fry\" target=\"_blank\">Ben Fry</a> and <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3JlYXMuY29tLw==" title=\"Casey Reas\" target=\"_blank\">Casey Reas</a> at MIT.  Processing  has traditionally depended on java to run.  When you create sketches  you write them in the simple Processing editor.  You create sketches  and then use the language to create your art.  The language is  relatively easy to use and powerful.  It is really neat to see this  language be ported to JavaScript!  <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5nb29nbGUuY29tL3VybD9zYT10JmFtcDtzb3VyY2U9d2ViJmFtcDtjdD1yZXMmYW1wO2NkPTEmYW1wO3ZlZD0wQ0FjUUZqQUEmYW1wO3VybD1odHRwJTNBJTJGJTJGZWpvaG4ub3JnJTJGJmFtcDtlaT0xMnozU3VTX0RwQ0VNczJJN2VnRiZhbXA7dXNnPUFGUWpDTkY5cjhCaUNWSlRHWkx6WHAyU3ZCMXZlZ3V5ZXcmYW1wO3NpZzI9OFRTVFI3LTZZR1U1SW1yb3hUUkJjQQ==" title=\"John Resig\" target=\"_blank\">John Resig</a> who created the  wonderful <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2pxdWVyeS5jb20v" title=\"jQuery\" target=\"_blank\">jQuery</a> JavaScript framework also ported the <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3Byb2Nlc3Npbmdqcy5vcmcv" title=\"Processing in JavaScript!\" target=\"_blank\">Processing  language over to JavaScript</a>.  So as a result with minimal effort you  can port most processing projects over and simply use JavaScript.  This  works in most cases and I believe in the future it will only improve!   So I decided to pick it up again and play with some of the examples.  I  noticed one in particular that I wanted to play with <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3Byb2Nlc3Npbmdqcy5vcmcvbGVhcm5pbmcvdG9waWMvcGF0dGVybg==" title=\"Pattern Processing example\" target=\"_blank\">Casey Reas and Ben Fry example  following the mouse</a>.  I decided to alter it so the ellipses that  followed the mouse would be random colors and have random amounts of  transparency and this was easy to do. It is geeky fun to play with the color() method and combine it with random() method because it is easy to set color variations that are pleasant and will all have random colors with the same tonal value or monochromatic with variations on the tonal value. It is easy to create a decent color pallet to work with.  I am looking forward to seeing  this project progress and I am amazed of the speed it is ridiculously wicked fast in JavaScript.  It is definitely interesting to see JavaScript  evolve this far in such a short period of time.  With the new  frameworks like jQuery it has never been easier to create interactive  content with JavaScript.  I was upset though when trying to use it with  Internet Explorer because that worthless browser doesn&#8217;t support the  canvas tag.  I could go on about how much I hate internet explorer but  that would take up probably 100 to 200 pages so I guess I won&#8217;t I will  just say it sucks and leave it at that.  I tried to use <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2V4Y2FudmFzLnNvdXJjZWZvcmdlLm5ldC8=" title=\"Explorer Canvas\" target=\"_blank\">Explorer  Canvas</a>, but I believe it fails when you use the mouse following  techniques as a result I placed in code that allows the IE version to use the Java version instead of the JavaScript version.  I have to use  jQuery a great deal at work now and enjoy it because it makes a more  approachable language to work in and I can get things done quickly.  So any way here is a example of what you can do quickly with Processing.  I will look forward to playing with processing more and am simply amazed at how fast it is with JavaScript.  The only frustration I have with JavaScript as a developer is the fact that different browsers  interpret JavaScript differently and sometimes it can take hours to  solve these odd quirks. This is really true at work lately we have been doing some really complicated stuff with JavaScript and I am looking forward to becoming much more efficient with jQuery it takes a considerable time to become efficient with it and I am not talking about simply using plugins I am talking specifically about creating reusable widgets that are custom created for extremely unique circumstances. Things sometimes look easy and then you dig in to them and start looking at all the gotchas. I just need an extra few days thats probably why tomorrow I will be messing around with it on my off time. I have also been trying to balance out my time more. I have been working on my new portfolio and I can&#8217;t wait until it is finished!  I have been writing a lot actionscipt on my time off(thats not work though its a hobby). I am making more progress but still have a long way to go. Once I am finished with my portfolio I will move on to creating a few games I have a few ideas and I would like to use actionscript to implement them and I will also look at Andriod because I think the Andriod market is on the verge of taking off and I want to be a part of that. I installed the SDK and have a book again its just finding the time!</p>
<p><a class=\"thickbox\" title=\"Processing Experiment\" href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2ktY3JlYXRlLm9yZy9wcm9jZXNzaW5nL21vdXNlUGF0dGVybi9wcm9jZXNzaW5nLmh0bWw/S2VlcFRoaXM9dHJ1ZSYjMDM4Oz9UQl9pZnJhbWU9dHJ1ZSYjMDM4O2hlaWdodD00OTgmIzAzODt3aWR0aD03NzA="><img src="http://i-create.org/processing/mousePattern/print.jpg" alt="Processing Experiment" width="325px" /></a></p>
<p>Processing Code:</p>

<div class="wp_syntax"><div class="code"><pre class="processing" style="font-family:monospace;">void setup()
{
  size(800, 600);
  background(255);
  smooth();
}
&nbsp;
void draw() 
{
   variableEllipse(mouseX, mouseY, pmouseX, pmouseY); 
}
void variableEllipse(int x, int y, int px, int py) 
{
  float speed = abs(x-px) + abs(y-py);
  stroke(64,128,128,255);
  fill(color(random(0,255),random(0,255),0),myFillColor());
  ellipse(x, y, speed, speed);
}
int myFillColor(){
int alpha = random(0,255);
return alpha;
}</pre></div></div>

<p><a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2ktY3JlYXRlLm9yZy9wcm9jZXNzaW5nL21vdXNlUGF0dGVybi9tb3VzZVBhdHRlcm4uemlw" target=\"_blank\" title=\"Mouse Pattern Source\">Download Example</a></p>
<p>This weekend I also sketched out an image of Lisa and have been playing around with it in Illustrator.  I love it when I have time to mess around and sketch or paint but again I never seem to have enough time and I haven&#8217;t been working on my traditional art skills.  I would like to find more time for those skills so I can improve I wouldn&#8217;t mind having my own show one of these days would be fun.  I have really been concentrating most of my efforts to improve my programming skills.</p>
<p><a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3BpY2FzYXdlYi5nb29nbGUuY29tL0JyZW5kb24uU21pdGg5L1NrZXRjaGVzIw==" title=\"Sketches\" target=\"_blank\"><img src="http://lh6.ggpht.com/_EWc7lK15FUU/Sv8l8WMJIcI/AAAAAAAACzQ/QCyN6zjRk50/s576/lisa1.jpg" width="325px" title="Lisa Quick Sketch" /></a></p>
<p>Useful Links:<br />
<a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3Byb2Nlc3Npbmdqcy5vcmcv" title=\"Processing\" target=\"_blank\">Processing JS</a><br />
<a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2NvZGVyZXBvcy5vcmcvc2hhcmUvd2lraS9KU1R3ZWVuZXIv" title=\"Tweener\" target=\"_blank\">Tweener Style Animation with JS</a><br />
<a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2pzYy5zb3VyY2Vmb3JnZS5uZXQv" title=\"CSharp Compile to\" target=\"_blank\">Recompile your .net assembly to javascript, actionscript, php or java</a></p>
 <img src="http://i-create.org/wp-content/plugins/feed-statistics.php?view=1&post_id=695" width="1" height="1" style="display: none;" /><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fi-create.org%2F2009%2F11%2F14%2Fprocessing-js%2F&amp;linkname=Processing%20JS"><img src="http://i-create.org/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://i-create.org/2009/11/14/processing-js/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
