<?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; Experiment</title>
	<atom:link href="http://i-create.org/tag/experiment/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>Tweet Tank in Away3D and Hype pt. 2</title>
		<link>http://i-create.org/2010/05/16/away3d-with-hype-fish-tank-part-2/</link>
		<comments>http://i-create.org/2010/05/16/away3d-with-hype-fish-tank-part-2/#comments</comments>
		<pubDate>Mon, 17 May 2010 04:09:11 +0000</pubDate>
		<dc:creator>Brendon Smith</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[i-create]]></category>
		<category><![CDATA[3d]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[Away3D]]></category>
		<category><![CDATA[data visualization]]></category>
		<category><![CDATA[Experiment]]></category>
		<category><![CDATA[hype]]></category>
		<category><![CDATA[interactive]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://i-create.org/2010/05/16/away3d-with-hype-fish-tank-part-2/</guid>
		<description><![CDATA[I have now added support to search twitter. Once you search twitter it repopulates the fish bowl with fish that once clicked will navigate to that twitter search result. I have been working on optimizing the content. Specifically the fish models are very processor intensive. I have been looking at different ways to improve this. [...]]]></description>
			<content:encoded><![CDATA[<p>I have now added support to search twitter.  Once you search twitter it repopulates the fish bowl with fish that once clicked will navigate to that twitter search result.  I have been working on optimizing the content.  Specifically the fish models are very processor intensive.  I have been looking at different ways to improve this.  Away3Dlite is new than the other versions and it does have many benefits.  The main build has other techniques like level of detail and fogging.  These help to reduce the over all processor hit.  I believe in the near future some of these features will hopefully be ported over to the Away3Dlite version if not then within in the next couple of weeks I will port this over.  I think utilizing fogging and level of detail will greatly reduce the overall processor hit. </p>
<p><a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2ktY3JlYXRlLm9yZy9hY3Rpb25zY3JpcHQvVHdlZXRUYW5rLw==" title=\"TweetTank\" target=\"_blank\">Processor Intensive Experiment:<br />
<img src="http://i-create.org/actionscript/TweetTank/TweetTankAS.jpg" title="Tweet Tank" /><br />
</a></p>
<p>You will notice that when it renders it is rendering 110+ DisplayObject3D I have also been working on Garbage Collection I have found that after doing several searches the Memory is increasing greatly.  So I have added some techniques like removing the objects and then nullifying them although it doesn&#8217;t appear to be helping much.  I will have to look into this again soon.  I would also like to super impose a Google map on the top make it click-able and then have the camera zoom in on that particular fish which should not really be difficult at all because I can use tween lite to simply zoom the camera to the objects position.  So I am not done with this and I will be revisiting these issues.  Memory management can be difficult.  I will also be scouring the web for flash tools that help profile and reduce memory so if anyone has any suggestions feel free to chime in. I have also been reading the 3D in Flash Book from Friends of Ed it does have a whole chapter on optimizing 3D content for the web so I will be reading that chapter soon.  I have also been looking at gSkinners blog it has a considerable amount in <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5nc2tpbm5lci5jb20vYmxvZy9hcmNoaXZlcy8yMDA2LzA2L2FzM19yZXNvdXJjZV9tYS5odG1s" title=\"gSkinner on Memory Management\" target=\"_blank\">regards to memory management</a>.<br />
The Source Code:</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: #006600;">Sprite</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;">events</span>.<span style="color: #006600;">MouseEvent</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #0066CC;">MovieClip</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;">media</span>.<span style="color: #006600;">SoundChannel</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: #0066CC;">system</span>.<span style="color: #0066CC;">System</span>;
&nbsp;
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> TweetTank <span style="color: #0066CC;">extends</span> Sprite <span style="color: #66cc66;">&#123;</span>
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> twitterFish:tweetFish;
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> searchClipGo:searchClip = <span style="color: #000000; font-weight: bold;">new</span> searchClip<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> <span style="color: #0066CC;">sound</span>:<span style="color: #0066CC;">Sound</span>;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> musicChannel;
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> TweetTank<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
			addEventListener<span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">ADDED_TO_STAGE</span>, addedToStageHandler, <span style="color: #000000; font-weight: bold;">false</span>, <span style="color: #cc66cc;">0</span>, <span style="color: #000000; font-weight: bold;">true</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> addedToStageHandler<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>
			playMusic<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			twitterFish=<span style="color: #000000; font-weight: bold;">new</span> tweetFish;
			addChild<span style="color: #66cc66;">&#40;</span>twitterFish<span style="color: #66cc66;">&#41;</span>;
			twitterFish._twitSearch = <span style="color: #ff0000;">&quot;Flash&quot;</span>;
			twitterFish.<span style="color: #006600;">init</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			twitterFish.<span style="color: #0066CC;">visible</span> = <span style="color: #000000; font-weight: bold;">true</span>;
			addChild<span style="color: #66cc66;">&#40;</span>searchClipGo<span style="color: #66cc66;">&#41;</span>;
			searchClipGo.<span style="color: #006600;">x</span> = <span style="color: #cc66cc;">250</span>;
			searchClipGo.<span style="color: #006600;">y</span> = <span style="color: #cc66cc;">30</span>;
			searchClipGo.<span style="color: #006600;">btnSearch</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">CLICK</span>, TweetSearch<span style="color: #66cc66;">&#41;</span>;
			removeEventListener<span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">ADDED_TO_STAGE</span>, addedToStageHandler<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> TweetSearch<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:MouseEvent<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;">//trace(searchClipGo.txtSearch.text);</span>
			<span style="color: #0066CC;">try</span><span style="color: #66cc66;">&#123;</span>
			<span style="color: #0066CC;">this</span>.<span style="color: #006600;">twitterFish</span>.<span style="color: #006600;">killAll</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #0066CC;">this</span>.<span style="color: #006600;">twitterFish</span>.<span style="color: #006600;">xMove</span> = <span style="color: #000000; font-weight: bold;">null</span>;
			<span style="color: #0066CC;">this</span>.<span style="color: #006600;">twitterFish</span>.<span style="color: #006600;">twFishOne</span> = <span style="color: #000000; font-weight: bold;">null</span>;
			<span style="color: #0066CC;">this</span>.<span style="color: #006600;">twitterFish</span> = <span style="color: #000000; font-weight: bold;">null</span>;
			twitterFish=<span style="color: #000000; font-weight: bold;">new</span> tweetFish;
			addChild<span style="color: #66cc66;">&#40;</span>twitterFish<span style="color: #66cc66;">&#41;</span>;
			twitterFish._twitSearch  = searchClipGo.<span style="color: #006600;">txtSearch</span>.<span style="color: #0066CC;">text</span>;
			twitterFish.<span style="color: #006600;">init</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
			twitterFish.<span style="color: #0066CC;">visible</span> = <span style="color: #000000; font-weight: bold;">true</span>;
&nbsp;
			addChild<span style="color: #66cc66;">&#40;</span>searchClipGo<span style="color: #66cc66;">&#41;</span>;
			searchClipGo.<span style="color: #006600;">x</span> = <span style="color: #cc66cc;">250</span>;
			searchClipGo.<span style="color: #006600;">y</span> = <span style="color: #cc66cc;">30</span>;
			searchClipGo.<span style="color: #006600;">btnSearch</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">CLICK</span>, TweetSearch<span style="color: #66cc66;">&#41;</span>;
			<span style="color: #0066CC;">System</span>.<span style="color: #006600;">gc</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #808080; font-style: italic;">// the GC will perform a full mark/sweep on the second call.</span>
			<span style="color: #66cc66;">&#125;</span><span style="color: #0066CC;">catch</span><span style="color: #66cc66;">&#40;</span>fail:<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;">//trace(fail);</span>
			<span style="color: #66cc66;">&#125;</span>
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
&nbsp;
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> playMusic<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: #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;test.mp3&quot;</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span>;
			musicChannel=<span style="color: #0066CC;">sound</span>.<span style="color: #0066CC;">play</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span>, <span style="color: #0066CC;">int</span>.<span style="color: #0066CC;">MAX_VALUE</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #0066CC;">try</span><span style="color: #66cc66;">&#123;</span>
&nbsp;
			<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>
				musicChannel.<span style="color: #006600;">removeEventListener</span><span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">SOUND_COMPLETE</span>, loopMusic<span style="color: #66cc66;">&#41;</span>;
			<span style="color: #66cc66;">&#125;</span>
			musicChannel.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">SOUND_COMPLETE</span>, loopMusic<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> loopMusic<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: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>musicChannel<span style="color: #66cc66;">!</span>=<span style="color: #000000; font-weight: bold;">null</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
&nbsp;
				playMusic<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #66cc66;">&#125;</span>
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span>
&nbsp;
&nbsp;
package <span style="color: #66cc66;">&#123;</span>
	<span style="color: #0066CC;">import</span> away3dlite.<span style="color: #006600;">containers</span>.<span style="color: #006600;">ObjectContainer3D</span>;
	<span style="color: #0066CC;">import</span> away3dlite.<span style="color: #006600;">materials</span>.<span style="color: #66cc66;">*</span>;
	<span style="color: #0066CC;">import</span> away3dlite.<span style="color: #006600;">materials</span>.<span style="color: #006600;">WireColorMaterial</span>;
	<span style="color: #0066CC;">import</span> away3dlite.<span style="color: #006600;">primitives</span>.<span style="color: #006600;">Cube6</span>;
	<span style="color: #0066CC;">import</span> away3dlite.<span style="color: #006600;">templates</span>.<span style="color: #006600;">BasicTemplate</span>;
	<span style="color: #0066CC;">import</span> away3dlite.<span style="color: #006600;">core</span>.<span style="color: #006600;">base</span>.<span style="color: #66cc66;">*</span>;
	<span style="color: #0066CC;">import</span> away3dlite.<span style="color: #006600;">core</span>.<span style="color: #006600;">utils</span>.<span style="color: #66cc66;">*</span>;
	<span style="color: #0066CC;">import</span> away3dlite.<span style="color: #006600;">events</span>.<span style="color: #66cc66;">*</span>;
	<span style="color: #0066CC;">import</span> twFish.<span style="color: #66cc66;">*</span>;
	<span style="color: #0066CC;">import</span> twTank.<span style="color: #66cc66;">*</span>;
	<span style="color: #0066CC;">import</span> RSSJSONW;
	<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">theflashblog</span>.<span style="color: #006600;">utils</span>.<span style="color: #006600;">Math2</span>;
&nbsp;
	<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">adobe</span>.<span style="color: #006600;">utils</span>.<span style="color: #006600;">XMLUtil</span>;
	<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">adobe</span>.<span style="color: #006600;">serialization</span>.<span style="color: #006600;">json</span>.<span style="color: #006600;">JSON</span>;
	<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">adobe</span>.<span style="color: #0066CC;">xml</span>.<span style="color: #006600;">syndication</span>.<span style="color: #006600;">rss</span>.<span style="color: #006600;">Item20</span>;
	<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">adobe</span>.<span style="color: #0066CC;">xml</span>.<span style="color: #006600;">syndication</span>.<span style="color: #006600;">rss</span>.<span style="color: #006600;">RSS20</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #006600;">IOErrorEvent</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #006600;">EventDispatcher</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #006600;">SecurityErrorEvent</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;">navigateToURL</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: #0066CC;">system</span>.<span style="color: #006600;">Security</span>;
&nbsp;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #006600;">KeyboardEvent</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">ui</span>.<span style="color: #006600;">Keyboard</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;">events</span>.<span style="color: #006600;">MouseEvent</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">geom</span>.<span style="color: #006600;">Vector3D</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;">display</span>.<span style="color: #66cc66;">*</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;">display</span>.<span style="color: #006600;">Bitmap</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #006600;">BlendMode</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> flash.<span style="color: #006600;">filters</span>.<span style="color: #006600;">GlowFilter</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">media</span>.<span style="color: #006600;">SoundChannel</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">utils</span>.<span style="color: #006600;">Timer</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #006600;">TimerEvent</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #0066CC;">system</span>.<span style="color: #0066CC;">System</span>;
&nbsp;
	<span style="color: #0066CC;">import</span> gs.<span style="color: #006600;">TweenLite</span>;
&nbsp;
	<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;">layout</span>.<span style="color: #006600;">GridLayout</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>;
&nbsp;
&nbsp;
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> tweetFish <span style="color: #0066CC;">extends</span> BasicTemplate <span style="color: #66cc66;">&#123;</span>
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> origin:Vector3D=<span style="color: #000000; font-weight: bold;">new</span> Vector3D<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">40</span>,<span style="color: #cc66cc;">900</span><span style="color: #66cc66;">&#41;</span>;
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> twFishOne:TwFish1;
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> twTankC:TwTank1;
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> soundAnalyzer:SoundAnalyzer;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> myX:<span style="color: #0066CC;">Number</span>=<span style="color: #cc66cc;">0</span>;
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> layout:GridLayout;
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> Tank:ObjectContainer3D;
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> xMove:FunctionTracker;
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> _twitSearch:<span style="color: #0066CC;">String</span>;
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> xScaleTracker:FunctionTracker;
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> yScaleTracker:FunctionTracker;
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> zScaleTracker:FunctionTracker;
		<span style="color: #66cc66;">&#91;</span>Bindable<span style="color: #66cc66;">&#93;</span><span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> myRSS:RSSJSONW;
		Security.<span style="color: #006600;">loadPolicyFile</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;http://twitter.com/crossdomain.xml&quot;</span><span style="color: #66cc66;">&#41;</span>;
		Security.<span style="color: #0066CC;">allowInsecureDomain</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;*&quot;</span><span style="color: #66cc66;">&#41;</span>;
		Security.<span style="color: #0066CC;">allowDomain</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;*&quot;</span><span style="color: #66cc66;">&#41;</span>;
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> myTimer:Timer = <span style="color: #000000; font-weight: bold;">new</span> Timer<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1000</span><span style="color: #66cc66;">&#41;</span>;
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> colourScheme:<span style="color: #0066CC;">Array</span>=<span style="color: #66cc66;">&#91;</span>0x18b849,0x1858b8,0x18b81c,0x18b89c,0xb818b2,0xfd02f4,0x3102fd,0x02b3fd,0x1afd02,0xf4fd02,0xfd02f4,0x3102fd,0x02b3fd,0x1afd02,0xf4fd02<span style="color: #66cc66;">&#93;</span>;
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> tweetFish<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
			<span style="color: #0066CC;">super</span><span style="color: #66cc66;">&#40;</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> init<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: #0066CC;">stage</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">MOUSE_WHEEL</span>, onMouseWheelEvent, <span style="color: #000000; font-weight: bold;">false</span>, <span style="color: #cc66cc;">0</span>, <span style="color: #000000; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #000000; font-weight: bold;">var</span> filterA:<span style="color: #0066CC;">Array</span>=<span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">Array</span>  ;
			filterA.<span style="color: #0066CC;">push</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> GlowFilter<span style="color: #66cc66;">&#40;</span>0xFFFFFF, <span style="color: #cc66cc;">1</span>, <span style="color: #cc66cc;">19</span>, <span style="color: #cc66cc;">19</span>, <span style="color: #cc66cc;">1</span>, <span style="color: #cc66cc;">1</span>, <span style="color: #000000; font-weight: bold;">false</span>, <span style="color: #000000; font-weight: bold;">false</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #000000; font-weight: bold;">var</span> blur:BlurFilter = <span style="color: #000000; font-weight: bold;">new</span> BlurFilter<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			blur.<span style="color: #006600;">blurX</span>=<span style="color: #cc66cc;">900</span>;
			blur.<span style="color: #006600;">blurY</span>=<span style="color: #cc66cc;">900</span>;
			filterA.<span style="color: #0066CC;">push</span><span style="color: #66cc66;">&#40;</span>blur<span style="color: #66cc66;">&#41;</span>;
			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>;
			layout=<span style="color: #000000; font-weight: bold;">new</span> GridLayout<span style="color: #66cc66;">&#40;</span>-<span style="color: #cc66cc;">900</span>,-<span style="color: #cc66cc;">175</span>,<span style="color: #cc66cc;">30</span>,<span style="color: #cc66cc;">30</span>,<span style="color: #cc66cc;">60</span><span style="color: #66cc66;">&#41;</span>;
			Tank = <span style="color: #000000; font-weight: bold;">new</span> ObjectContainer3D<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			view.<span style="color: #006600;">scene</span>.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span>Tank<span style="color: #66cc66;">&#41;</span>;
			Tank.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent3D.<span style="color: #006600;">MOUSE_MOVE</span>, goFish,<span style="color: #000000; font-weight: bold;">false</span>, <span style="color: #cc66cc;">0</span>, <span style="color: #000000; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span>;
			twTankC=<span style="color: #000000; font-weight: bold;">new</span> TwTank1<span style="color: #66cc66;">&#40;</span>view<span style="color: #66cc66;">&#41;</span>;
			view.<span style="color: #006600;">scene</span>.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span>twTankC<span style="color: #66cc66;">&#41;</span>;
			view.<span style="color: #006600;">mouseEnabled</span>=<span style="color: #000000; font-weight: bold;">true</span>;
			jsonInit<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;http://search.twitter.com/search.json?q=&quot;</span> + _twitSearch<span style="color: #66cc66;">&#41;</span>;
			<span style="color: #0066CC;">camera</span>.<span style="color: #006600;">z</span>=-<span style="color: #cc66cc;">2000</span>;
			<span style="color: #0066CC;">camera</span>.<span style="color: #006600;">x</span>=-<span style="color: #cc66cc;">1600</span>;
			<span style="color: #0066CC;">camera</span>.<span style="color: #006600;">y</span>=<span style="color: #cc66cc;">400</span>;
			<span style="color: #0066CC;">camera</span>.<span style="color: #006600;">lookAt</span><span style="color: #66cc66;">&#40;</span> origin <span style="color: #66cc66;">&#41;</span>;
			<span style="color: #0066CC;">stage</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">CLICK</span>,_checkMouseEventTrail,<span style="color: #000000; font-weight: bold;">false</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #000000; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #0066CC;">stage</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>KeyboardEvent.<span style="color: #006600;">KEY_DOWN</span>, keyDown, <span style="color: #000000; font-weight: bold;">false</span>, <span style="color: #cc66cc;">0</span>, <span style="color: #000000; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> jsonInit<span style="color: #66cc66;">&#40;</span>siteFeed:<span style="color: #0066CC;">String</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
			<span style="color: #66cc66;">&#123;</span>
				myRSS = <span style="color: #000000; font-weight: bold;">new</span> RSSJSONW<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;;
				myRSS._data = <span style="color: #ff0000;">&quot;&quot;</span>;
				myRSS._txtURL = siteFeed;
				myRSS.<span style="color: #006600;">onJSON</span><span style="color: #66cc66;">&#40;</span>myRSS._txtURL<span style="color: #66cc66;">&#41;</span>;
				myTimer.<span style="color: #0066CC;">start</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
				myTimer.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;timer&quot;</span>, timedFunction<span style="color: #66cc66;">&#41;</span>;
			<span style="color: #66cc66;">&#125;</span>
			<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> timedFunction<span style="color: #66cc66;">&#40;</span>eventArgs:TimerEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
			<span style="color: #66cc66;">&#123;</span>
				<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>myRSS._IsReady == <span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #66cc66;">&#41;</span>
				<span style="color: #66cc66;">&#123;</span>
					myTimer.<span style="color: #0066CC;">stop</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;	
					addFish<span style="color: #66cc66;">&#40;</span>myRSS<span style="color: #66cc66;">&#41;</span>;
				<span style="color: #66cc66;">&#125;</span>
			<span style="color: #66cc66;">&#125;</span>
		<span style="color: #808080; font-style: italic;">//Really Helpful for tracing events!	</span>
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> _checkMouseEventTrail<span style="color: #66cc66;">&#40;</span>$e:MouseEvent<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> p:<span style="color: #66cc66;">*</span> =$e.<span style="color: #0066CC;">target</span>;
			<span style="color: #b1b100;">while</span> <span style="color: #66cc66;">&#40;</span>p<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
&nbsp;
				<span style="color: #808080; font-style: italic;">//trace(&quot;&gt;&gt;&quot;, p.name,&quot;: &quot;,p);</span>
				p=p.<span style="color: #006600;">parent</span>;
			<span style="color: #66cc66;">&#125;</span>
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> killAll<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
			xMove.<span style="color: #0066CC;">stop</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			xScaleTracker.<span style="color: #0066CC;">stop</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			yScaleTracker.<span style="color: #0066CC;">stop</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			zScaleTracker.<span style="color: #0066CC;">stop</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			xScaleTracker = <span style="color: #000000; font-weight: bold;">null</span>;
			yScaleTracker = <span style="color: #000000; font-weight: bold;">null</span>;
			zScaleTracker = <span style="color: #000000; font-weight: bold;">null</span>;
			view.<span style="color: #006600;">scene</span>.<span style="color: #006600;">removeChild</span><span style="color: #66cc66;">&#40;</span>twFishOne<span style="color: #66cc66;">&#41;</span>;
			view.<span style="color: #006600;">scene</span>.<span style="color: #006600;">removeChild</span><span style="color: #66cc66;">&#40;</span>twTankC<span style="color: #66cc66;">&#41;</span>;
			xMove = <span style="color: #000000; font-weight: bold;">null</span>;
			twTankC = <span style="color: #000000; font-weight: bold;">null</span>;
			twFishOne = <span style="color: #000000; font-weight: bold;">null</span>;
			<span style="color: #0066CC;">System</span>.<span style="color: #006600;">gc</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Killed&quot;</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> addFish<span style="color: #66cc66;">&#40;</span>myRSS:RSSJSONW<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;">//trace(myRSS._twdata.length);</span>
			<span style="color: #000000; font-weight: bold;">var</span> numFish:<span style="color: #0066CC;">Number</span>;
			<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>myRSS._twdata.<span style="color: #0066CC;">length</span> <span style="color: #66cc66;">&gt;</span>= <span style="color: #cc66cc;">6</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
				numFish = <span style="color: #cc66cc;">6</span>;
			<span style="color: #66cc66;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #66cc66;">&#123;</span>
				numFish = myRSS._twdata.<span style="color: #0066CC;">length</span>;
			<span style="color: #66cc66;">&#125;</span>
			<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>numFish; i++<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
				<span style="color: #808080; font-style: italic;">//trace(view);</span>
				twFishOne=<span style="color: #000000; font-weight: bold;">new</span> TwFish1<span style="color: #66cc66;">&#40;</span>view<span style="color: #66cc66;">&#41;</span>;
				<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>i<span style="color: #66cc66;">!</span>=<span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
					twFishOne.<span style="color: #006600;">x</span>=i<span style="color: #66cc66;">*</span>randRange<span style="color: #66cc66;">&#40;</span>-<span style="color: #cc66cc;">200</span>,<span style="color: #cc66cc;">400</span><span style="color: #66cc66;">&#41;</span>;
					twFishOne.<span style="color: #006600;">y</span>=i<span style="color: #66cc66;">*</span>randRange<span style="color: #66cc66;">&#40;</span>-<span style="color: #cc66cc;">200</span>,<span style="color: #cc66cc;">400</span><span style="color: #66cc66;">&#41;</span>;
					twFishOne.<span style="color: #006600;">z</span>=i<span style="color: #66cc66;">*</span>randRange<span style="color: #66cc66;">&#40;</span>-<span style="color: #cc66cc;">200</span>,<span style="color: #cc66cc;">400</span><span style="color: #66cc66;">&#41;</span>;
				<span style="color: #66cc66;">&#125;</span>
				<span style="color: #000000; font-weight: bold;">var</span> baseFrequency:uint = <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">90</span> <span style="color: #66cc66;">%</span> <span style="color: #cc66cc;">64</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">*</span><span style="color: #cc66cc;">4</span>;
				xMove=<span style="color: #000000; font-weight: bold;">new</span> FunctionTracker<span style="color: #66cc66;">&#40;</span>twFishOne,<span style="color: #ff0000;">&quot;scale&quot;</span>,dancingFish,<span style="color: #66cc66;">&#91;</span>i,twFishOne<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;
				xMove.<span style="color: #0066CC;">start</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
				<span style="color: #808080; font-style: italic;">//trace(twFishOne.x);</span>
				<span style="color: #808080; font-style: italic;">//var fishy:Object3D=twFishOne;</span>
				<span style="color: #808080; font-style: italic;">//twFishOne.clipContainer.addChild(twFishOne);</span>
				<span style="color: #808080; font-style: italic;">//twFishOne.addChild(twFishOne);</span>
				view.<span style="color: #006600;">scene</span>.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span>twFishOne<span style="color: #66cc66;">&#41;</span>;
&nbsp;
				twFishOne.<span style="color: #0066CC;">name</span>=i.<span style="color: #0066CC;">toString</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
				<span style="color: #808080; font-style: italic;">//fishy.layer.blendMode = BlendMode.ADD;</span>
				twFishOne.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent3D.<span style="color: #006600;">MOUSE_DOWN</span>, goFish,<span style="color: #000000; font-weight: bold;">false</span>, <span style="color: #cc66cc;">0</span>, <span style="color: #000000; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span>;
				<span style="color: #0066CC;">System</span>.<span style="color: #006600;">gc</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
			<span style="color: #66cc66;">&#125;</span>
		<span style="color: #66cc66;">&#125;</span>
		protected <span style="color: #000000; font-weight: bold;">function</span> goFish<span style="color: #66cc66;">&#40;</span>event:MouseEvent3D<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;">//trace(myRSS._twdata[int(event.currentTarget.name)]);		</span>
			<span style="color: #000000; font-weight: bold;">var</span> myURL:URLRequest = <span style="color: #000000; font-weight: bold;">new</span> URLRequest<span style="color: #66cc66;">&#40;</span>myRSS._twdata<span style="color: #66cc66;">&#91;</span><span style="color: #0066CC;">int</span><span style="color: #66cc66;">&#40;</span>event.<span style="color: #006600;">currentTarget</span>.<span style="color: #0066CC;">name</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;
			navigateToURL<span style="color: #66cc66;">&#40;</span>myURL<span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> onMouseWheelEvent<span style="color: #66cc66;">&#40;</span>event:MouseEvent<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;">//trace(event.delta);</span>
			TweenLite.<span style="color: #006600;">to</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">camera</span>,<span style="color: #cc66cc;">1</span>,<span style="color: #66cc66;">&#123;</span>z: event.<span style="color: #006600;">delta</span> <span style="color: #66cc66;">*</span> <span style="color: #cc66cc;">500</span> + <span style="color: #0066CC;">camera</span>.<span style="color: #006600;">z</span>,<span style="color: #0066CC;">onUpdate</span>: onCameraMove<span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> keyDown<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:KeyboardEvent<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;">//trace(e);</span>
			<span style="color: #b1b100;">switch</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>.<span style="color: #006600;">keyCode</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
				<span style="color: #b1b100;">case</span> <span style="color: #cc66cc;">32</span> :
					moveCamera<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
					<span style="color: #b1b100;">break</span>;
			<span style="color: #66cc66;">&#125;</span>
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> randRange<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">min</span>:<span style="color: #0066CC;">Number</span>, <span style="color: #0066CC;">max</span>:<span style="color: #0066CC;">Number</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">Number</span> <span style="color: #66cc66;">&#123;</span>
			<span style="color: #808080; font-style: italic;">// Generate a number between and including min - max</span>
			<span style="color: #000000; font-weight: bold;">var</span> randomNum:<span style="color: #0066CC;">Number</span> = <span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">floor</span><span style="color: #66cc66;">&#40;</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>max-<span style="color: #0066CC;">min</span>+<span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>+<span style="color: #0066CC;">min</span>;
			<span style="color: #b1b100;">return</span> randomNum;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> dancingFish<span style="color: #66cc66;">&#40;</span>i:uint, twFishOne:TwFish1<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> baseFrequency:uint = <span style="color: #66cc66;">&#40;</span>i <span style="color: #66cc66;">%</span> <span style="color: #cc66cc;">64</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">*</span><span style="color: #cc66cc;">4</span>;
			<span style="color: #808080; font-style: italic;">//trace(baseFrequency + &quot;-Beat&quot;);</span>
			xScaleTracker=<span style="color: #000000; font-weight: bold;">new</span> FunctionTracker<span style="color: #66cc66;">&#40;</span>twFishOne,<span style="color: #ff0000;">&quot;scaleX&quot;</span>,soundAnalyzer.<span style="color: #006600;">getFrequencyRange</span>,<span style="color: #66cc66;">&#91;</span>baseFrequency,baseFrequency+<span style="color: #cc66cc;">4</span>,<span style="color: #cc66cc;">1</span>,<span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;
			yScaleTracker=<span style="color: #000000; font-weight: bold;">new</span> FunctionTracker<span style="color: #66cc66;">&#40;</span>twFishOne,<span style="color: #ff0000;">&quot;scaleY&quot;</span>,soundAnalyzer.<span style="color: #006600;">getFrequencyRange</span>,<span style="color: #66cc66;">&#91;</span>baseFrequency,baseFrequency+<span style="color: #cc66cc;">4</span>,<span style="color: #cc66cc;">1</span>,<span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;
			zScaleTracker=<span style="color: #000000; font-weight: bold;">new</span> FunctionTracker<span style="color: #66cc66;">&#40;</span>twFishOne,<span style="color: #ff0000;">&quot;scaleZ&quot;</span>,soundAnalyzer.<span style="color: #006600;">getFrequencyRange</span>,<span style="color: #66cc66;">&#91;</span>baseFrequency,baseFrequency+<span style="color: #cc66cc;">4</span>,<span style="color: #cc66cc;">1</span>,<span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;
			TweenLite.<span style="color: #006600;">to</span><span style="color: #66cc66;">&#40;</span>twFishOne, <span style="color: #cc66cc;">5</span>, <span style="color: #66cc66;">&#123;</span>x:twFishOne.<span style="color: #006600;">x</span> + <span style="color: #cc66cc;">50</span>, y:twFishOne.<span style="color: #006600;">y</span> + <span style="color: #cc66cc;">50</span>, z:twFishOne.<span style="color: #006600;">z</span> + <span style="color: #cc66cc;">50</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;
			xScaleTracker.<span style="color: #0066CC;">start</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			yScaleTracker.<span style="color: #0066CC;">start</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			zScaleTracker.<span style="color: #0066CC;">start</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> moveCamera<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;">//trace(&quot;In Move Camera&quot;);</span>
			TweenLite.<span style="color: #006600;">to</span><span style="color: #66cc66;">&#40;</span>
			                    <span style="color: #0066CC;">camera</span>, 
			                    <span style="color: #cc66cc;">4</span>, 
			                    <span style="color: #66cc66;">&#123;</span>
			                        x: Math2.<span style="color: #006600;">rand</span><span style="color: #66cc66;">&#40;</span>-<span style="color: #cc66cc;">9000</span>, <span style="color: #cc66cc;">9000</span><span style="color: #66cc66;">&#41;</span>,
			                        y: Math2.<span style="color: #006600;">rand</span><span style="color: #66cc66;">&#40;</span>-<span style="color: #cc66cc;">9000</span>, <span style="color: #cc66cc;">9000</span><span style="color: #66cc66;">&#41;</span>,
			                        z: <span style="color: #cc66cc;">1400</span> + Math2.<span style="color: #006600;">rand</span><span style="color: #66cc66;">&#40;</span>-<span style="color: #cc66cc;">9800</span>, <span style="color: #cc66cc;">9000</span><span style="color: #66cc66;">&#41;</span>,
			                        delay: <span style="color: #cc66cc;">2</span>,
			                        <span style="color: #0066CC;">onUpdate</span>: onCameraMove
			                    <span style="color: #66cc66;">&#125;</span>
			                <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> onCameraMove<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: #0066CC;">camera</span>.<span style="color: #006600;">lookAt</span><span style="color: #66cc66;">&#40;</span> origin <span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
&nbsp;
		override protected <span style="color: #000000; font-weight: bold;">function</span> onPreRender<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
			Tank.<span style="color: #006600;">rotationY</span>++;
&nbsp;
		<span style="color: #66cc66;">&#125;</span>
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p><a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2ktY3JlYXRlLm9yZy9hY3Rpb25zY3JpcHQvVHdlZXRUYW5rLnppcA==" title=\"TweetTank\">Download Code</a> / <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2ktY3JlYXRlLm9yZy9hY3Rpb25zY3JpcHQvVHdlZXRUYW5rLw==" title=\"TweetTank Away3D with Hype on Flash\" target=\"_blank\">Launch Experiment</a></p>
<p>I also like what I have been seeing in the WebGL community.  I think it would be really cool if haXe created a library for exporting to webGL/JavaScript I think this would have many benefits namely I could use my Away3D skills and export to webGL.  They do currently export to Canvas but at this time I am not aware of any WebGL support within haXe.  HaXe does support openGL for use in its vitual machine Neko so it seems that a library will likely be available soon.</p>
 <img src="http://i-create.org/wp-content/plugins/feed-statistics.php?view=1&post_id=819" 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%2F16%2Faway3d-with-hype-fish-tank-part-2%2F&amp;linkname=Tweet%20Tank%20in%20Away3D%20and%20Hype%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/05/16/away3d-with-hype-fish-tank-part-2/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Tweet Tank in Away3D and Hype</title>
		<link>http://i-create.org/2010/05/10/tweet-tank-in-away3d-and-hype/</link>
		<comments>http://i-create.org/2010/05/10/tweet-tank-in-away3d-and-hype/#comments</comments>
		<pubDate>Tue, 11 May 2010 04:05:59 +0000</pubDate>
		<dc:creator>Brendon Smith</dc:creator>
				<category><![CDATA[3d]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[i-create]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[Away3D]]></category>
		<category><![CDATA[data visualization]]></category>
		<category><![CDATA[Experiment]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[hype]]></category>
		<category><![CDATA[interactive]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://i-create.org/2010/05/10/tweet-tank-in-away3d-and-hype/</guid>
		<description><![CDATA[Alright so I know everyone associates Twitter with birds well all the bird models in the google 3d Warehouse suck. So I decided to make a fish tank because fish are cool. I used away3dlite, hype, and twitter to create this simple 3d / hype experiment. I will give you fare warning it is kind [...]]]></description>
			<content:encoded><![CDATA[<p>Alright so I know everyone associates Twitter with birds well all the bird models in the <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3NrZXRjaHVwLmdvb2dsZS5jb20vM2R3YXJlaG91c2Uv" title=\"3D warehouse\" target=\"_blank\">google 3d Warehouse</a> suck.  So I decided to make a fish tank because fish are cool.  I used <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2F3YXkzZC5jb20vYXdheTNkLWxpdGUtdjEtMC1mYXN0ZXN0LWFuZC1zbWFsbGVzdC0zZC1lbmdpbmUtaW4tZmxhc2g=" title=\"What is Away3dLite\" target=\"_blank\">away3dlite</a>, <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5oeXBlZnJhbWV3b3JrLm9yZy8=" title=\"Hype Framework\" target=\"_blank\">hype</a>, and twitter to create this simple 3d / hype experiment.  I will give you fare warning it is kind of processor intensive and I think if I re-export my models from prefab as a compile .awd this will alleviate some of the performance issues.  The memory management isn&#8217;t so bad but I would like to improve the FPS.  I will say this though in comparison to the html5 / webGL <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2ktY3JlYXRlLm9yZy8yMDEwLzA0LzI2L3dlYmdsLXR3ZWV0dGFuay1idWlsdC13aXRoLWMzZGwtcGFydC0yLw==" title=\"TweetTank WebGL\" target=\"_blank\">TweetTank</a> I believe this one performs better.  It also doesn&#8217;t heat up my Mac book like it is going to take off for space (I have noticed that in Firefox it does heat up when using webGL although it is a pre-alpha).  I was also able to add sound to this version and use away3dlite a really solid 3d library for flash.  This project was pretty easy didn&#8217;t take long to create and <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5jbG9zaWVyLm5sL3ByZWZhYi8=" title=\"Prefab\" target=\"_blank\">PreFab</a> really speed up the process. </p>
<p><a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2ktY3JlYXRlLm9yZy9hY3Rpb25zY3JpcHQvVHdlZXRUYW5rLw==" title=\"TweetTank\" target=\"_blank\">The Experiment:<br />
<img src="http://i-create.org/actionscript/TweetTank/TweetTankAS.jpg" title="Tweet Tank" /><br />
</a></p>
<p>PreFab is an Air application that allows Awary3d scene designers to easily import and export models for use with away3d.  It is also important to note that away3d has spent a significant amount of time to optimize 3d away3d support <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5kZXJzY2htYWxlLmNvbS8yMDEwLzA0LzIyL2JzcHB2cy1yZWxlYXNlZC1pbi1hd2F5LTMtNS0wLw==" title=\"Binary Space Partitioning\" target=\"_blank\">Binary Space Partitioning</a>.  Hopefully in future versions of PreFab we can import .bsp maps that would truly be the cats meow!   I was able to use PreFab to import my .dae files with ease and export them to actionscript with minor changes.  It is nice to create the models as actionscirpt class files you can easily make changes to the class file directly and it didn&#8217;t take long to get them into flash!</p>
<p>In the next version of this fish tank I will make it so you can search twitter and the fish will be populated with your results.  Right now if you click on a fish it will take you to a new window with a twitter search for &#8220;Flash&#8221;.  I will also look at ways to further incorporate Hype and animate the fish more smoothly.  I will also implement more camera support.  In the third version I would like to demonstrate google maps integration and use the map to zoom in on the specific fish.</p>
<p>For those of you interested learning more about <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5hbWF6b24uY29tL0Vzc2VudGlhbC1HdWlkZS0zRC1GbGFzaC9kcC8xNDMwMjI1NDE2" title=\"Away3D Flash Essential Guide\" target=\"_blank\">Away3d I suggest this Amazon book</a> I haven&#8217;t read it yet but I look forward to it I just received it today in the mail.  Away3d is easy to use and I also highly recommend looking at <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5oeXBlZnJhbWV3b3JrLm9yZy9ibG9nL2NvbnRlbnQvaHlwZS1nZXRzLWEtbmV3LWRvbWFpbi8=" title=\"Hype Framework\" target=\"_blank\">Hype</a> this is a really cool framework that really opens up lots of possibilities for your creative output!</p>
<p>The Source Code:</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: #006600;">Sprite</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #006600;">Event</span>;
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> TweetTank <span style="color: #0066CC;">extends</span> Sprite <span style="color: #66cc66;">&#123;</span>
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> twitterFish:tweetFish=<span style="color: #000000; font-weight: bold;">new</span> tweetFish;
&nbsp;
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> TweetTank<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
			addEventListener<span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">ADDED_TO_STAGE</span>, addedToStageHandler, <span style="color: #000000; font-weight: bold;">false</span>, <span style="color: #cc66cc;">0</span>, <span style="color: #000000; font-weight: bold;">true</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> addedToStageHandler<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>
&nbsp;
			addChild<span style="color: #66cc66;">&#40;</span>twitterFish<span style="color: #66cc66;">&#41;</span>;
			twitterFish.<span style="color: #006600;">init</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			twitterFish.<span style="color: #0066CC;">visible</span> = <span style="color: #000000; font-weight: bold;">true</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
&nbsp;
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span>
&nbsp;
package <span style="color: #66cc66;">&#123;</span>
	<span style="color: #0066CC;">import</span> away3dlite.<span style="color: #006600;">containers</span>.<span style="color: #006600;">ObjectContainer3D</span>;
	<span style="color: #0066CC;">import</span> away3dlite.<span style="color: #006600;">materials</span>.<span style="color: #66cc66;">*</span>;
	<span style="color: #0066CC;">import</span> away3dlite.<span style="color: #006600;">materials</span>.<span style="color: #006600;">WireColorMaterial</span>;
	<span style="color: #0066CC;">import</span> away3dlite.<span style="color: #006600;">primitives</span>.<span style="color: #006600;">Cube6</span>;
	<span style="color: #0066CC;">import</span> away3dlite.<span style="color: #006600;">templates</span>.<span style="color: #006600;">BasicTemplate</span>;
	<span style="color: #0066CC;">import</span> away3dlite.<span style="color: #006600;">core</span>.<span style="color: #006600;">base</span>.<span style="color: #66cc66;">*</span>;
	<span style="color: #0066CC;">import</span> away3dlite.<span style="color: #006600;">core</span>.<span style="color: #006600;">utils</span>.<span style="color: #66cc66;">*</span>;
	<span style="color: #0066CC;">import</span> away3dlite.<span style="color: #006600;">events</span>.<span style="color: #66cc66;">*</span>;
	<span style="color: #0066CC;">import</span> twFish.<span style="color: #66cc66;">*</span>;
	<span style="color: #0066CC;">import</span> twTank.<span style="color: #66cc66;">*</span>;
	<span style="color: #0066CC;">import</span> RSSJSONW;
	<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">theflashblog</span>.<span style="color: #006600;">utils</span>.<span style="color: #006600;">Math2</span>;
&nbsp;
	<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">adobe</span>.<span style="color: #006600;">utils</span>.<span style="color: #006600;">XMLUtil</span>;
	<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">adobe</span>.<span style="color: #006600;">serialization</span>.<span style="color: #006600;">json</span>.<span style="color: #006600;">JSON</span>;
	<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">adobe</span>.<span style="color: #0066CC;">xml</span>.<span style="color: #006600;">syndication</span>.<span style="color: #006600;">rss</span>.<span style="color: #006600;">Item20</span>;
	<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">adobe</span>.<span style="color: #0066CC;">xml</span>.<span style="color: #006600;">syndication</span>.<span style="color: #006600;">rss</span>.<span style="color: #006600;">RSS20</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #006600;">IOErrorEvent</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #006600;">EventDispatcher</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #006600;">SecurityErrorEvent</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;">navigateToURL</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: #0066CC;">system</span>.<span style="color: #006600;">Security</span>;
&nbsp;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #006600;">KeyboardEvent</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">ui</span>.<span style="color: #006600;">Keyboard</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;">events</span>.<span style="color: #006600;">MouseEvent</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">geom</span>.<span style="color: #006600;">Vector3D</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;">display</span>.<span style="color: #66cc66;">*</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;">display</span>.<span style="color: #006600;">Bitmap</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #006600;">BlendMode</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> flash.<span style="color: #006600;">filters</span>.<span style="color: #006600;">GlowFilter</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">media</span>.<span style="color: #006600;">SoundChannel</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">utils</span>.<span style="color: #006600;">Timer</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #006600;">TimerEvent</span>;
&nbsp;
&nbsp;
	<span style="color: #0066CC;">import</span> gs.<span style="color: #006600;">TweenLite</span>;
&nbsp;
	<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;">layout</span>.<span style="color: #006600;">GridLayout</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;">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;">extended</span>.<span style="color: #006600;">rhythm</span>.<span style="color: #006600;">FilterCanvasRhythm</span>;
	<span style="color: #0066CC;">import</span> hype.<span style="color: #006600;">extended</span>.<span style="color: #006600;">rhythm</span>.<span style="color: #006600;">FilterRhythm</span>;
&nbsp;
&nbsp;
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> tweetFish <span style="color: #0066CC;">extends</span> BasicTemplate <span style="color: #66cc66;">&#123;</span>
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> bitmapCanvas:BitmapCanvas;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> musicChannel;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> origin:Vector3D=<span style="color: #000000; font-weight: bold;">new</span> Vector3D<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">40</span>,<span style="color: #cc66cc;">900</span><span style="color: #66cc66;">&#41;</span>;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> twFishOne:TwFish1;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> bitmapCanvasBlur:BitmapCanvas;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> twTankC:TwTank1;
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> soundAnalyzer:SoundAnalyzer;
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">sound</span>:<span style="color: #0066CC;">Sound</span>;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> myX:<span style="color: #0066CC;">Number</span>=<span style="color: #cc66cc;">0</span>;
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> layout:GridLayout;
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> Tank:ObjectContainer3D;
		<span style="color: #66cc66;">&#91;</span>Bindable<span style="color: #66cc66;">&#93;</span><span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> myRSS:RSSJSONW;
		Security.<span style="color: #006600;">loadPolicyFile</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;http://twitter.com/crossdomain.xml&quot;</span><span style="color: #66cc66;">&#41;</span>;
		Security.<span style="color: #0066CC;">allowInsecureDomain</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;*&quot;</span><span style="color: #66cc66;">&#41;</span>;
		Security.<span style="color: #0066CC;">allowDomain</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;*&quot;</span><span style="color: #66cc66;">&#41;</span>;
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> myTimer:Timer = <span style="color: #000000; font-weight: bold;">new</span> Timer<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1000</span><span style="color: #66cc66;">&#41;</span>;
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> colourScheme:<span style="color: #0066CC;">Array</span>=<span style="color: #66cc66;">&#91;</span>0x18b849,0x1858b8,0x18b81c,0x18b89c,0xb818b2,0xfd02f4,0x3102fd,0x02b3fd,0x1afd02,0xf4fd02,0xfd02f4,0x3102fd,0x02b3fd,0x1afd02,0xf4fd02<span style="color: #66cc66;">&#93;</span>;
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> tweetFish<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
			<span style="color: #0066CC;">super</span><span style="color: #66cc66;">&#40;</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> init<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: #0066CC;">stage</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">MOUSE_WHEEL</span>, onMouseWheelEvent<span style="color: #66cc66;">&#41;</span>;
			<span style="color: #000000; font-weight: bold;">var</span> filterA:<span style="color: #0066CC;">Array</span>=<span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">Array</span>  ;
			filterA.<span style="color: #0066CC;">push</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> GlowFilter<span style="color: #66cc66;">&#40;</span>0xFFFFFF, <span style="color: #cc66cc;">1</span>, <span style="color: #cc66cc;">19</span>, <span style="color: #cc66cc;">19</span>, <span style="color: #cc66cc;">1</span>, <span style="color: #cc66cc;">1</span>, <span style="color: #000000; font-weight: bold;">false</span>, <span style="color: #000000; font-weight: bold;">false</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #000000; font-weight: bold;">var</span> blur:BlurFilter = <span style="color: #000000; font-weight: bold;">new</span> BlurFilter<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			blur.<span style="color: #006600;">blurX</span>=<span style="color: #cc66cc;">900</span>;
			blur.<span style="color: #006600;">blurY</span>=<span style="color: #cc66cc;">900</span>;
			filterA.<span style="color: #0066CC;">push</span><span style="color: #66cc66;">&#40;</span>blur<span style="color: #66cc66;">&#41;</span>;
			playMusic<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			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>;
			layout=<span style="color: #000000; font-weight: bold;">new</span> GridLayout<span style="color: #66cc66;">&#40;</span>-<span style="color: #cc66cc;">900</span>,-<span style="color: #cc66cc;">175</span>,<span style="color: #cc66cc;">30</span>,<span style="color: #cc66cc;">30</span>,<span style="color: #cc66cc;">60</span><span style="color: #66cc66;">&#41;</span>;
			Tank = <span style="color: #000000; font-weight: bold;">new</span> ObjectContainer3D<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			view.<span style="color: #006600;">scene</span>.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span>Tank<span style="color: #66cc66;">&#41;</span>;
			Tank.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent3D.<span style="color: #006600;">MOUSE_MOVE</span>, goFish,<span style="color: #000000; font-weight: bold;">false</span>, <span style="color: #cc66cc;">0</span>, <span style="color: #000000; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span>;
			twTankC=<span style="color: #000000; font-weight: bold;">new</span> TwTank1<span style="color: #66cc66;">&#40;</span>view<span style="color: #66cc66;">&#41;</span>;
			view.<span style="color: #006600;">scene</span>.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span>twTankC<span style="color: #66cc66;">&#41;</span>;
			view.<span style="color: #006600;">mouseEnabled</span>=<span style="color: #000000; font-weight: bold;">true</span>;
			jsonInit<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;http://search.twitter.com/search.json?q=flash&quot;</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #0066CC;">camera</span>.<span style="color: #006600;">z</span>=-<span style="color: #cc66cc;">2000</span>;
			<span style="color: #0066CC;">camera</span>.<span style="color: #006600;">x</span>=-<span style="color: #cc66cc;">1600</span>;
			<span style="color: #0066CC;">camera</span>.<span style="color: #006600;">y</span>=<span style="color: #cc66cc;">400</span>;
			<span style="color: #0066CC;">camera</span>.<span style="color: #006600;">lookAt</span><span style="color: #66cc66;">&#40;</span> origin <span style="color: #66cc66;">&#41;</span>;
			<span style="color: #0066CC;">stage</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">CLICK</span>,_checkMouseEventTrail,<span style="color: #000000; font-weight: bold;">false</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #000000; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #0066CC;">stage</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>KeyboardEvent.<span style="color: #006600;">KEY_DOWN</span>, keyDown, <span style="color: #000000; font-weight: bold;">false</span>, <span style="color: #cc66cc;">0</span>, <span style="color: #000000; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
		<span style="color: #66cc66;">&#125;</span>
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> jsonInit<span style="color: #66cc66;">&#40;</span>siteFeed:<span style="color: #0066CC;">String</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
			<span style="color: #66cc66;">&#123;</span>
				myRSS = <span style="color: #000000; font-weight: bold;">new</span> RSSJSONW<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;;
				myRSS._data = <span style="color: #ff0000;">&quot;&quot;</span>;
				myRSS._txtURL = siteFeed;
				myRSS.<span style="color: #006600;">onJSON</span><span style="color: #66cc66;">&#40;</span>myRSS._txtURL<span style="color: #66cc66;">&#41;</span>;
				myTimer.<span style="color: #0066CC;">start</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
				myTimer.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;timer&quot;</span>, timedFunction<span style="color: #66cc66;">&#41;</span>;
			<span style="color: #66cc66;">&#125;</span>
			<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> timedFunction<span style="color: #66cc66;">&#40;</span>eventArgs:TimerEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
			<span style="color: #66cc66;">&#123;</span>
				<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>myRSS._IsReady == <span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #66cc66;">&#41;</span>
				<span style="color: #66cc66;">&#123;</span>
					myTimer.<span style="color: #0066CC;">stop</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;	
					addFish<span style="color: #66cc66;">&#40;</span>myRSS<span style="color: #66cc66;">&#41;</span>;
				<span style="color: #66cc66;">&#125;</span>
			<span style="color: #66cc66;">&#125;</span>
		<span style="color: #808080; font-style: italic;">//Really Helpful for tracing events!	</span>
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> _checkMouseEventTrail<span style="color: #66cc66;">&#40;</span>$e:MouseEvent<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> p:<span style="color: #66cc66;">*</span> =$e.<span style="color: #0066CC;">target</span>;
			<span style="color: #b1b100;">while</span> <span style="color: #66cc66;">&#40;</span>p<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
				<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;&gt;&gt;&quot;</span>, p.<span style="color: #0066CC;">name</span>,<span style="color: #ff0000;">&quot;: &quot;</span>,p<span style="color: #66cc66;">&#41;</span>;
				p=p.<span style="color: #006600;">parent</span>;
			<span style="color: #66cc66;">&#125;</span>
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> addFish<span style="color: #66cc66;">&#40;</span>myRSS:RSSJSONW<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:uint = <span style="color: #cc66cc;">0</span>; i<span style="color: #66cc66;">&lt;</span>myRSS._twdata.<span style="color: #0066CC;">length</span>; i++<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
				<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span>view<span style="color: #66cc66;">&#41;</span>;
				twFishOne=<span style="color: #000000; font-weight: bold;">new</span> TwFish1<span style="color: #66cc66;">&#40;</span>view<span style="color: #66cc66;">&#41;</span>;
&nbsp;
				<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>i<span style="color: #66cc66;">!</span>=<span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
					twFishOne.<span style="color: #006600;">x</span>=i<span style="color: #66cc66;">*</span>randRange<span style="color: #66cc66;">&#40;</span>-<span style="color: #cc66cc;">200</span>,<span style="color: #cc66cc;">400</span><span style="color: #66cc66;">&#41;</span>;
					twFishOne.<span style="color: #006600;">y</span>=i<span style="color: #66cc66;">*</span>randRange<span style="color: #66cc66;">&#40;</span>-<span style="color: #cc66cc;">200</span>,<span style="color: #cc66cc;">400</span><span style="color: #66cc66;">&#41;</span>;
					twFishOne.<span style="color: #006600;">z</span>=i<span style="color: #66cc66;">*</span>randRange<span style="color: #66cc66;">&#40;</span>-<span style="color: #cc66cc;">200</span>,<span style="color: #cc66cc;">400</span><span style="color: #66cc66;">&#41;</span>;
				<span style="color: #66cc66;">&#125;</span>
				<span style="color: #000000; font-weight: bold;">var</span> baseFrequency:uint = <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">90</span> <span style="color: #66cc66;">%</span> <span style="color: #cc66cc;">64</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">*</span><span style="color: #cc66cc;">4</span>;
				<span style="color: #000000; font-weight: bold;">var</span> xMove:FunctionTracker=<span style="color: #000000; font-weight: bold;">new</span> FunctionTracker<span style="color: #66cc66;">&#40;</span>twFishOne,<span style="color: #ff0000;">&quot;scale&quot;</span>,dancingFish,<span style="color: #66cc66;">&#91;</span>i,twFishOne<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;
				xMove.<span style="color: #0066CC;">start</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
				<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span>twFishOne.<span style="color: #006600;">x</span><span style="color: #66cc66;">&#41;</span>;
				<span style="color: #000000; font-weight: bold;">var</span> fishy:Object3D=twFishOne;
				<span style="color: #808080; font-style: italic;">//twFishOne.clipContainer.addChild(twFishOne);</span>
				<span style="color: #808080; font-style: italic;">//twFishOne.addChild(twFishOne);</span>
				view.<span style="color: #006600;">scene</span>.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span>twFishOne<span style="color: #66cc66;">&#41;</span>;
&nbsp;
				twFishOne.<span style="color: #0066CC;">name</span>=i.<span style="color: #0066CC;">toString</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
				<span style="color: #808080; font-style: italic;">//fishy.layer.blendMode = BlendMode.ADD;</span>
				fishy.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent3D.<span style="color: #006600;">MOUSE_DOWN</span>, goFish,<span style="color: #000000; font-weight: bold;">false</span>, <span style="color: #cc66cc;">0</span>, <span style="color: #000000; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
&nbsp;
			<span style="color: #66cc66;">&#125;</span>
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> playMusic<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: #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;test.mp3&quot;</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span>;
			musicChannel=<span style="color: #0066CC;">sound</span>.<span style="color: #0066CC;">play</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span>, <span style="color: #0066CC;">int</span>.<span style="color: #0066CC;">MAX_VALUE</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #0066CC;">try</span><span style="color: #66cc66;">&#123;</span>
&nbsp;
			<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>
				musicChannel.<span style="color: #006600;">removeEventListener</span><span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">SOUND_COMPLETE</span>, loopMusic<span style="color: #66cc66;">&#41;</span>;
			<span style="color: #66cc66;">&#125;</span>
			musicChannel.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">SOUND_COMPLETE</span>, loopMusic<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> loopMusic<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: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>musicChannel<span style="color: #66cc66;">!</span>=<span style="color: #000000; font-weight: bold;">null</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
&nbsp;
				playMusic<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #66cc66;">&#125;</span>
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
&nbsp;
		protected <span style="color: #000000; font-weight: bold;">function</span> goFish<span style="color: #66cc66;">&#40;</span>event:MouseEvent3D<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>myRSS._twdata<span style="color: #66cc66;">&#91;</span><span style="color: #0066CC;">int</span><span style="color: #66cc66;">&#40;</span>event.<span style="color: #006600;">currentTarget</span>.<span style="color: #0066CC;">name</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;		
			<span style="color: #000000; font-weight: bold;">var</span> myURL:URLRequest = <span style="color: #000000; font-weight: bold;">new</span> URLRequest<span style="color: #66cc66;">&#40;</span>myRSS._twdata<span style="color: #66cc66;">&#91;</span><span style="color: #0066CC;">int</span><span style="color: #66cc66;">&#40;</span>event.<span style="color: #006600;">currentTarget</span>.<span style="color: #0066CC;">name</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;
			navigateToURL<span style="color: #66cc66;">&#40;</span>myURL<span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> onMouseWheelEvent<span style="color: #66cc66;">&#40;</span>event:MouseEvent<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>event.<span style="color: #006600;">delta</span><span style="color: #66cc66;">&#41;</span>;
			TweenLite.<span style="color: #006600;">to</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">camera</span>,<span style="color: #cc66cc;">1</span>,<span style="color: #66cc66;">&#123;</span>z: event.<span style="color: #006600;">delta</span> <span style="color: #66cc66;">*</span> <span style="color: #cc66cc;">500</span> + <span style="color: #0066CC;">camera</span>.<span style="color: #006600;">z</span>,<span style="color: #0066CC;">onUpdate</span>: onCameraMove<span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> keyDown<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:KeyboardEvent<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: #0066CC;">e</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #b1b100;">switch</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>.<span style="color: #006600;">keyCode</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
				<span style="color: #b1b100;">case</span> <span style="color: #cc66cc;">32</span> :
					moveCamera<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
					<span style="color: #b1b100;">break</span>;
			<span style="color: #66cc66;">&#125;</span>
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> randRange<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">min</span>:<span style="color: #0066CC;">Number</span>, <span style="color: #0066CC;">max</span>:<span style="color: #0066CC;">Number</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">Number</span> <span style="color: #66cc66;">&#123;</span>
			<span style="color: #808080; font-style: italic;">// Generate a number between and including min - max</span>
			<span style="color: #000000; font-weight: bold;">var</span> randomNum:<span style="color: #0066CC;">Number</span> = <span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">floor</span><span style="color: #66cc66;">&#40;</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>max-<span style="color: #0066CC;">min</span>+<span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>+<span style="color: #0066CC;">min</span>;
			<span style="color: #b1b100;">return</span> randomNum;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> dancingFish<span style="color: #66cc66;">&#40;</span>i:uint, twFishOne:TwFish1<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> baseFrequency:uint = <span style="color: #66cc66;">&#40;</span>i <span style="color: #66cc66;">%</span> <span style="color: #cc66cc;">64</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">*</span><span style="color: #cc66cc;">4</span>;
			<span style="color: #808080; font-style: italic;">//trace(baseFrequency + &quot;-Beat&quot;);</span>
			<span style="color: #000000; font-weight: bold;">var</span> xScaleTracker:FunctionTracker=<span style="color: #000000; font-weight: bold;">new</span> FunctionTracker<span style="color: #66cc66;">&#40;</span>twFishOne,<span style="color: #ff0000;">&quot;scaleX&quot;</span>,soundAnalyzer.<span style="color: #006600;">getFrequencyRange</span>,<span style="color: #66cc66;">&#91;</span>baseFrequency,baseFrequency+<span style="color: #cc66cc;">4</span>,<span style="color: #cc66cc;">1</span>,<span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #000000; font-weight: bold;">var</span> yScaleTracker:FunctionTracker=<span style="color: #000000; font-weight: bold;">new</span> FunctionTracker<span style="color: #66cc66;">&#40;</span>twFishOne,<span style="color: #ff0000;">&quot;scaleY&quot;</span>,soundAnalyzer.<span style="color: #006600;">getFrequencyRange</span>,<span style="color: #66cc66;">&#91;</span>baseFrequency,baseFrequency+<span style="color: #cc66cc;">4</span>,<span style="color: #cc66cc;">1</span>,<span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #000000; font-weight: bold;">var</span> zScaleTracker:FunctionTracker=<span style="color: #000000; font-weight: bold;">new</span> FunctionTracker<span style="color: #66cc66;">&#40;</span>twFishOne,<span style="color: #ff0000;">&quot;scaleZ&quot;</span>,soundAnalyzer.<span style="color: #006600;">getFrequencyRange</span>,<span style="color: #66cc66;">&#91;</span>baseFrequency,baseFrequency+<span style="color: #cc66cc;">4</span>,<span style="color: #cc66cc;">1</span>,<span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;
			TweenLite.<span style="color: #006600;">to</span><span style="color: #66cc66;">&#40;</span>twFishOne, <span style="color: #cc66cc;">5</span>, <span style="color: #66cc66;">&#123;</span>x:twFishOne.<span style="color: #006600;">x</span> + <span style="color: #cc66cc;">50</span>, y:twFishOne.<span style="color: #006600;">y</span> + <span style="color: #cc66cc;">50</span>, z:twFishOne.<span style="color: #006600;">z</span> + <span style="color: #cc66cc;">50</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;
			xScaleTracker.<span style="color: #0066CC;">start</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			yScaleTracker.<span style="color: #0066CC;">start</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			zScaleTracker.<span style="color: #0066CC;">start</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> moveCamera<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: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;In Move Camera&quot;</span><span style="color: #66cc66;">&#41;</span>;
			TweenLite.<span style="color: #006600;">to</span><span style="color: #66cc66;">&#40;</span>
			                    <span style="color: #0066CC;">camera</span>, 
			                    <span style="color: #cc66cc;">4</span>, 
			                    <span style="color: #66cc66;">&#123;</span>
			                        x: Math2.<span style="color: #006600;">rand</span><span style="color: #66cc66;">&#40;</span>-<span style="color: #cc66cc;">9000</span>, <span style="color: #cc66cc;">9000</span><span style="color: #66cc66;">&#41;</span>,
			                        y: Math2.<span style="color: #006600;">rand</span><span style="color: #66cc66;">&#40;</span>-<span style="color: #cc66cc;">9000</span>, <span style="color: #cc66cc;">9000</span><span style="color: #66cc66;">&#41;</span>,
			                        z: <span style="color: #cc66cc;">1400</span> + Math2.<span style="color: #006600;">rand</span><span style="color: #66cc66;">&#40;</span>-<span style="color: #cc66cc;">9800</span>, <span style="color: #cc66cc;">9000</span><span style="color: #66cc66;">&#41;</span>,
			                        delay: <span style="color: #cc66cc;">2</span>,
			                        <span style="color: #0066CC;">onUpdate</span>: onCameraMove
			                    <span style="color: #66cc66;">&#125;</span>
			                <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> onCameraMove<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: #0066CC;">camera</span>.<span style="color: #006600;">lookAt</span><span style="color: #66cc66;">&#40;</span> origin <span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
&nbsp;
		override protected <span style="color: #000000; font-weight: bold;">function</span> onPreRender<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
			Tank.<span style="color: #006600;">rotationY</span>++;
&nbsp;
		<span style="color: #66cc66;">&#125;</span>
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p><a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2ktY3JlYXRlLm9yZy9hY3Rpb25zY3JpcHQvVHdlZXRUYW5rLnppcA==" title=\"TweetTank\">Download Code</a> / <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2ktY3JlYXRlLm9yZy9hY3Rpb25zY3JpcHQvVHdlZXRUYW5rLw==" title=\"TweetTank Away3D with Hype on Flash\" target=\"_blank\">Launch Experiment</a></p>
<p>Cool Links:<br />
<a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5oeXBlZnJhbWV3b3JrLm9yZw==" title=\"Hype\" target=\"_blank\">Hype</a><br />
<a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5oeXBlZnJhbWV3b3JrLm9yZy9ibG9nLw==" title=\"Hype Blog\" target=\"_blank\">Hype Blog</a><br />
<a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5jbG9zaWVyLm5sL3ByZWZhYi8=" title=\"PreFab\" target=\"_blank\">Prefab</a><br />
<a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5jbG9zaWVyLm5sL2Jsb2cv" title=\"Prefab\" target=\"_blank\">Prefab &#8211; blog</a><br />
<a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy53ZW1ha2Vkb3Rjb21zLmNvbS9ibG9nLzIwMTAvMDIvMTkvaS1saWtlLWh5cGUv" title=\"Hype Away3D\" target=\"_blank\">Relly Cool Hype Away3d Example</a><br />
<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=aHR0cDovL3d3dy5hemFyYXNrLmluL2Jsb2cvcG9zdC9jb250ZXh0ZnJlZWpzLWFsZ29yaXRobS1pbmstbWFraW5nLWFydC13aXRoLWphdmFzY3JpcHQvP3V0bV9zb3VyY2U9dHdpdHRlcmZlZWQmYW1wO3V0bV9tZWRpdW09dHdpdHRlcg==" title=\"Context Free Art\" target=\"_blank\">Context Free Art with JavaScript</a></p>
 <img src="http://i-create.org/wp-content/plugins/feed-statistics.php?view=1&post_id=812" 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%2F10%2Ftweet-tank-in-away3d-and-hype%2F&amp;linkname=Tweet%20Tank%20in%20Away3D%20and%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/05/10/tweet-tank-in-away3d-and-hype/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Away3D with Hype Fish Tank</title>
		<link>http://i-create.org/2010/05/03/away3d-with-hype-fish-tank/</link>
		<comments>http://i-create.org/2010/05/03/away3d-with-hype-fish-tank/#comments</comments>
		<pubDate>Mon, 03 May 2010 05:29:15 +0000</pubDate>
		<dc:creator>Brendon Smith</dc:creator>
				<category><![CDATA[3d]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[i-create]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[Away3D]]></category>
		<category><![CDATA[Experiment]]></category>
		<category><![CDATA[hype]]></category>
		<category><![CDATA[PreFab]]></category>

		<guid isPermaLink="false">http://i-create.org/2010/05/03/away3d-with-hype-fish-tank/</guid>
		<description><![CDATA[Well for awhile I was experimenting with C3DL which I like and will continue to play with in my spare time (Becuase it needs lots of refinement it is really rough). This is a flash rendering of the same experiment I will break this into several tutorials in the next couple weeks and post the [...]]]></description>
			<content:encoded><![CDATA[<p>Well for awhile I was experimenting with <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5jM2RsLm9yZy8=" title=\"C3DL WebGL library\" target=\"_blank\">C3DL</a> which I like and will continue to play with in my spare time (Becuase it needs lots of refinement it is really rough). This is a flash rendering of the same experiment I will break this into several tutorials in the next couple weeks and post the code.  In short I used <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5jbG9zaWVyLm5sL3ByZWZhYi8=" title=\"PreFab\" target=\"_blank\">PreFab</a> to manage my models and I am really pleased with how easy it was to use!  I have also decided to add sound to the experiment.  I am also using the <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5oeXBlZnJhbWV3b3JrLm9yZy8=" title=\"HypeFramework Generative Art ToolKit\" target=\"_blank\">hype framework</a>.  I would like to make the fish in the Tank have a swarming effect.  The swarming effect utilizes a point.  I would like to look at modifying this so it could also except a vector.  I will look at diving into this in the future.  RIght now if you click on them they will not go to a twitter result this functionality and twitter search will be built into it at a later date probably next weekend.  If you click on the spacebar the camera will zoom randomly if you spin the mouse wheel you will pivot around the center points.  I will add more control in the near future.  I really like the amount of control I have with the combination of Hype and <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2F3YXkzZC5jb20v" title=\"Away3D\" target=\"_blank\">Away3D</a> this experiment was fun to put together.  I am looking forward to refining it.  The fish also currently dance to the music (Only if sound is not currently running in another tab like Youtube) I will work on smoothing these features out. I did get into a gotcha with mouse events in away3d and it was caused by a blur feature I added to a bitmap canvas it took me awhile to track down the issue and I found this helpful chunk of code on my quest to debug it.  <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5iaWdzcGFjZXNoaXAuY29tL2Jsb2cvbGFicy9zbmFyaW5nLW1vdXNlZW5hYmxlZC8=" title=\"Tracking Down ActionScript Events\" target=\"_blank\">Check it out</a> this is a life saver for tracking events down in ActionScript.</p>
<p><a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2ktY3JlYXRlLm9yZy9hY3Rpb25zY3JpcHQvVHdlZXRUYW5rLw==" target=\"_blank\" title=\"Away3D / Hype Experiment\">Click Here</a><br />
<a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2ktY3JlYXRlLm9yZy9hY3Rpb25zY3JpcHQvVHdlZXRUYW5rLw==" target=\"_blank\" title=\"Away3D / Hype Experiment\"><img src="http://i-create.org/actionscript/TweetTank/TweetTank.jpg" title="Dancing Fish With Away3D and Hype" /></a></p>
<p>I enjoyed working with prefab it is an excellent tool that will greatly speed up your away3d work-flow.  The guys that built away3d have a<a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5hbWF6b24uY29tL0Vzc2VudGlhbC1HdWlkZS0zRC1GbGFzaC9kcC8xNDMwMjI1NDE2L3JlZj1zcl8xX2ZrbXIwXzE/aWU9VVRGOCZhbXA7cWlkPTEyNzI4NjM3NDYmYW1wO3NyPTgtMS1ma21yMA==" title=\"Away3D Flash 3D Essentials\" target=\"_blank\"> book coming out</a> from Friends of Ed.  I personally can&#8217;t wait to receive it in the mail.  I also hope to see a HypeFramework book in the near future as well.  It is definetly an exciting time to be a flash developer.  I am really looking forward to flash being on Android.  It will be fun to use the HypeFramework with the accelerometer etc..</p>
<p>I have been busy working.  I have really been studying HTML5 and I am really excited about it.  I think WebGL is really cool although I also think the browsers should open up sound streams in the browser so they can be interpreted.  Currently Flash can interpret sound but you can&#8217;t make a mashUp with youtube and interpret sound from that location because that would not be inline with the Flash Security model. I have also been keeping my eye on javascript frameworks that are geared toward mobile.  I recommend looking at jQTouch and Sprout Core they have lots of potential.  CSS3 is definitely the holy grail of CSS.  The CSS transforms that are allowed on Webkit are awesome.  Hopefully all the other browsers will follow suit (I won&#8217;t hold my breath for Internet Exploder).  I am looking forward to putting together more content that is just geared at mobile devices.  I also have been playing around with the iPhone SDK I got Wolfenstein to run on my iPhone emulator this week:)</p>
<p>Flash Links:<br />
<a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5oeXBlZnJhbWV3b3JrLm9yZy8=" title=\"HypeFramework Generative Art ToolKit\" target=\"_blank\">Hype Framework</a><br />
<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=aHR0cDovL3d3dy5jbG9zaWVyLm5sL3ByZWZhYi8=" title=\"PreFab\" target=\"_blank\">PreFab</a></p>
<p>WebGL 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=aHR0cDovL3d3dy5jM2RsLm9yZy8=" title=\"C3DL WebGL\" target=\"_blank\">C3DL</a><br />
<a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2VuZXJnaXplLmNjLw==" title=\"Energize WebGL\" target=\"_blank\">Energize</a><br />
<a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5nbGdlLm9yZy8=" title=\"GLGE WebGL\" target=\"_blank\">GlGE</a></p>
<p>JavaScript:<br />
<a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5qcXRvdWNoLmNvbS8=" title=\"jQTouch\" target=\"_blank\">jQTouch</a><br />
<a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5zcHJvdXRjb3JlLmNvbS8=" title=\"Sprout Core\" target=\"_blank\">Sprout Core</a><br />
<a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3NjcmlwdHkyLmNvbS8=" title=\"Scripty\" target=\"_blank\">Scripty</a><br />
<a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3Byb2Nlc3Npbmdqcy5vcmcv" title=\"ProcessingJS\" target=\"_blank\">ProcessingJS</a></p>
 <img src="http://i-create.org/wp-content/plugins/feed-statistics.php?view=1&post_id=810" 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%2F03%2Faway3d-with-hype-fish-tank%2F&amp;linkname=Away3D%20with%20Hype%20Fish%20Tank"><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/03/away3d-with-hype-fish-tank/feed/</wfw:commentRss>
		<slash:comments>0</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>Simple Flip3D in ActionScript3</title>
		<link>http://i-create.org/2010/04/11/simple-flip3d-in-actionscript3/</link>
		<comments>http://i-create.org/2010/04/11/simple-flip3d-in-actionscript3/#comments</comments>
		<pubDate>Sun, 11 Apr 2010 21:31:15 +0000</pubDate>
		<dc:creator>Brendon Smith</dc:creator>
				<category><![CDATA[3d]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[QuickTip]]></category>
		<category><![CDATA[i-create]]></category>
		<category><![CDATA[Experiment]]></category>

		<guid isPermaLink="false">http://i-create.org/2010/04/11/simple-flip3d-in-actionscript3/</guid>
		<description><![CDATA[This code will show you how to develop a simple native actionscript3d Class it shows you two different methods you could use to develop your own flip 3d effect in ActionScript3 this uses Flash Player 10. This code also only uses the built in functionality of Flash with the exception of the use of Tweener [...]]]></description>
			<content:encoded><![CDATA[<p>This code will show you how to develop a simple native actionscript3d Class it shows you two different methods you could use to develop your own flip 3d effect in ActionScript3 this uses Flash Player 10.  This code also only uses the built in functionality of Flash with the exception of the use of <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2NvZGUuZ29vZ2xlLmNvbS9wL3R3ZWVuZXIv" title=\"Tweener ActionScript Animation Library\" target=\"_blank\">Tweener</a> Class used in one of the way you could potentially animate it.  You could also use a 3d library like <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2Jsb2cucGFwZXJ2aXNpb24zZC5vcmcv" title=\"PaperVision3D\" target=\"_blank\">Papaervision3D</a> or <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2F3YXkzZC5jb20v" title=\"Away3D\" target=\"_blank\">Away3D</a> and these libraries would give your more options and greater control but this is just a simple 3D flip using rotationX property of flash.  This shows you how you might go about creating a Rolodex like effect in flash.  I have also made the code more reusable because it is a class of its own that can be linked to a flash movie clip dragged on the stage and then called and reused easily.  One of the many great features of flash is the ability to change visual objects into classes (Visual <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2VuLndpa2lwZWRpYS5vcmcvd2lraS9PYmplY3Qtb3JpZW50ZWRfcHJvZ3JhbW1pbmc=" title=\"What is OOP?\" target=\"_blank\">OOP</a>) of there own rapidly! I have written code that basically once applied to a movie clip will randomly display a frame you will see this in the class you can expand it add new frames to the array etc..  What it does is randomly picks a frame displays the image and then once clicked will rotate the X property of the movie to about 84 degrees and disappear.  It also shows you two different ways you could accomplish this task.  One way the way I like the best is to use Tweener an animation library that has been around in the Flash community for years.  Tweener frees you from the time line in other words your animation is time based instead of frame based.  Time based is completely the way to go this ensures your users that they will have the same effect and performance regardless.  Time based animation effects have been around in the Flash community for years actually <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5hbWF6b24uY29tL1JvYmVydC1QZW5uZXJzLVByb2dyYW1taW5nLU1hY3JvbWVkaWEtRmxhc2gvZHAvMDA3MjIyMzU2MQ==" title=\"Robert Penner wrote an excellent book Programming Macromedia Flash MX\" target=\"_blank\">Robert Penner wrote an excellent book Programming Macromedia Flash MX</a> years ago I would recommend this book to anyone who is interested in learning the inner workings of easing equations for animation.  His book inspired many animation libraries to be built and his equations can actually be found in many JavaScript animation libraries as well.  Frame based animations tend to not always run at the speed of the Timeline FPS as a result they can lag and display a jumpy performance.  If you would like a frame based approach I have included one that show you you can call a click function and then tie it to an EnterFrame event and that triggers the animation if you so please.</p>
<p><a class=\"thickbox\" title=\"Simple Flip3D Flash Example\" href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2ktY3JlYXRlLm9yZy9hY3Rpb25zY3JpcHQvc2ltcGxlRmxpcDNEL2luZGV4Lmh0bWw/S2VlcFRoaXM9dHJ1ZSYjMDM4O1RCX2lmcmFtZT10cnVlJmFtcDtoZWlnaHQ9MzM4JiMwMzg7d2lkdGg9OTAw"><img src="http://i-create.org/actionscript/simpleFlip3D/simpleFlip3d_ActionScript3.jpg" alt="SimpleFlip3D in Flash"/></a></p>
<p>Call the Class from the Frame</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> flipID:uint = <span style="color: #000000; font-weight: bold;">new</span> uint<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #000000; font-weight: bold;">var</span> sc9MainPortImg1:sc9MainPortImg = <span style="color: #000000; font-weight: bold;">new</span> sc9MainPortImg<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
addChild<span style="color: #66cc66;">&#40;</span>sc9MainPortImg1<span style="color: #66cc66;">&#41;</span>;
sc9MainPortImg1.<span style="color: #006600;">x</span>=<span style="color: #cc66cc;">0</span>;
sc9MainPortImg1.<span style="color: #006600;">y</span>=<span style="color: #cc66cc;">55</span>;
sc9MainPortImg1.<span style="color: #0066CC;">name</span> = <span style="color: #ff0000;">&quot;sc9Img&quot;</span>+flipID;
sc9MainPortImg1.<span style="color: #006600;">buttonMode</span> = <span style="color: #000000; font-weight: bold;">true</span>;
sc9MainPortImg1.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">MOUSE_DOWN</span>, sc9PortClick<span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> sc9PortClick<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:MouseEvent<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
<span style="color: #000000; font-weight: bold;">var</span> sc9MainPortImg1:sc9MainPortImg = <span style="color: #000000; font-weight: bold;">new</span> sc9MainPortImg<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
addChildAt<span style="color: #66cc66;">&#40;</span>sc9MainPortImg1,<span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>;
sc9MainPortImg1.<span style="color: #006600;">x</span>=<span style="color: #cc66cc;">0</span>;
sc9MainPortImg1.<span style="color: #006600;">y</span>=<span style="color: #cc66cc;">55</span>;	
sc9MainPortImg1.<span style="color: #0066CC;">name</span> = <span style="color: #ff0000;">&quot;sc9Img&quot;</span>+flipID++;
<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span>sc9MainPortImg1.<span style="color: #0066CC;">name</span><span style="color: #66cc66;">&#41;</span>;
sc9MainPortImg1.<span style="color: #006600;">buttonMode</span> = <span style="color: #000000; font-weight: bold;">true</span>;
sc9MainPortImg1.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">CLICK</span>, sc9PortClick<span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>The actual Simple Flip 3D Class</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: #0066CC;">MovieClip</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;">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;">events</span>.<span style="color: #66cc66;">*</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;">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> flash.<span style="color: #006600;">net</span>.<span style="color: #0066CC;">LocalConnection</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> caurina.<span style="color: #006600;">transitions</span>.<span style="color: #006600;">Tweener</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">external</span>.<span style="color: #006600;">ExternalInterface</span>;
&nbsp;
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> sc9MainPortImg <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> n:<span style="color: #0066CC;">Number</span>;
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> sc9MainPortImg<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
			randomFrame<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #0066CC;">this</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">CLICK</span>, spinClick<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> randomFrame<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: #000000; font-weight: bold;">var</span> frameArray:<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>;
			frameArray<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#93;</span>=<span style="color: #cc66cc;">1</span>;
			frameArray<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#93;</span>=<span style="color: #cc66cc;">2</span>;
			frameArray<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#93;</span>=<span style="color: #cc66cc;">3</span>;
			frameArray<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">3</span><span style="color: #66cc66;">&#93;</span>=<span style="color: #cc66cc;">4</span>;
			<span style="color: #808080; font-style: italic;">// Get random number created</span>
			n=randRange<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1</span>,<span style="color: #cc66cc;">4</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span>n<span style="color: #66cc66;">&#41;</span>;
			<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span>frameArray<span style="color: #66cc66;">&#41;</span>;
			<span style="color: #808080; font-style: italic;">// gotoAndStop Frame lable name</span>
			<span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">gotoAndStop</span><span style="color: #66cc66;">&#40;</span>frameArray<span style="color: #66cc66;">&#91;</span>n<span style="color: #66cc66;">&#93;</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> spinClick<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:MouseEvent<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;">//this.addEventListener(Event.ENTER_FRAME, spin); --&gt; Enable for Frame Based Animation Example </span>
			<span style="color: #000000; font-weight: bold;">var</span> open_tween=<span style="color: #66cc66;">&#123;</span>rotationX:-<span style="color: #cc66cc;">84</span>,alpha:<span style="color: #cc66cc;">0.0</span>,<span style="color: #0066CC;">time</span>:<span style="color: #cc66cc;">20</span>,transition:<span style="color: #ff0000;">&quot;easeoutelastic&quot;</span>,delay:<span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#125;</span>;
			Tweener.<span style="color: #006600;">addTween</span><span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">this</span>, open_tween<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> spin<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:Event<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
			<span style="color: #0066CC;">this</span>.<span style="color: #006600;">rotationX</span> -= <span style="color: #cc66cc;">2</span>;
			<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">this</span>.<span style="color: #006600;">rotationX</span> == -<span style="color: #cc66cc;">84</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
				<span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">visible</span> = <span style="color: #000000; font-weight: bold;">false</span>;
				<span style="color: #0066CC;">this</span>.<span style="color: #006600;">removeEventListener</span><span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">ENTER_FRAME</span>, spin<span style="color: #66cc66;">&#41;</span>;
			<span style="color: #66cc66;">&#125;</span>
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> randRange<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">min</span>:<span style="color: #0066CC;">Number</span>, <span style="color: #0066CC;">max</span>:<span style="color: #0066CC;">Number</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">Number</span> <span style="color: #66cc66;">&#123;</span>
				<span style="color: #808080; font-style: italic;">// Generate a number between and including min - max</span>
				<span style="color: #000000; font-weight: bold;">var</span> randomNum:<span style="color: #0066CC;">Number</span> = <span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">floor</span><span style="color: #66cc66;">&#40;</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>max-<span style="color: #0066CC;">min</span>+<span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>+<span style="color: #0066CC;">min</span>;
				<span style="color: #b1b100;">return</span> randomNum;
		<span style="color: #66cc66;">&#125;</span>
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p><a class=\"thickbox\" title=\"Simple Flip3D Flash Example\" href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2ktY3JlYXRlLm9yZy9hY3Rpb25zY3JpcHQvc2ltcGxlRmxpcDNEL2luZGV4Lmh0bWw/S2VlcFRoaXM9dHJ1ZSYjMDM4O1RCX2lmcmFtZT10cnVlJmFtcDtoZWlnaHQ9MzM4JiMwMzg7d2lkdGg9OTAw">Launch Experiment</a> / <a title=\"Download the Code - Simple Flip3D Flash Example\" href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2ktY3JlYXRlLm9yZy9hY3Rpb25zY3JpcHQvc2ltcGxlRmxpcDNELnppcA==">Download Code</a></p>
 <img src="http://i-create.org/wp-content/plugins/feed-statistics.php?view=1&post_id=801" 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%2Fsimple-flip3d-in-actionscript3%2F&amp;linkname=Simple%20Flip3D%20in%20ActionScript3"><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/simple-flip3d-in-actionscript3/feed/</wfw:commentRss>
		<slash:comments>0</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>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>404 Errors Hyped With PaperVision3d</title>
		<link>http://i-create.org/2009/12/20/404-errors-hyped-with-papervision3d/</link>
		<comments>http://i-create.org/2009/12/20/404-errors-hyped-with-papervision3d/#comments</comments>
		<pubDate>Sun, 20 Dec 2009 06:12:57 +0000</pubDate>
		<dc:creator>Brendon Smith</dc:creator>
				<category><![CDATA[3d]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[Experiment]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[hype]]></category>
		<category><![CDATA[Joshua Davis]]></category>
		<category><![CDATA[PaperVision3D]]></category>

		<guid isPermaLink="false">http://i-create.org/?p=725</guid>
		<description><![CDATA[404 Error Pages don&#8217;t have to be boring. Especially if you develop rich internet applications and have access to awesome tools like PaperVision3d and Hype! This is a two part example. This example just shows you simple code to create a planes in PaperVision3d make them follow your mouse. I also used SoundSnap to snag [...]]]></description>
			<content:encoded><![CDATA[<p>404 Error Pages don&#8217;t have to be boring.  Especially if you develop rich internet applications and have access to awesome tools like <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2Jsb2cucGFwZXJ2aXNpb24zZC5jb20=" target=\"_blank\" title=\"PaperVision3d\">PaperVision3d</a> and <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2h5cGUuam9zaHVhZGF2aXMuY29tLw==" target=\"_blank\" title=\"Hype\">Hype</a>!  This is a two part example.  This example just shows you simple code to create a planes in <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2Jsb2cucGFwZXJ2aXNpb24zZC5jb20=" target=\"_blank\" title=\"PaperVision3d\">PaperVision3d</a> make them follow your mouse.  I also used <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5zb3VuZHNuYXAuY29tLw==" target=\"_blank\" title=\"Sound Snap\">SoundSnap</a> to snag some short-circuit static for background noise.  I also used Hype to analyze the sound this is literally an out of the box example of Hype.  What is hype?  Hype is a new framework for quickly putting together highly interactive eye-candy.  Hype was created by <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2pvc2h1YWRhdmlzLmNvbS8=" target=\"_blank\" title=\"Joshua Davis\">Joshua Davis</a> and <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5hdXRvbWF0YXN0dWRpb3MuY29tLw==" target=\"_blank\" title=\"Brendan Hall\">Brendan Hall</a>.  It has special methods like Color Pool, Grids, Vibrations Effects, Sound Analysis, just to name a few in short its wicked cool.  I am looking forward to playing around with it more it&#8217;s just a matter of finding the time.  This was just something I was thinking about placing on my new interactive portfolio.  I am going to create a 404 page that utilizes these libraries.  This part only shows you the audio analysis(please note the analysis will fail if you are playing youtube or something else in another window), papervision3d plane code, and vibration effect applied to a movie.  In part two I will add a parallax effect to give this error page more depth.  Mash it with a search that pulls results from i-create (I will pull the URL from the browser with JavaScript) and also has hidden gems in it.  I will hope to really dig into hype more.  Sometimes it can be fun to make websites that are distracting on purpose read like a choose your own adventure album.  I can show an example like this and now show you one of my favorite sites.  You have to go out and check out <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5hYm5vcm1hbGJlaGF2aW9yY2hpbGQuY29tLw==" target=\"_blank\" title=\"Abnormal Behavior Child\">ABC (Abnormal Behavior Child)</a> I think he originally made this style and his site is setup more like a personal odyssey.</p>
<p><a class=\"thickbox\" title=\"Fun with Hype and PaperVision3d\" href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2ktY3JlYXRlLm9yZy9hY3Rpb25zY3JpcHQvNDA0ZS80MDRlLmh0bWw/S2VlcFRoaXM9dHJ1ZSZhbXA7P1RCX2lmcmFtZT10cnVlJmFtcDtoZWlnaHQ9NjUwJmFtcDt3aWR0aD05MDA="><img width="325px" src="http://i-create.org/actionscript/404e/404eStill.png" alt="404e"/></a></p>
<p>Code for the Class Code Behind:</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: #006600;">Event</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;">events</span>.<span style="color: #66cc66;">*</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;">events</span>.<span style="color: #006600;">Event</span>;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #006600;">MouseEvent</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> 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;">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;">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;">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> 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>;
&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> 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> renderer:BasicRenderEngine;
&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;">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;">//</span>
			init3D<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			createPlane<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>;
&nbsp;
&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>;
			addChild<span style="color: #66cc66;">&#40;</span> viewport <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>;
			<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>;
			<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>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> createPlane<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</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,.6<span style="color: #66cc66;">&#41;</span>;
			material3.<span style="color: #006600;">doubleSided</span>=<span style="color: #000000; font-weight: bold;">true</span>;
&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;
			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>;
&nbsp;
			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>;
		<span style="color: #66cc66;">&#125;</span>
&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: #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>
			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>;
			<span style="color: #808080; font-style: italic;">//</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>;
		<span style="color: #66cc66;">&#125;</span>
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>Below are the actions that are applied to the time-line with in the Movie</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;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>Sometimes it can be fun to make something that is distracting.  Kind of reminds me of my college days.  Life drawing for about 3 hours(which beats the hell out of Biology and Business lectures) in the morning and then off to do some display work at the Hitchin Post a clothing store I worked at for years.  I always had opportunities to use my creative skills with display work their.  You know you&#8217;ve created great display work when people ask for things out of the window.  Display work also used to make retail work easy people see something like it and want to buy hence you don&#8217;t need to talk to them.  It can be fun to make things interactive!  People like eye-candy.  Anyway exercises like these help make you a little bit more creative.  At least that was the case for these well known display artists <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2VuLndpa2lwZWRpYS5vcmcvd2lraS9KYXNwZXJfSm9obnM=" target=\"_blank\" title=\"Who is Jasper Johns\">Jasper Johns</a> and <a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2VuLndpa2lwZWRpYS5vcmcvd2lraS9BbmR5X1dhcmhvbA==" target=\"_blank\" title=\"Who is Andy Warhol\">Andy Warhol</a>.  Anyway enough ranting it is Saturday night.  I can&#8217;t wait until my Media Temple migration is complete and my new interactive portfolio is done.  Than I can work on new projects.  Ya thanks Josh and Brendan the Hype Framework is like an awesome set of paints!</p>
<p>Cool Sites to Check Out:<br />
<a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3d3dy5hYm5vcm1hbGJlaGF2aW9yY2hpbGQuY29tLw==" target=\"_blank\" title=\"Abnormal Behavior Child\">ABC</a><br />
<a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL3NhbWl6ZGF0LmNjL2N5b2Ev" target=\"_blank\" title=\"Choose Your Own Adventure and Informatics\">Choose Your Own Adventure and Informatics</a></p>
<p>Cool Frameworks to Check Out:<br />
<a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2Jsb2cucGFwZXJ2aXNpb24zZC5jb20=" target=\"_blank\" title=\"PaperVision3d\">PaperVision3D</a><br />
<a href="http://i-create.org/wp-content/plugins/feed-statistics.php?url=aHR0cDovL2h5cGUuam9zaHVhZGF2aXMuY29tLw==" target=\"_blank\" title=\"Hype\">Hype</a></p>
 <img src="http://i-create.org/wp-content/plugins/feed-statistics.php?view=1&post_id=725" 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%2F20%2F404-errors-hyped-with-papervision3d%2F&amp;linkname=404%20Errors%20Hyped%20With%20PaperVision3d"><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/20/404-errors-hyped-with-papervision3d/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</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 h