<?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>Blowing Through Lines</title>
	<atom:link href="http://blowingthroughlines.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blowingthroughlines.com</link>
	<description>Highly addictive code.</description>
	<lastBuildDate>Tue, 15 Jun 2010 18:14:52 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>BP Oil Spill in Perspective</title>
		<link>http://blowingthroughlines.com/2010/06/15/uncategorized/bp-oil-spill-in-perspective/</link>
		<comments>http://blowingthroughlines.com/2010/06/15/uncategorized/bp-oil-spill-in-perspective/#comments</comments>
		<pubDate>Tue, 15 Jun 2010 18:14:52 +0000</pubDate>
		<dc:creator>nilloc</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blowingthroughlines.com/?p=247</guid>
		<description><![CDATA[Govt. Estimate of oil leak quoted in Wall Street Journal 6/9/2010
-------------------------------------------------------------
    642,994,775,000,000,000 gallons of water in the gulf (est).
                  1,800,000 gallons per day of oil leaking into gulf (govt. est).
      [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<pre style="overflow:auto">Govt. Estimate of oil leak quoted in Wall Street Journal 6/9/2010
-------------------------------------------------------------
    642,994,775,000,000,000 gallons of water in the gulf (est).
                  1,800,000 gallons per day of oil leaking into gulf (govt. est).
                         50 days of leaking.
                 90,000,000 total gallons leaked so far (govt. est).
            0.0000000139970 % of the gulf—by volume—ruined so far.

NOAA Estimates of gulf oil leak
-------------------------------
                  4,200,000 gallons of oil per day (NOAA est).
                         50 days of leaking.
                210,000,000 total gallons leaked so far (NOAA est).
            0.0000000326597 % of the gulf—by volume—ruined so far.

Ocean-wide calculations
-----------------------
446,450,767,880,000,000,000 gallons of water in the world (est).
                  1,800,000 gallons per day of oil leaking into gulf (govt. est).
                         50 days of leaking.
                 90,000,000 total gallons leaked so far (govt. est).
            0.0000000000202 % of the world's ocean—by volume—ruined by the gulf leak so far (govt. est).

                  4,200,000 gallons of oil per day (NOAA est).
                         50 days of leaking.
                210,000,000 total gallons leaked so far (NOAA est).
            0.0000000000470 % of the world's ocean ruined by the gulf leak so far (NOAA est).

My personal estimates of how long it will take to stop the gulf oil leak
------------------------------------------------------------------------
                    180,000 Barrels of oil leaking per day.
                  7,560,000 gallons of oil per day (my estimate).
                      1,095 days of leaking (3 years).
              8,278,200,000 total gallons will leak (that's over 8 and a quarter billion).
            0.0000012874444 % of the gulf—by volume—will be ruined (not nearly as small a number as it looks).
            0.0000000018542 % of the world's oceans—by volume—will be ruined.</pre>
<h3>My reason for doing this.</h3>
<p>The Gulf of Mexico oil leak awful, but humans are still pretty small part of the world&emdash;by volume. Not that we aren&#8217;t trying our damnedest to be a big part. This just sucks and I have a hard time believing we can do anything about it.</p>


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://blowingthroughlines.com/2010/06/15/uncategorized/bp-oil-spill-in-perspective/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wear Your Mass Quantities of Code</title>
		<link>http://blowingthroughlines.com/2010/05/25/uncategorized/wear-your-mass-quantities-of-code/</link>
		<comments>http://blowingthroughlines.com/2010/05/25/uncategorized/wear-your-mass-quantities-of-code/#comments</comments>
		<pubDate>Tue, 25 May 2010 17:42:25 +0000</pubDate>
		<dc:creator>niche</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA["blowing through lines" "headline t-shirts"]]></category>

		<guid isPermaLink="false">http://blowingthroughlines.com/2010/05/25/uncategorized/wear-your-mass-quantities-of-code/</guid>
		<description><![CDATA[
http://www.headlineshirts.net/mass-quantities-of-code.html


No related posts.
Related posts brought to you by Yet Another Related Posts Plugin.


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p><a href="http://blowingthroughlines.com/wp-content/uploads/2010/05/massquan_blk_il_2581.jpg"><img src="http://blowingthroughlines.com/wp-content/uploads/2010/05/massquan_blk_il_2581.jpg" alt="" title="massquan_blk_il_258" width="258" height="297" class="alignnone size-full wp-image-245" /></a></p>
<p>http://www.headlineshirts.net/mass-quantities-of-code.html</p>


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://blowingthroughlines.com/2010/05/25/uncategorized/wear-your-mass-quantities-of-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Backup Apps From iPhone to iTunes (If the normal ways aren&#8217;t working)</title>
		<link>http://blowingthroughlines.com/2010/02/09/hints/iphone/backup-apps-from-iphone-to-itunes-if-the-normal-ways-arent-working/</link>
		<comments>http://blowingthroughlines.com/2010/02/09/hints/iphone/backup-apps-from-iphone-to-itunes-if-the-normal-ways-arent-working/#comments</comments>
		<pubDate>Tue, 09 Feb 2010 18:19:39 +0000</pubDate>
		<dc:creator>nilloc</dc:creator>
				<category><![CDATA[iphone]]></category>

		<guid isPermaLink="false">http://blowingthroughlines.com/?p=225</guid>
		<description><![CDATA[I finally just solved an annoying problem: I had downloaded an app on my wife&#8217;s iPhone that was no longer available on the App Store (ResistorCode, by Christopher Brown), but because of iPhone sync issues was unable to transfer it to iTunes from the phone.
Back Story
So my wife got the iPhone 3G when it first [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>I <em>finally</em> just solved an annoying problem: I had downloaded an app on my wife&#8217;s iPhone that was no longer available on the App Store (<a href="http://www.pcworld.com/appguide/app.html?id=89346&#038;expand=false">ResistorCode</a>, by Christopher Brown), but because of <a href="http://discussions.apple.com/thread.jspa?threadID=1675828&#038;start=0&#038;tstart=0">iPhone sync issues</a> was unable to transfer it to iTunes from the phone.</p>
<h4>Back Story</h4>
<p>So my wife got the iPhone 3G when it first came out, and along the way it was synced with multiple computers, and upgraded to iPhone OS 3.0 (then 3.1, 3.1.2 etc.). This caused it to stop being able to transfer purchased apps from the phone to iTunes or the mac.</p>
<p>Since I didn&#8217;t have a phone yet and was interested in some apps for when I did finally get one, there were some applications that I downloaded on her phone and figured I&#8217;d be able to move to my phone later.</p>
<p>Normally this wouldn&#8217;t be a big deal, since the apps can be re-downloaded from the App Store free of charge as long as you use the same account. The problem is that for whatever reason this app is no longer available on the App Store. And all the other applications (free or not) don&#8217;t work as well as this one for the tasks I need.</p>
<h4>Solution</h4>
<p>Wife gets new iPhone 3GS, and I take old iPhone3G&#8230;</p>
<p><em>OOOOOOOOORRRRRRRRRR</em></p>
<p>Enter <a href="http://www.ecamm.com/mac/phoneview/">PhoneView</a> which is an OS X application that allows you to view SMS, Contact and the DCIM folder on the iPhone without any iPhone modifications (read &#8220;no jailbreaking needed&#8221;). When I loaded it up with her iPhone it contained a folder name ApplicationArchives (which is empty on my new phone btw), and appears to be leftover from some revision of iPhone OS 2.0-1. In this folder is a bunch of zip files with the application package names (ie. <code>com.christopherbrown.resistorcode.zip</code>), but not all apps on her phone interestingly. Downloading them and unzipping them only left me with a folder with <code>iTunesArtwork</code>, <code>iTunesMetaData.plist,</code> and a <code>Payload</code> folder.</p>
<p>Turns out that&#8217;s what in those .ipa files stored in the Mobile Applications folder by iTunes!!! And—how convenient—ipa&#8217;s are just renamed zip files! So I renamed the zip file from <code>T4342SFMV3.com.christopherbrown.resistorcode.zip</code> to <code>ResistorCode.ipa</code> and put it in <code>~/Music/iTunes/Mobile Applications</code> withe the rest of the apps, and&#8230; wait&#8230; nothing&#8217;s showing up in iTunes.</p>
<p>Until I stumbled on <a href="http://www.ipodtouchfans.com/forums/showthread.php?t=81055">this post (see message #7)</a> and low and behold, all I had to do was double click the newly renamed <code>ResistorCode.ipa</code> file, and it was added to itunes and able to sync with my new iPhone 3GS!</p>
<h4>Disclaimer</h4>
<p>This likely only worked because we are both using the same iTunes account on computers that are both authorized on said account. The app was also a completely legitimate appstore download at the time it was purchased (though free), and is simply no longer available for download from iTunes.</p>
<p>This also doesn&#8217;t fundamentally solve the iPhone syncing problem with my wife&#8217;s phone, which appears to only be fixable by a factory reset, and manually syncing the apps back to the phone (you&#8217;ll find that restoring the phone after a factory reset also restores the syncing problem).</p>
<p>I&#8217;m going to download all the remaining apps from that <code>ApplicationArchives</code> folder when she gets home tonight, and at least have backups in iTunes, before we decide that it&#8217;s worth wiping out all that data from her phone (so many saved games and book lists to risk&#8230;)</p>


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://blowingthroughlines.com/2010/02/09/hints/iphone/backup-apps-from-iphone-to-itunes-if-the-normal-ways-arent-working/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tabs and Linefeeds (Newlines) in XML driven TextFields</title>
		<link>http://blowingthroughlines.com/2009/12/13/flash-as-3/tabs-and-linefeeds-newlines-in-xml-driven-textfields/</link>
		<comments>http://blowingthroughlines.com/2009/12/13/flash-as-3/tabs-and-linefeeds-newlines-in-xml-driven-textfields/#comments</comments>
		<pubDate>Sun, 13 Dec 2009 04:37:19 +0000</pubDate>
		<dc:creator>nilloc</dc:creator>
				<category><![CDATA[Flash AS 3.0]]></category>

		<guid isPermaLink="false">http://blowingthroughlines.com/?p=208</guid>
		<description><![CDATA[Man Flash can be annoying sometimes. So I&#8217;m showing some settings as a list, like
Item: value1
Item Two: value2
Item Three: value3

And the client asks if we can align the values vertically, and thinking like a programmer who likes to keep his code clean I&#8217;m thinking &#171;Sure, that shouldn&#8217;t be a problem, I&#8217;ll just add some \t&#8217;s [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Man Flash can be annoying sometimes. So I&#8217;m showing some settings as a list, like<br />
<code>Item: value1<br />
Item Two: value2<br />
Item Three: value3<br />
</code></p>
<p>And the client asks if we can align the values vertically, and thinking like a programmer who likes to keep his code clean I&#8217;m thinking &laquo;Sure, that shouldn&#8217;t be a problem, I&#8217;ll just add some <code>\t</code>&#8217;s to the XML file and we should be all set,&raquo; but all that comes out is, &ldquo;Sure, should only take a few minutes to add.&rdquo;</p>
<p>So I add some <code>\t</code>&#8217;s to the XML and what does flash do with them, it prints out all literal backslashes and ts.</p>
<p>SO then what? Well I was being lazy and specifying <code>xml.node</code> not <code>xml.node.text()</code> to get the text values. Switching it does nothing. So then I start tracing things and looking around the Goog. Finally it becomes apparent that Flash is urlencoding the XML text in the background when processing it, and when it urldecodes it, some things are kept that shouldn&#8217;t be, like all escaped string characters that would normally not print.</p>
<p>Oh yeah, condenseWhite was false.</p>
<p>So I start with just doing a simple replace(/\\t/g, &#8220;!!!!&#8221;) to find out if I can even find the damn things, and I get no exclamation marks&hellip; or dirty words. Then a forum entry that was so buried I haven&#8217;t even found it again to link to, suggested using unescape(xml.node.text()) for a close, but ultimately unrelated problem.</p>
<p>To make a long story short here&#8217;s the solution:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p208code2'); return false;">View Code</a> ACTIONSCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p2082"><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code" id="p208code2"><pre class="actionscript" style="font-family:monospace;">	<span style="color: #000000; font-weight: bold;">var</span> tabs:RegExp = <span style="color: #66cc66;">/</span>\\t<span style="color: #66cc66;">/</span>g;
	<span style="color: #000000; font-weight: bold;">var</span> newlines:RegExp = <span style="color: #66cc66;">/</span>\\n<span style="color: #66cc66;">/</span>g;
	txt.<span style="color: #0066CC;">htmlText</span> = <span style="color: #0066CC;">unescape</span><span style="color: #66cc66;">&#40;</span>wagerText<span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">replace</span><span style="color: #66cc66;">&#40;</span>tabs, <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\t</span>&quot;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">replace</span><span style="color: #66cc66;">&#40;</span>newlines, <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #66cc66;">&#41;</span>;</pre></td></tr></table></div>

<p>Go figure right?</p>
<p>As always if anyone has a better solution I&#8217;m all ears, or at least all comment-reading&hellip; eventually.</p>


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://blowingthroughlines.com/2009/12/13/flash-as-3/tabs-and-linefeeds-newlines-in-xml-driven-textfields/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Boom Box find.</title>
		<link>http://blowingthroughlines.com/2009/12/12/electronics/new-boom-box-find/</link>
		<comments>http://blowingthroughlines.com/2009/12/12/electronics/new-boom-box-find/#comments</comments>
		<pubDate>Sat, 12 Dec 2009 23:10:30 +0000</pubDate>
		<dc:creator>nilloc</dc:creator>
				<category><![CDATA[electronics]]></category>

		<guid isPermaLink="false">http://blowingthroughlines.com/?p=200</guid>
		<description><![CDATA[On our almost bi-weekly visit to the Goodwill store nearby, I found the Best Boombox yet. Feast your eyes on this:

That&#8217;s right, a Ghetto Blaster with a turntable!
It&#8217;s no SHARP VZ-2500, but still I only paid $7.99 for it (plus tax), and it&#8217;s even featured on Engadget. Anyway I&#8217;m working on a modular plan to [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>On our almost bi-weekly visit to the Goodwill store nearby, I found the Best Boombox yet. Feast your eyes on this:<br />
<a href="http://blowingthroughlines.com/wp-content/uploads/2009/12/IMG_1276.JPG.jpg"><img src="http://blowingthroughlines.com/wp-content/uploads/2009/12/IMG_1276.JPG-300x225.jpg" alt="Panasonic SG-J500 Closed" title="Panasonic SG-J500 Closed" width="300" height="225" class="alignnone size-medium wp-image-202" /></a><a href="http://blowingthroughlines.com/wp-content/uploads/2009/12/IMG_1278.JPG.jpg"><img src="http://blowingthroughlines.com/wp-content/uploads/2009/12/IMG_1278.JPG-300x225.jpg" alt="Panasonic SG-J500 Open" title="Panasonic SG-J500 Open" width="300" height="225" class="alignnone size-medium wp-image-203" /></a></p>
<p>That&#8217;s right, a Ghetto Blaster with a turntable!</p>
<p>It&#8217;s no <a href="http://pocketcalculatorshow.com/boombox/cool.html">SHARP VZ-2500</a>, but still I only paid $7.99 for it (plus tax), and it&#8217;s even featured on <a href="http://www.engadget.com/2005/08/22/engadget-1985">Engadget</a>. Anyway I&#8217;m working on a modular plan to add iPod functionality to it like some other boomboxes I&#8217;m working on, but not the tape adapter rout, something that connects directly to the amp IC. Details coming soon.</p>


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://blowingthroughlines.com/2009/12/12/electronics/new-boom-box-find/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oh just pick a time</title>
		<link>http://blowingthroughlines.com/2009/10/24/javascript/time-pickers/</link>
		<comments>http://blowingthroughlines.com/2009/10/24/javascript/time-pickers/#comments</comments>
		<pubDate>Sat, 24 Oct 2009 15:00:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[interaction design]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[forms]]></category>
		<category><![CDATA[frontend]]></category>
		<category><![CDATA[ui]]></category>

		<guid isPermaLink="false">http://blowingthroughlines.com/?p=188</guid>
		<description><![CDATA[So it&#8217;s a difficult problem when you&#8217;re designing a form that has a lot of time inputs (the one I&#8217;m thinking of has up to 4 including a time range). There is the usual, one time box, and an AM/PM dropdown, but that requires typing then clicking, and feels  too tedious, especially the 3rd time.
Then [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>So it&#8217;s a difficult problem when you&#8217;re designing a form that has a lot of time inputs (the one I&#8217;m thinking of has up to 4 including a time range). There is the usual, one time box, and an AM/PM dropdown, but that requires typing then clicking, and feels  too tedious, especially the 3rd time.</p>
<p>Then there is the huge dropdown of times, which isn&#8217;t too bad for just hours, with which you end up with 24 options, but when you add quarter hours you get 100 items in a huge scrolling dropdown (scrolling dropdowns in themselves can be dubious to some users).</p>
<p>So I did some looking around and found the following options the first of which isn&#8217;t the fastest  to use, and doesn&#8217;t require the least clicks, but was the most consistent with other elements on the page, and also seemed to have the most development behind it, and I ended up using in my current project.</p>
<ol>
<li><a href="http://pttimeselect.sourceforge.net/example/" target="_blank">http://pttimeselect.sourceforge.net/example/</a> (I think this is the cleanest, and works the best next to the date picker, because it looks the same. though it&#8217;s not the fastest or most efficient, but I think it&#8217;s the most developed.)</li>
<li><a href="http://milesich.com/tpdemo/" target="_blank">http://milesich.com/tpdemo/</a> (ok but a little overwhelming possibly to some people because of the + the done button that needs to be pressed)</li>
<li><a href="http://labs.perifer.se/timedatepicker/ " target="_blank">http://labs.perifer.se/timedatepicker/ </a>(this is probably the simplest option, but like I said, 100 might be a pain for some users)</li>
<li><a href="http://haineault.com/media/jquery/ui-timepickr/page/" target="_blank">http://haineault.com/media/jquery/ui-timepickr/page/</a> (while my wife used it fine on the first try, it wasn&#8217;t scientific because I didn&#8217;t give her a specific time to set.)</li>
<li><a href="http://www.jnathanson.com/index.cfm?page=jquery/clockpick/ClockPick " target="_blank">http://www.jnathanson.com/index.cfm?page=jquery/clockpick/ClockPick</a> (OK but a little less intuitive than timepickr)</li>
<li><a href="http://www.radoslavdimov.com/jquery-plugins/jquery-plugin-timepicker/ " target="_blank">http://www.radoslavdimov.com/jquery-plugins/jquery-plugin-timepicker/</a> (kinda ok, like a time only version of the second option, but sideways, I&#8217;m not sure how well AM/PM works because there isn&#8217;t an example)</li>
<li><a href="http://keith-wood.name/timeEntry.html" target="_blank">http://keith-wood.name/timeEntry.html</a> (neat but totally hard to use until you realize its keyboard-arrow-key driven, oops I gave it away)</li>
</ol>
<p>I think my dream selector would actually be more like this most excellent timer widget for OS X that I use almost every day called <a title="Awesome Timer Widget" href="http://nitram-nunca.com/downloads/minutes/" target="_blank">Minutes</a>. You&#8217;d just grab it and spin around until you have the time you want, then let go to set. Anyway when I have a project with a better budget then I&#8217;ll maybe make that version&#8230;</p>


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://blowingthroughlines.com/2009/10/24/javascript/time-pickers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Those Old PS2 Mouses You Couldn&#8217;t Throw Out</title>
		<link>http://blowingthroughlines.com/2009/09/28/arduino/arduino-with-ps2-intellimouse/</link>
		<comments>http://blowingthroughlines.com/2009/09/28/arduino/arduino-with-ps2-intellimouse/#comments</comments>
		<pubDate>Mon, 28 Sep 2009 16:53:14 +0000</pubDate>
		<dc:creator>nilloc</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[fix]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[microcontroller]]></category>

		<guid isPermaLink="false">http://blowingthroughlines.com/?p=174</guid>
		<description><![CDATA[Sorry got totally distracted by a box in the basement with some PS2 Intellimouse parts in it this weekend. I&#8217;ll have those Box2D shortcuts updated soon, promise.
Anyway if you&#8217;d like to get a PS2 Microsoft Intellimouse with wheel fully working with a current (Diecimila or newer) Arduino here&#8217;s the corrected code:

?View Code C1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
/**
 * Code [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Sorry got totally distracted by a box in the basement with some PS2 Intellimouse parts in it this weekend. I&#8217;ll have those Box2D shortcuts updated soon, promise.</p>
<p>Anyway if you&#8217;d like to get a PS2 Microsoft Intellimouse with wheel fully working with a current (Diecimila or newer) Arduino here&#8217;s the corrected code:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p174code4'); return false;">View Code</a> C</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p1744"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
</pre></td><td class="code" id="p174code4"><pre class="c" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/**
 * Code is a mix of ps2mouse from the Arduino playground
 * and mousewheel code from &quot;a world in dk&quot; modified to
 * work with Arduino Decimilia and 0017, and run a PS2
 * Microsoft Intellimouse.
 * 
 * Collin Reidorf collin@paperclipped.com 
 * Repaired http://blowingthroughlines.com
&nbsp;
 */</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/*
 * an arduino sketch to interface with a ps/2 mouse.
 * Also uses serial protocol to talk back to the host
 * and report what it finds.
 */</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/*
 * Pin 5 is the mouse data pin, pin 6 is the clock pin
 * Feel free to use whatever pins are convenient.
 */</span>
<span style="color: #339933;">#define MDATA 5</span>
<span style="color: #339933;">#define MCLK 6</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/*
 * according to some code I saw, these functions will
 * correctly set the mouse clock and data pins for
 * various conditions.
 */</span>
<span style="color: #993333;">void</span> gohi<span style="color: #009900;">&#40;</span><span style="color: #993333;">int</span> pin<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	pinMode<span style="color: #009900;">&#40;</span>pin<span style="color: #339933;">,</span> INPUT<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	digitalWrite<span style="color: #009900;">&#40;</span>pin<span style="color: #339933;">,</span> HIGH<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #993333;">void</span> golo<span style="color: #009900;">&#40;</span><span style="color: #993333;">int</span> pin<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	pinMode<span style="color: #009900;">&#40;</span>pin<span style="color: #339933;">,</span> OUTPUT<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	digitalWrite<span style="color: #009900;">&#40;</span>pin<span style="color: #339933;">,</span> LOW<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/* PRECONDITION : clock is HIGH */</span>
<span style="color: #808080; font-style: italic;">/* sends a single bit and returns with clock high */</span>
<span style="color: #993333;">void</span> sendBit<span style="color: #009900;">&#40;</span><span style="color: #993333;">char</span> bit<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>bit<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		gohi<span style="color: #009900;">&#40;</span>MDATA<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span> 
	<span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
		golo<span style="color: #009900;">&#40;</span>MDATA<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #808080; font-style: italic;">/* wait for clock cycle */</span>
	<span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span>digitalRead<span style="color: #009900;">&#40;</span>MCLK<span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> LOW<span style="color: #009900;">&#41;</span>
		<span style="color: #339933;">;</span>
	<span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span>digitalRead<span style="color: #009900;">&#40;</span>MCLK<span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> HIGH<span style="color: #009900;">&#41;</span>
		<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/* reads a single bit and returns with clock low */</span>
<span style="color: #993333;">char</span> readBit<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #993333;">char</span> tmp <span style="color: #339933;">=</span> <span style="color: #208080;">0x00</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span>digitalRead<span style="color: #009900;">&#40;</span>MCLK<span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> HIGH<span style="color: #009900;">&#41;</span>
		<span style="color: #339933;">;</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>digitalRead<span style="color: #009900;">&#40;</span>MDATA<span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> HIGH<span style="color: #009900;">&#41;</span> 
		tmp <span style="color: #339933;">=</span> <span style="color: #208080;">0x01</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span>digitalRead<span style="color: #009900;">&#40;</span>MCLK<span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> LOW<span style="color: #009900;">&#41;</span>
		<span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">return</span> tmp<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #993333;">void</span> mouse_write<span style="color: #009900;">&#40;</span><span style="color: #993333;">char</span> data<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #993333;">char</span> i<span style="color: #339933;">;</span>
	<span style="color: #993333;">char</span> parity <span style="color: #339933;">=</span> <span style="color: #0000dd;">1</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #808080; font-style: italic;">/* put pins in output mode */</span>
	gohi<span style="color: #009900;">&#40;</span>MDATA<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	gohi<span style="color: #009900;">&#40;</span>MCLK<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	delayMicroseconds<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">300</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	golo<span style="color: #009900;">&#40;</span>MCLK<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	delayMicroseconds<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">300</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	golo<span style="color: #009900;">&#40;</span>MDATA<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	delayMicroseconds<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">10</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #808080; font-style: italic;">/* start bit */</span>
	gohi<span style="color: #009900;">&#40;</span>MCLK<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #808080; font-style: italic;">/* wait for mouse to take control of clock); */</span>
	sendBit<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #808080; font-style: italic;">/* clock is low, and we are clear to send data */</span>
	<span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span>i<span style="color: #339933;">=</span><span style="color: #0000dd;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> <span style="color: #0000dd;">8</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
		sendBit<span style="color: #009900;">&#40;</span>data <span style="color: #339933;">&amp;</span> <span style="color: #208080;">0x01</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		parity <span style="color: #339933;">=</span> parity <span style="color: #339933;">^</span> <span style="color: #009900;">&#40;</span>data <span style="color: #339933;">&amp;</span> <span style="color: #208080;">0x01</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// might not need this anymore but too lazy to test...</span>
&nbsp;
		data <span style="color: #339933;">=</span> data <span style="color: #339933;">&gt;&gt;</span> <span style="color: #0000dd;">1</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>  
	<span style="color: #808080; font-style: italic;">/* parity */</span>
	sendBit<span style="color: #009900;">&#40;</span>parity<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #808080; font-style: italic;">/* stop bit */</span>
	sendBit<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #808080; font-style: italic;">/* wait for mouse to switch modes */</span>
	<span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>digitalRead<span style="color: #009900;">&#40;</span>MCLK<span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> LOW<span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #009900;">&#40;</span>digitalRead<span style="color: #009900;">&#40;</span>MDATA<span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> LOW<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
		<span style="color: #339933;">;</span>
	<span style="color: #808080; font-style: italic;">/* put a hold on the incoming data. */</span>
	golo<span style="color: #009900;">&#40;</span>MCLK<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/*
 * Get a byte of data from the mouse
 */</span>
<span style="color: #993333;">char</span> mouse_read<span style="color: #009900;">&#40;</span><span style="color: #993333;">void</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #993333;">char</span> data <span style="color: #339933;">=</span> <span style="color: #208080;">0x00</span><span style="color: #339933;">;</span>
	<span style="color: #993333;">int</span> i<span style="color: #339933;">;</span>
	<span style="color: #993333;">char</span> bit <span style="color: #339933;">=</span> <span style="color: #208080;">0x01</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">//	Serial.print(&quot;reading byte from mouse\n&quot;);</span>
	<span style="color: #808080; font-style: italic;">/* start the clock */</span>
	gohi<span style="color: #009900;">&#40;</span>MCLK<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	gohi<span style="color: #009900;">&#40;</span>MDATA<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	delayMicroseconds<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">50</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	readBit<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// delayMicroseconds(5);  /* not sure why */ // and not evidently needed</span>
&nbsp;
	<span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span>i<span style="color: #339933;">=</span><span style="color: #0000dd;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> <span style="color: #0000dd;">8</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: #666666; font-style: italic;">// read the bits</span>
		data <span style="color: #339933;">=</span> data <span style="color: #339933;">|</span> <span style="color: #009900;">&#40;</span>readBit<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">&lt;&lt;</span>i<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #808080; font-style: italic;">/* eat parity bit, which we ignore */</span>
	readBit<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #808080; font-style: italic;">/* eat stop bit */</span>
	readBit<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
&nbsp;
	<span style="color: #808080; font-style: italic;">/* put a hold on the incoming data. */</span>
	golo<span style="color: #009900;">&#40;</span>MCLK<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">return</span> data<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// for the mousewheel</span>
<span style="color: #666666; font-style: italic;">// #define verbose // for verbose output</span>
<span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> msInitSequence<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">7</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// should go up on top when ready</span>
&nbsp;
<span style="color: #993333;">char</span> writeAndGetResponse<span style="color: #009900;">&#40;</span><span style="color: #993333;">char</span> data<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #666666; font-style: italic;">// #ifdef verbose</span>
		<span style="color: #666666; font-style: italic;">// Serial.print(&quot;sending :	 &quot;);</span>
		<span style="color: #666666; font-style: italic;">// Serial.print((unsigned char)data, HEX);</span>
		<span style="color: #666666; font-style: italic;">// Serial.print(&quot;\t&quot;);</span>
	<span style="color: #666666; font-style: italic;">// #endif	</span>
&nbsp;
	mouse_write<span style="color: #009900;">&#40;</span> data <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">return</span> response<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: #993333;">char</span> response<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #993333;">char</span> data <span style="color: #339933;">=</span> mouse_read<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #666666; font-style: italic;">// #ifdef verbose</span>
		<span style="color: #666666; font-style: italic;">// Serial.print(&quot;echo &quot;);</span>
		<span style="color: #666666; font-style: italic;">// Serial.print((unsigned char)data, HEX);</span>
		<span style="color: #666666; font-style: italic;">// Serial.print(&quot; from mouse\n&quot;);</span>
	<span style="color: #666666; font-style: italic;">// #endif</span>
	<span style="color: #b1b100;">return</span> data<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #666666; font-style: italic;">// </span>
<span style="color: #993333;">void</span> msMode<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #666666; font-style: italic;">// sequence for ms mode (3 button + scroll)</span>
	<span style="color: #666666; font-style: italic;">// this is a entering procedure and i guess it will</span>
	<span style="color: #666666; font-style: italic;">// work with other mice/ICs as its problably stadard ps2</span>
	<span style="color: #666666; font-style: italic;">// And using an array were just a quick way to handle them</span>
	msInitSequence<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span><span style="color: #208080;">0xF3</span><span style="color: #339933;">;</span>
	msInitSequence<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span><span style="color: #208080;">0xC8</span><span style="color: #339933;">;</span>
	msInitSequence<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">2</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span><span style="color: #208080;">0xF3</span><span style="color: #339933;">;</span>
	msInitSequence<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">3</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span><span style="color: #208080;">0x64</span><span style="color: #339933;">;</span>
	msInitSequence<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">4</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span><span style="color: #208080;">0xF3</span><span style="color: #339933;">;</span>
	msInitSequence<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">5</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span><span style="color: #208080;">0x50</span><span style="color: #339933;">;</span>
	msInitSequence<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">6</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span><span style="color: #208080;">0xF2</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
	<span style="color: #993333;">int</span> i<span style="color: #339933;">;</span>
	<span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span>i<span style="color: #339933;">=</span><span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>i<span style="color: #339933;">&lt;</span><span style="color: #0000dd;">7</span><span style="color: #339933;">;</span>i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> 
		writeAndGetResponse<span style="color: #009900;">&#40;</span>msInitSequence<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>
&nbsp;
<span style="color: #666666; font-style: italic;">// end of mousewheel stuff</span>
&nbsp;
&nbsp;
<span style="color: #993333;">void</span> showMStat<span style="color: #009900;">&#40;</span><span style="color: #993333;">char</span> mstat<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #993333;">int</span> i<span style="color: #339933;">;</span>
	<span style="color: #993333;">char</span> bit <span style="color: #339933;">=</span> <span style="color: #208080;">0x01</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span>i <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span> i<span style="color: #339933;">&lt;</span><span style="color: #0000dd;">8</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: #b1b100;">if</span><span style="color: #009900;">&#40;</span>mstat<span style="color: #339933;">&amp;</span>bit<span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
			Serial.<span style="color: #202020;">print</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\t</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #b1b100;">switch</span><span style="color: #009900;">&#40;</span>i<span style="color: #009900;">&#41;</span>
			<span style="color: #009900;">&#123;</span>
				<span style="color: #b1b100;">case</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">:</span>
					Serial.<span style="color: #202020;">print</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;L&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					<span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
				<span style="color: #b1b100;">case</span> <span style="color: #0000dd;">1</span><span style="color: #339933;">:</span>
					Serial.<span style="color: #202020;">print</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;R&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					<span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
				<span style="color: #b1b100;">case</span> <span style="color: #0000dd;">2</span><span style="color: #339933;">:</span>
					Serial.<span style="color: #202020;">print</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;M&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					<span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
				<span style="color: #b1b100;">case</span> <span style="color: #0000dd;">3</span><span style="color: #339933;">:</span>
					<span style="color: #666666; font-style: italic;">// Serial.print(&quot; Reserve ...\t&quot;);</span>
					<span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
				<span style="color: #b1b100;">case</span> <span style="color: #0000dd;">4</span><span style="color: #339933;">:</span>
					<span style="color: #666666; font-style: italic;">// Serial.print(&quot; X data negative \t&quot;);</span>
					<span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
				<span style="color: #b1b100;">case</span> <span style="color: #0000dd;">5</span><span style="color: #339933;">:</span>
					<span style="color: #666666; font-style: italic;">// Serial.print(&quot;Y data negative \t&quot;);</span>
					<span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
				<span style="color: #b1b100;">case</span> <span style="color: #0000dd;">6</span><span style="color: #339933;">:</span>
					Serial.<span style="color: #202020;">print</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;X data overflow&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					<span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
				<span style="color: #b1b100;">case</span> <span style="color: #0000dd;">7</span><span style="color: #339933;">:</span>
					Serial.<span style="color: #202020;">print</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;Y data overflow&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					<span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span>
		bit <span style="color: #339933;">=</span> bit<span style="color: #339933;">&lt;&lt;</span><span style="color: #0000dd;">1</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span> 
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #993333;">void</span> mouse_init<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	gohi<span style="color: #009900;">&#40;</span>MCLK<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	gohi<span style="color: #009900;">&#40;</span>MDATA<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #666666; font-style: italic;">//	Serial.print(&quot;Sending reset to mouse\n&quot;);</span>
	mouse_write<span style="color: #009900;">&#40;</span><span style="color: #208080;">0xff</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	mouse_read<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>  <span style="color: #808080; font-style: italic;">/* ack byte */</span>
	<span style="color: #666666; font-style: italic;">//	Serial.print(&quot;Read ack byte1\n&quot;);</span>
	mouse_read<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>  <span style="color: #808080; font-style: italic;">/* blank */</span>
	mouse_read<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>  <span style="color: #808080; font-style: italic;">/* blank */</span>
&nbsp;
	msMode<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// mousewheel code</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">//	Serial.print(&quot;Sending remote mode code\n&quot;);</span>
	mouse_write<span style="color: #009900;">&#40;</span><span style="color: #208080;">0xf0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>	<span style="color: #808080; font-style: italic;">/* remote mode */</span>
	mouse_read<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>  <span style="color: #808080; font-style: italic;">/* ack */</span>
	<span style="color: #666666; font-style: italic;">//	Serial.print(&quot;Read ack byte2\n&quot;);</span>
&nbsp;
	delayMicroseconds<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">100</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #993333;">void</span> setup<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	Serial.<span style="color: #202020;">begin</span><span style="color: #009900;">&#40;</span><span style="color: #0000dd;">9600</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	mouse_init<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: #808080; font-style: italic;">/*
 * get a reading from the mouse and report it back to the
 * host via the serial line.
 */</span>
<span style="color: #993333;">void</span> loop<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #993333;">char</span> mstat<span style="color: #339933;">;</span>
	<span style="color: #993333;">char</span> mx<span style="color: #339933;">;</span>
	<span style="color: #993333;">char</span> my<span style="color: #339933;">;</span>
	<span style="color: #993333;">char</span> mz<span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #808080; font-style: italic;">/* get a reading from the mouse */</span>
	writeAndGetResponse<span style="color: #009900;">&#40;</span><span style="color: #208080;">0xEB</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #808080; font-style: italic;">/* give me data! */</span> 
&nbsp;
	mstat <span style="color: #339933;">=</span> mouse_read<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	mx <span style="color: #339933;">=</span> mouse_read<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	my <span style="color: #339933;">=</span> mouse_read<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	mz <span style="color: #339933;">=</span> mouse_read<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #808080; font-style: italic;">/* send the data back up */</span>
&nbsp;
	Serial.<span style="color: #202020;">print</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\t</span>mouse status=&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	Serial.<span style="color: #202020;">print</span><span style="color: #009900;">&#40;</span>mstat<span style="color: #339933;">,</span> BIN<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	Serial.<span style="color: #202020;">print</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\t</span>X=&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	Serial.<span style="color: #202020;">print</span><span style="color: #009900;">&#40;</span>mx<span style="color: #339933;">,</span> DEC<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	Serial.<span style="color: #202020;">print</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\t</span>Y=&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	Serial.<span style="color: #202020;">print</span><span style="color: #009900;">&#40;</span>my<span style="color: #339933;">,</span> DEC<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	Serial.<span style="color: #202020;">print</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\t</span>Z=&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	Serial.<span style="color: #202020;">print</span><span style="color: #009900;">&#40;</span>mz<span style="color: #339933;">,</span> DEC<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	showMStat<span style="color: #009900;">&#40;</span>mstat<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// print buttons that are down</span>
	Serial.<span style="color: #202020;">println</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	delay<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">20</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>	<span style="color: #808080; font-style: italic;">/* twiddle */</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Based on code from <a href="http://www.arduino.cc/playground/ComponentLib/Ps2mouse" target="_blank">The Arduino Playground</a> which also shows the pinouts (where the black and white drawing is the female connector&#8217;s pintout, the pins on the mouse itself are a mirror image, like in the blurry photo below) and more code from <a href="http://rotand.dk/blog/2007/11/21/arduino-ps2-mouse/" target="_blank">A world in dk(decay/denmark)</a>.</p>


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://blowingthroughlines.com/2009/09/28/arduino/arduino-with-ps2-intellimouse/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>External Interface Callbacks with Jquery</title>
		<link>http://blowingthroughlines.com/2009/09/28/bugs/external-interface-callbacks-with-jquery/</link>
		<comments>http://blowingthroughlines.com/2009/09/28/bugs/external-interface-callbacks-with-jquery/#comments</comments>
		<pubDate>Mon, 28 Sep 2009 15:59:07 +0000</pubDate>
		<dc:creator>nilloc</dc:creator>
				<category><![CDATA[Bugs]]></category>
		<category><![CDATA[Flash AS 3.0]]></category>
		<category><![CDATA[Flex 3]]></category>

		<guid isPermaLink="false">http://blowingthroughlines.com/?p=141</guid>
		<description><![CDATA[So first off, NEVER use this most lazy of hacks to reference the flash object when calling a method in a flash file:

?View Code JAVASCRIPT1
2
3
4
// some code
function test&#40;&#41; &#123;
	flashID.ner&#40;&#34;hello&#34;&#41;; // BAAAAAAD!
&#125;

For some reason it works… Some of the time. On Safari when testing running from Flex. On my Mac.
I was being lazy and not really [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>So first off, <em><strong>NEVER</strong></em> use this most lazy of hacks to reference the flash object when calling a method in a flash file:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p141code8'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p1418"><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code" id="p141code8"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">// some code</span>
<span style="color: #003366; font-weight: bold;">function</span> test<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	flashID.<span style="color: #660066;">ner</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;hello&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// BAAAAAAD!</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>For some reason it works… Some of the time. On Safari when testing running from Flex. On my Mac.</p>
<p>I was being lazy and not really thinking back to how things work in Javascript at the time, then having recently started using Jquery, I tried:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p141code9'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p1419"><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code" id="p141code9"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">// some code</span>
<span style="color: #003366; font-weight: bold;">function</span> test<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> flashMovie <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#flashID'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	flashMovie.<span style="color: #660066;">ner</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;hello&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// ALSO BAAAAAAD!</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Also doesn&#8217;t work, for some reason Jquery removes the methods associated with the embed tag that is written, and replaces them with only the Jquery methods. So in order for this to work the code needs to be simply:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p141code10'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p14110"><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code" id="p141code10"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> test<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> flashMovie <span style="color: #339933;">=</span> document.<span style="color: #660066;">getElementByID</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;flashID&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	flashMovie.<span style="color: #660066;">ner</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;hello&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// FINALLY! It worked.</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>



<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://blowingthroughlines.com/2009/09/28/bugs/external-interface-callbacks-with-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Box2D Shortcuts (Round 1)</title>
		<link>http://blowingthroughlines.com/2009/07/14/flash-as-3/box2d-shortcuts-round-1/</link>
		<comments>http://blowingthroughlines.com/2009/07/14/flash-as-3/box2d-shortcuts-round-1/#comments</comments>
		<pubDate>Tue, 14 Jul 2009 18:02:35 +0000</pubDate>
		<dc:creator>nilloc</dc:creator>
				<category><![CDATA[Flash AS 3.0]]></category>
		<category><![CDATA[physics]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[wrapper]]></category>

		<guid isPermaLink="false">http://blowingthroughlines.com/?p=159</guid>
		<description><![CDATA[Since leaving Hunt &#038; Gather, I&#8217;ve been (besides relishing the peace and quiet a bit) playing around with some of those Flash libraries I hadn&#8217;t had time for. Most tantalizing of which is the Box2D library. I&#8217;d attempted to use it for this auto layout class for LDa Architects, but because of time constraints ended [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Since leaving Hunt &#038; Gather, I&#8217;ve been (besides relishing the peace and quiet a bit) playing around with some of those Flash libraries I hadn&#8217;t had time for. Most tantalizing of which is the Box2D library. I&#8217;d attempted to use it for this auto layout class for <a href="http://www.lda-architects.com/#/outsidelda/section=news" target="_blank">LDa Architects</a>, but because of time constraints ended up settling for <a href="http://www.cove.org/ape/" target="_blank">APE</a> which as you can see is a bit out of date at this point. Anyway APE is fine if the number of bodies is small and you only need very basic simulation capabilities (boxes don&#8217;t rotate unless they are attached to 2 or more wheels for instance&#8230;), but once you wanna do more advanced things, like robots or buoyancy you&#8217;ll need a faster more complete engine. </p>
<p>Box2D seems to be the fastest and most current option out there, but it&#8217;s got kind of a funky API due in part to being a fairly direct port from C++. The complicated setup is in fact what had kept me from using it for so long, but some better documentation and turorial files available on the <a href="http://www.box2d.org/wiki/index.php?title=Manual/AS3" target="_blank">Box2D Wiki</a> is making getting started easier. And to make things even simpler to play with, I&#8217;m creating a series of wrapper classes that reduce the amount of code needed to get things started.</p>
<h3>World.world</h3>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p159code13'); return false;">View Code</a> ACTIONSCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p15913"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
</pre></td><td class="code" id="p159code13"><pre class="actionscript" style="font-family:monospace;">package com.<span style="color: #006600;">paperclipped</span>.<span style="color: #006600;">physics</span>
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #0066CC;">import</span> Box2D.<span style="color: #006600;">Collision</span>.<span style="color: #006600;">b2AABB</span>;
	<span style="color: #0066CC;">import</span> Box2D.<span style="color: #006600;">Common</span>.<span style="color: #0066CC;">Math</span>.<span style="color: #006600;">b2Vec2</span>;
	<span style="color: #0066CC;">import</span> Box2D.<span style="color: #006600;">Dynamics</span>.<span style="color: #006600;">b2DebugDraw</span>;
	<span style="color: #0066CC;">import</span> Box2D.<span style="color: #006600;">Dynamics</span>.<span style="color: #006600;">b2World</span>;
&nbsp;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #006600;">Sprite</span>;
&nbsp;
	<span style="color: #808080; font-style: italic;">/**
	 * This is a container class to make the creation of Box2D World simpler.
	 * Box2D r47 or greater required.
	 * (c) 2009 Collin Reisdorf MIT License
	 * 
	 * @author Collin Reisodrf
	 */</span>	
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> World
	<span style="color: #66cc66;">&#123;</span>
<span style="color: #808080; font-style: italic;">//-----------------------------------------Variables-----------------------------------------//</span>
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _scale:<span style="color: #0066CC;">Number</span>;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _world:b2World;
<span style="color: #808080; font-style: italic;">//-------------------------------------------------------------------------------------------//</span>
&nbsp;
<span style="color: #808080; font-style: italic;">//------------------------------------------Getters------------------------------------------//</span>
		<span style="color: #808080; font-style: italic;">/**
		 * @return Scale set by the user when the world is constructed.
		 */</span>				
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">get</span> scale<span style="color: #66cc66;">&#40;</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> _scale;	<span style="color: #66cc66;">&#125;</span>
		<span style="color: #808080; font-style: italic;">/**
		 * @return The world object made by the constructor.
		 */</span>		
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">get</span> world<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:b2World		<span style="color: #66cc66;">&#123;</span> <span style="color: #b1b100;">return</span> _world;	<span style="color: #66cc66;">&#125;</span>
<span style="color: #808080; font-style: italic;">//-------------------------------------------------------------------------------------------//</span>
&nbsp;
<span style="color: #808080; font-style: italic;">//----------------------------------------Constructor----------------------------------------//		</span>
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> World<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">width</span>:uint, <span style="color: #0066CC;">height</span>:uint, debugSprite:Sprite=<span style="color: #000000; font-weight: bold;">null</span>, showCenterOfMass:<span style="color: #0066CC;">Boolean</span>=<span style="color: #000000; font-weight: bold;">false</span>, gravity:b2Vec2=<span style="color: #000000; font-weight: bold;">null</span>, scale:<span style="color: #0066CC;">Number</span>=<span style="color: #cc66cc;">30</span>, padding:uint=<span style="color: #cc66cc;">1000</span>, doSleep:<span style="color: #0066CC;">Boolean</span>=<span style="color: #000000; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span>
		<span style="color: #66cc66;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">var</span> worldAABB:b2AABB = <span style="color: #000000; font-weight: bold;">new</span> b2AABB<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
				worldAABB.<span style="color: #006600;">lowerBound</span>.<span style="color: #0066CC;">Set</span><span style="color: #66cc66;">&#40;</span>-padding, -padding<span style="color: #66cc66;">&#41;</span>;
				worldAABB.<span style="color: #006600;">upperBound</span>.<span style="color: #0066CC;">Set</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">width</span>+padding, <span style="color: #0066CC;">width</span>+padding<span style="color: #66cc66;">&#41;</span>;
&nbsp;
			gravity = <span style="color: #66cc66;">&#40;</span>gravity<span style="color: #66cc66;">&#41;</span>? gravity:<span style="color: #000000; font-weight: bold;">new</span> b2Vec2<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">10.0</span><span style="color: #66cc66;">&#41;</span>;
			_world = <span style="color: #000000; font-weight: bold;">new</span> b2World<span style="color: #66cc66;">&#40;</span>worldAABB, gravity, doSleep<span style="color: #66cc66;">&#41;</span>;
&nbsp;
			<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>debugSprite<span style="color: #66cc66;">&#41;</span>
			<span style="color: #66cc66;">&#123;</span>
				<span style="color: #000000; font-weight: bold;">var</span>	debugDraw:b2DebugDraw = <span style="color: #000000; font-weight: bold;">new</span> b2DebugDraw<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
					debugDraw.<span style="color: #006600;">SetSprite</span><span style="color: #66cc66;">&#40;</span>debugSprite<span style="color: #66cc66;">&#41;</span>;
					debugDraw.<span style="color: #006600;">SetDrawScale</span><span style="color: #66cc66;">&#40;</span>scale<span style="color: #66cc66;">&#41;</span>;
					debugDraw.<span style="color: #006600;">SetFillAlpha</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0.3</span><span style="color: #66cc66;">&#41;</span>;
					debugDraw.<span style="color: #006600;">SetLineThickness</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1.0</span><span style="color: #66cc66;">&#41;</span>;
					debugDraw.<span style="color: #006600;">SetFlags</span><span style="color: #66cc66;">&#40;</span>b2DebugDraw.<span style="color: #006600;">e_shapeBit</span> <span style="color: #66cc66;">|</span> b2DebugDraw.<span style="color: #006600;">e_jointBit</span> <span style="color: #66cc66;">|</span> uint<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>showCenterOfMass<span style="color: #66cc66;">&#41;</span>? b2DebugDraw.<span style="color: #006600;">e_centerOfMassBit</span>:<span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
				_world.<span style="color: #006600;">SetDebugDraw</span><span style="color: #66cc66;">&#40;</span>debugDraw<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;">//-------------------------------------------------------------------------------------------//</span>
&nbsp;
<span style="color: #808080; font-style: italic;">//--------------------------------------Private Methods--------------------------------------//</span>
<span style="color: #808080; font-style: italic;">//-------------------------------------------------------------------------------------------//</span>
&nbsp;
<span style="color: #808080; font-style: italic;">//--------------------------------------Public  Methods--------------------------------------//</span>
<span style="color: #808080; font-style: italic;">//-------------------------------------------------------------------------------------------//</span>
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<h3>Chain</h3>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p159code14'); return false;">View Code</a> ACTIONSCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p15914"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
</pre></td><td class="code" id="p159code14"><pre class="actionscript" style="font-family:monospace;">package com.<span style="color: #006600;">paperclipped</span>.<span style="color: #006600;">physics</span>
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #0066CC;">import</span> Box2D.<span style="color: #006600;">Collision</span>.<span style="color: #006600;">Shapes</span>.<span style="color: #006600;">b2PolygonDef</span>;
	<span style="color: #0066CC;">import</span> Box2D.<span style="color: #006600;">Common</span>.<span style="color: #0066CC;">Math</span>.<span style="color: #006600;">b2Vec2</span>;
	<span style="color: #0066CC;">import</span> Box2D.<span style="color: #006600;">Dynamics</span>.<span style="color: #006600;">Joints</span>.<span style="color: #006600;">b2Joint</span>;
	<span style="color: #0066CC;">import</span> Box2D.<span style="color: #006600;">Dynamics</span>.<span style="color: #006600;">Joints</span>.<span style="color: #006600;">b2RevoluteJointDef</span>;
	<span style="color: #0066CC;">import</span> Box2D.<span style="color: #006600;">Dynamics</span>.<span style="color: #006600;">b2Body</span>;
	<span style="color: #0066CC;">import</span> Box2D.<span style="color: #006600;">Dynamics</span>.<span style="color: #006600;">b2BodyDef</span>;
	<span style="color: #0066CC;">import</span> Box2D.<span style="color: #006600;">Dynamics</span>.<span style="color: #006600;">b2World</span>;
&nbsp;
	<span style="color: #808080; font-style: italic;">/**
	 * This is a container class to make the creation of a chain simpler
	 * Box2D r47 or greater required.
	 * (c) 2009 Collin Reisdorf MIT License
	 * 
	 * @author Collin Reisodrf
	 */</span>	
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> Chain
	<span style="color: #66cc66;">&#123;</span>
<span style="color: #808080; font-style: italic;">//-----------------------------------------Variables-----------------------------------------//</span>
		<span style="color: #0066CC;">public</span> <span style="color: #0066CC;">static</span> const HORIZONTAL:<span style="color: #0066CC;">String</span> = <span style="color: #ff0000;">'h'</span>;
		<span style="color: #0066CC;">public</span> <span style="color: #0066CC;">static</span> const VERTICAL:<span style="color: #0066CC;">String</span> = <span style="color: #ff0000;">'v'</span>; <span style="color: #808080; font-style: italic;">// not supported yet</span>
&nbsp;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _bodies:<span style="color: #0066CC;">Array</span>;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _joints:<span style="color: #0066CC;">Array</span>;
<span style="color: #808080; font-style: italic;">//		private var _parent:</span>
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _world:b2World;
<span style="color: #808080; font-style: italic;">//-------------------------------------------------------------------------------------------//</span>
&nbsp;
<span style="color: #808080; font-style: italic;">//------------------------------------------Getters------------------------------------------//</span>
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">get</span> bodies<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">Array</span> 	<span style="color: #66cc66;">&#123;</span> <span style="color: #b1b100;">return</span> _bodies;								<span style="color: #66cc66;">&#125;</span>
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">get</span> <span style="color: #0066CC;">end</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:b2Body 	<span style="color: #66cc66;">&#123;</span> <span style="color: #b1b100;">return</span> _bodies<span style="color: #66cc66;">&#91;</span>_bodies.<span style="color: #006600;">length</span>-<span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#93;</span> as b2Body;	<span style="color: #66cc66;">&#125;</span>
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">get</span> joints<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">Array</span>	<span style="color: #66cc66;">&#123;</span> <span style="color: #b1b100;">return</span> _joints;								<span style="color: #66cc66;">&#125;</span>
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">get</span> <span style="color: #0066CC;">start</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:b2Body	<span style="color: #66cc66;">&#123;</span> <span style="color: #b1b100;">return</span> _bodies<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#93;</span> as b2Body;					<span style="color: #66cc66;">&#125;</span>
<span style="color: #808080; font-style: italic;">//-------------------------------------------------------------------------------------------//</span>
&nbsp;
<span style="color: #808080; font-style: italic;">//------------------------------------------Setters------------------------------------------//</span>
<span style="color: #808080; font-style: italic;">//-------------------------------------------------------------------------------------------//</span>
&nbsp;
<span style="color: #808080; font-style: italic;">//----------------------------------------Constructor----------------------------------------//</span>
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> Chain<span style="color: #66cc66;">&#40;</span>world:b2World, numLinks:uint=<span style="color: #cc66cc;">3</span>, anchorX:<span style="color: #0066CC;">int</span>=<span style="color: #cc66cc;">0</span>, anchorY:<span style="color: #0066CC;">int</span>=<span style="color: #cc66cc;">0</span>, direction:<span style="color: #0066CC;">String</span>=<span style="color: #ff0000;">&quot;h&quot;</span>, swingLimit:uint=<span style="color: #cc66cc;">0</span>, <span style="color: #808080; font-style: italic;">/*parent=null,*/</span> scale:uint=<span style="color: #cc66cc;">30</span><span style="color: #66cc66;">&#41;</span>
		<span style="color: #66cc66;">&#123;</span>
			_world = world;
			_bodies = <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>;
			_joints = <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: #808080; font-style: italic;">//			_parent = parent; // not sure what/how to attach this to yet...</span>
&nbsp;
			<span style="color: #000000; font-weight: bold;">var</span> ground:b2Body = world.<span style="color: #006600;">GetGroundBody</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #000000; font-weight: bold;">var</span> i:<span style="color: #0066CC;">int</span>;
			<span style="color: #000000; font-weight: bold;">var</span> anchor:b2Vec2 = <span style="color: #000000; font-weight: bold;">new</span> b2Vec2<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #000000; font-weight: bold;">var</span> body:b2Body;
			<span style="color: #000000; font-weight: bold;">var</span> joint:b2Joint;
&nbsp;
			<span style="color: #000000; font-weight: bold;">var</span> sd:b2PolygonDef = <span style="color: #000000; font-weight: bold;">new</span> b2PolygonDef<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			sd.<span style="color: #006600;">SetAsBox</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">24</span> <span style="color: #66cc66;">/</span> scale, <span style="color: #cc66cc;">5</span> <span style="color: #66cc66;">/</span> scale<span style="color: #66cc66;">&#41;</span>;
			sd.<span style="color: #006600;">density</span> = <span style="color: #cc66cc;">100.0</span>;
			sd.<span style="color: #006600;">friction</span> = <span style="color: #cc66cc;">0.8</span>;
&nbsp;
			<span style="color: #000000; font-weight: bold;">var</span> bd:b2BodyDef = <span style="color: #000000; font-weight: bold;">new</span> b2BodyDef<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
			<span style="color: #000000; font-weight: bold;">var</span> jd:b2RevoluteJointDef = <span style="color: #000000; font-weight: bold;">new</span> b2RevoluteJointDef<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>swingLimit <span style="color: #66cc66;">&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span>
			<span style="color: #66cc66;">&#123;</span>
				jd.<span style="color: #006600;">lowerAngle</span> = -swingLimit <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: #0066CC;">Math</span>.<span style="color: #0066CC;">PI</span><span style="color: #66cc66;">&#41;</span>;
				jd.<span style="color: #006600;">upperAngle</span> = swingLimit <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: #0066CC;">Math</span>.<span style="color: #0066CC;">PI</span><span style="color: #66cc66;">&#41;</span>;
				jd.<span style="color: #006600;">enableLimit</span> = <span style="color: #000000; font-weight: bold;">true</span>;
			<span style="color: #66cc66;">&#125;</span><span style="color: #b1b100;">else</span>
			<span style="color: #66cc66;">&#123;</span>
				jd.<span style="color: #006600;">enableLimit</span> = <span style="color: #000000; font-weight: bold;">false</span>;
			<span style="color: #66cc66;">&#125;</span>
&nbsp;
			<span style="color: #000000; font-weight: bold;">var</span> prevBody:b2Body = ground;
			<span style="color: #b1b100;">for</span> <span style="color: #66cc66;">&#40;</span>i = <span style="color: #cc66cc;">0</span>; i <span style="color: #66cc66;">&lt;</span> <span style="color: #cc66cc;">3</span>; ++i<span style="color: #66cc66;">&#41;</span>
			<span style="color: #66cc66;">&#123;</span>
<span style="color: #808080; font-style: italic;">//				if(i == 0)</span>
<span style="color: #808080; font-style: italic;">//				{</span>
<span style="color: #808080; font-style: italic;">//				trace(&quot;enabled motor damnit&quot;);</span>
<span style="color: #808080; font-style: italic;">//					jd.enableMotor = true;</span>
<span style="color: #808080; font-style: italic;">//					jd.motorSpeed = 1;</span>
<span style="color: #808080; font-style: italic;">//					jd.maxMotorTorque = 100;</span>
<span style="color: #808080; font-style: italic;">//				}else</span>
<span style="color: #808080; font-style: italic;">//				{</span>
<span style="color: #808080; font-style: italic;">//					jd.enableMotor = false;</span>
<span style="color: #808080; font-style: italic;">//</span>
<span style="color: #808080; font-style: italic;">//				}</span>
&nbsp;
				bd.<span style="color: #0066CC;">position</span>.<span style="color: #0066CC;">Set</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>anchorX + <span style="color: #cc66cc;">22</span> + <span style="color: #cc66cc;">44</span> <span style="color: #66cc66;">*</span> i<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">/</span> scale, anchorY <span style="color: #66cc66;">/</span> scale<span style="color: #66cc66;">&#41;</span>;
				body = world.<span style="color: #006600;">CreateBody</span><span style="color: #66cc66;">&#40;</span>bd<span style="color: #66cc66;">&#41;</span>;
				body.<span style="color: #006600;">CreateShape</span><span style="color: #66cc66;">&#40;</span>sd<span style="color: #66cc66;">&#41;</span>;
				body.<span style="color: #006600;">SetMassFromShapes</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
				anchor.<span style="color: #0066CC;">Set</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>anchorX + <span style="color: #cc66cc;">44</span> <span style="color: #66cc66;">*</span> i<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">/</span> scale, anchorY <span style="color: #66cc66;">/</span> scale<span style="color: #66cc66;">&#41;</span>;
				jd.<span style="color: #006600;">Initialize</span><span style="color: #66cc66;">&#40;</span>prevBody, body, anchor<span style="color: #66cc66;">&#41;</span>;
				joint = world.<span style="color: #006600;">CreateJoint</span><span style="color: #66cc66;">&#40;</span>jd<span style="color: #66cc66;">&#41;</span>;
&nbsp;
				prevBody = body;
				_bodies.<span style="color: #0066CC;">push</span><span style="color: #66cc66;">&#40;</span>body<span style="color: #66cc66;">&#41;</span>;
				_joints.<span style="color: #0066CC;">push</span><span style="color: #66cc66;">&#40;</span>joint<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;">//-------------------------------------------------------------------------------------------//</span>
&nbsp;
<span style="color: #808080; font-style: italic;">//--------------------------------------Private Methods--------------------------------------//</span>
<span style="color: #808080; font-style: italic;">//-------------------------------------------------------------------------------------------//</span>
&nbsp;
<span style="color: #808080; font-style: italic;">//--------------------------------------Public  Methods--------------------------------------//</span>
<span style="color: #808080; font-style: italic;">//-------------------------------------------------------------------------------------------//</span>
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<p>Keep an eye out for more, I&#8217;m working on robot leg linkages next. And also trying to get a new job <img src='http://blowingthroughlines.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://blowingthroughlines.com/2009/07/14/flash-as-3/box2d-shortcuts-round-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enabling Scripts for IE 8+ and Firefox, Safari and Non-IE Browsers.</title>
		<link>http://blowingthroughlines.com/2009/06/09/uncategorized/enabling-scripts-for-ie-8-and-firefox-safari-and-non-ie-browsers/</link>
		<comments>http://blowingthroughlines.com/2009/06/09/uncategorized/enabling-scripts-for-ie-8-and-firefox-safari-and-non-ie-browsers/#comments</comments>
		<pubDate>Tue, 09 Jun 2009 23:15:12 +0000</pubDate>
		<dc:creator>nilloc</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blowingthroughlines.com/?p=151</guid>
		<description><![CDATA[So we had this weird bug, that we were likely the culprit of, but that we didn&#8217;t have time to properly find/fix involving SWFAddress, and some JSON and IE 6 &#038; 7. Namely with anything less then IE 8 inclusion of the SWFAddress javascript file was killing the app when we removed it, things worked [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>So we had this weird bug, that we were likely the culprit of, but that we didn&#8217;t have time to properly find/fix involving SWFAddress, and some JSON and IE 6 &#038; 7. Namely with anything less then IE 8 inclusion of the SWFAddress javascript file was killing the app when we removed it, things worked fine, albeit without deep link or browser history support.</p>
<p>So we needed to have a way for IE8, Firefox, Safari, Chrome (why not even Opera) load SWFAddress, but the rest not, behold:</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p151code16'); return false;">View Code</a> HTML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p15116"><td class="code" id="p151code16"><pre class="html" style="font-family:monospace;">&lt;!--[if gte IE 8]&gt;--&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;js/swfaddress.2.3.js&quot;&gt;&lt;/script&gt;
&lt;!--&lt;![endif&gt;--&gt;</pre></td></tr></table></div>

<p>Clever eh? it&#8217;s the extra <code>--></code>s that do it, so all browers but IE ignore the only the (otherwise standard) conditional code, but still use the script, like we just put a couple of regular old comments up in there. This has only been tested on a few machines so your milage may vary. Lemme know if things workout (or don&#8217;t).</p>


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://blowingthroughlines.com/2009/06/09/uncategorized/enabling-scripts-for-ie-8-and-firefox-safari-and-non-ie-browsers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SWFAddress, if You Aren&#8217;t Using it for All Your Flash, Start to</title>
		<link>http://blowingthroughlines.com/2009/04/03/javascript/swfaddress-if-you-arent-using-it-for-all-your-flash-start-to/</link>
		<comments>http://blowingthroughlines.com/2009/04/03/javascript/swfaddress-if-you-arent-using-it-for-all-your-flash-start-to/#comments</comments>
		<pubDate>Fri, 03 Apr 2009 16:30:39 +0000</pubDate>
		<dc:creator>nilloc</dc:creator>
				<category><![CDATA[Flash AS 3.0]]></category>
		<category><![CDATA[Flex 3]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://blowingthroughlines.com/?p=129</guid>
		<description><![CDATA[We&#8217;ve been using SWFAddress for a while now, and while I was cleaning old project files out of Flex I came across my first Flex Test using it. It&#8217;s simple, and in fact, SWFAddress has been improved a bunch since this test was made (mostly involving SEO, and fallback links + Google Analytics). Now we&#8217;re [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve been using <a href="http://www.asual.com/swfaddress/" title="SWFAddress project homepage">SWFAddress</a> for a while now, and while I was cleaning old project files out of Flex I came across my first Flex Test using it. It&#8217;s simple, and in fact, SWFAddress has been improved a bunch since this test was made (mostly involving SEO, and fallback links + Google Analytics). Now we&#8217;re using it for running our entire navigation schemes for all Flash sites, mini-sites, components, and even in our pitches.</p>
<p>Check out my <a href="/examples/SWFAddressTester/" title="SWFAddress Example (click to set address to future X location of the black box">example (click anywhere to move the box, then use the back/forward buttons for undo/redo).</a></p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p129code18'); return false;">View Code</a> ACTIONSCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p12918"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
</pre></td><td class="code" id="p129code18"><pre class="actionscript" style="font-family:monospace;">package <span style="color: #66cc66;">&#123;</span>
	<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">asual</span>.<span style="color: #006600;">swfaddress</span>.<span style="color: #006600;">SWFAddress</span>;
	<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">asual</span>.<span style="color: #006600;">swfaddress</span>.<span style="color: #006600;">SWFAddressEvent</span>;
&nbsp;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #006600;">Shape</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;">MouseEvent</span>;
&nbsp;
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> SWFAddress_test <span style="color: #0066CC;">extends</span> Sprite
	<span style="color: #66cc66;">&#123;</span>
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _square:Shape;
&nbsp;
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> SWFAddress_test<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
		<span style="color: #66cc66;">&#123;</span>
			SWFAddress.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>SWFAddressEvent.<span style="color: #006600;">INIT</span>, init<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> init<span style="color: #66cc66;">&#40;</span>evt:SWFAddressEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
			SWFAddress.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>SWFAddressEvent.<span style="color: #006600;">CHANGE</span>, handleSWFAddressChange<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>, gotoAddress<span style="color: #66cc66;">&#41;</span>;
&nbsp;
			_square = <span style="color: #000000; font-weight: bold;">new</span> Shape<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			_square.<span style="color: #006600;">graphics</span>.<span style="color: #0066CC;">beginFill</span><span style="color: #66cc66;">&#40;</span>0x0<span style="color: #66cc66;">&#41;</span>;
			_square.<span style="color: #006600;">graphics</span>.<span style="color: #006600;">drawRect</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">0</span>,<span style="color: #cc66cc;">50</span>,<span style="color: #cc66cc;">50</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #0066CC;">this</span>.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span>_square<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> handleSWFAddressChange<span style="color: #66cc66;">&#40;</span>evt:SWFAddressEvent<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>evt.<span style="color: #006600;">path</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #000000; font-weight: bold;">var</span> address:<span style="color: #0066CC;">Array</span> = evt.<span style="color: #006600;">path</span>.<span style="color: #0066CC;">split</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;/&quot;</span>, <span style="color: #cc66cc;">3</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #000000; font-weight: bold;">var</span> xLoc:<span style="color: #0066CC;">Number</span> = <span style="color: #0066CC;">Number</span><span style="color: #66cc66;">&#40;</span>address<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">!</span><span style="color: #0066CC;">isNaN</span><span style="color: #66cc66;">&#40;</span>xLoc<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> moveSquare<span style="color: #66cc66;">&#40;</span>xLoc<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> gotoAddress<span style="color: #66cc66;">&#40;</span>evt:MouseEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
			SWFAddress.<span style="color: #006600;">setValue</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">this</span>.<span style="color: #006600;">mouseX</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>
&nbsp;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> moveSquare<span style="color: #66cc66;">&#40;</span>loc:<span style="color: #0066CC;">Number</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
			_square.<span style="color: #006600;">x</span> = loc;
		<span style="color: #66cc66;">&#125;</span>
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>



<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://blowingthroughlines.com/2009/04/03/javascript/swfaddress-if-you-arent-using-it-for-all-your-flash-start-to/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why we use the MIT license for all our work.</title>
		<link>http://blowingthroughlines.com/2009/03/01/culture/why-we-use-the-mit-license-for-all-our-work/</link>
		<comments>http://blowingthroughlines.com/2009/03/01/culture/why-we-use-the-mit-license-for-all-our-work/#comments</comments>
		<pubDate>Mon, 02 Mar 2009 03:02:30 +0000</pubDate>
		<dc:creator>nilloc</dc:creator>
				<category><![CDATA[Culture]]></category>
		<category><![CDATA[Art]]></category>
		<category><![CDATA[copyright]]></category>
		<category><![CDATA[law]]></category>
		<category><![CDATA[prohibition]]></category>

		<guid isPermaLink="false">http://blowingthroughlines.com/?p=110</guid>
		<description><![CDATA[(Please open the article to see the flash file or player.)
Plenty that&#8217;s been heard and said before, but with some good jokes, and relevant to the fans / obedient followers of Shepard Fairey and his arrest in Boston. (Glad I live in Somerville).
I still think his arrest has to do with the upcoming mayoral race.


No [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p><object type="application/x-shockwave-flash" data="http://blip.tv/play/Ae_efQA" width="100%" height="500" class="embedflash"><param name="movie" value="http://blip.tv/play/Ae_efQA" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><small>(Please open the article to see the flash file or player.)</small></object></p>
<p>Plenty that&#8217;s been heard and said before, but with some good jokes, and relevant to the fans / obedient followers of Shepard Fairey and his arrest in Boston. (Glad I live in Somerville).</p>
<p>I still think his arrest has to do with the <a href="http://www.woostercollective.com/2009/02/shepard_faireys_arrest_in_boston_a_first.html">upcoming</a> <a href="http://www.boston.com/news/local/massachusetts/articles/2008/01/15/feud_between_menino_firefighters_union_escalates/">mayoral</a> <a href="http://www.boston.com/bostonglobe/editorial_opinion/oped/articles/2009/01/16/boston_needs_a_real_race_for_mayor/">race</a>.</p>


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://blowingthroughlines.com/2009/03/01/culture/why-we-use-the-mit-license-for-all-our-work/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flex Custom Validator Email Confirmation</title>
		<link>http://blowingthroughlines.com/2009/02/18/uncategorized/flex-custom-validator-email-confirmation/</link>
		<comments>http://blowingthroughlines.com/2009/02/18/uncategorized/flex-custom-validator-email-confirmation/#comments</comments>
		<pubDate>Wed, 18 Feb 2009 18:18:16 +0000</pubDate>
		<dc:creator>jeff</dc:creator>
				<category><![CDATA[Flash AS 3.0]]></category>
		<category><![CDATA[Flex 3]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[flex3]]></category>
		<category><![CDATA[forms]]></category>
		<category><![CDATA[validation]]></category>

		<guid isPermaLink="false">http://blowingthroughlines.com/?p=100</guid>
		<description><![CDATA[Pretty simple stuff.  This was driving me a bit crazy at the beginning of the day so I decided to just cut and paste my source code hoping this will help someone else out.  Basically I just want to create a custom validator that makes sure one field is equal to another in [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Pretty simple stuff.  This was driving me a bit crazy at the beginning of the day so I decided to just cut and paste my source code hoping this will help someone else out.  Basically I just want to create a custom validator that makes sure one field is equal to another in flex.  Pretty simple but if you are a noob you will find this task a bit sucky&#8230;.  Her is the code</p>
<p>Actionscript Custom Validator.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p100code21'); return false;">View Code</a> ACTIONSCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p10021"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
</pre></td><td class="code" id="p100code21"><pre class="actionscript" style="font-family:monospace;">package com.<span style="color: #006600;">flextradeshow</span>.<span style="color: #006600;">classes</span>
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #0066CC;">import</span> flash.<span style="color: #0066CC;">text</span>.<span style="color: #0066CC;">TextField</span>;
&nbsp;
	<span style="color: #0066CC;">import</span> mx.<span style="color: #006600;">controls</span>.<span style="color: #006600;">TextInput</span>;
	<span style="color: #0066CC;">import</span> mx.<span style="color: #006600;">validators</span>.<span style="color: #006600;">ValidationResult</span>;
	<span style="color: #0066CC;">import</span> mx.<span style="color: #006600;">validators</span>.<span style="color: #006600;">Validator</span>;
&nbsp;
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> EqualValidator <span style="color: #0066CC;">extends</span> Validator
	<span style="color: #66cc66;">&#123;</span>
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> results:<span style="color: #0066CC;">Array</span>;
&nbsp;
		<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> textbox:TextInput = <span style="color: #000000; font-weight: bold;">new</span> TextInput<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> EqualValidator<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>;
&nbsp;
		<span style="color: #66cc66;">&#125;</span>
		override protected <span style="color: #000000; font-weight: bold;">function</span> doValidation<span style="color: #66cc66;">&#40;</span>value:<span style="color: #0066CC;">Object</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">Array</span>
		<span style="color: #66cc66;">&#123;</span>
			results = <span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span>;
			results = <span style="color: #0066CC;">super</span>.<span style="color: #006600;">doValidation</span><span style="color: #66cc66;">&#40;</span>value<span style="color: #66cc66;">&#41;</span>;
			<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>results.<span style="color: #0066CC;">length</span> <span style="color: #66cc66;">&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span>
			<span style="color: #66cc66;">&#123;</span>
				<span style="color: #b1b100;">return</span> results;
			<span style="color: #66cc66;">&#125;</span>
			<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>value<span style="color: #66cc66;">!</span>=textbox.<span style="color: #0066CC;">text</span> <span style="color: #66cc66;">||</span> <span style="color: #66cc66;">!</span>value<span style="color: #66cc66;">&#41;</span>
			<span style="color: #66cc66;">&#123;</span>
				results.<span style="color: #0066CC;">push</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> ValidationResult<span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">true</span>,<span style="color: #000000; font-weight: bold;">null</span>,<span style="color: #ff0000;">&quot;NaN&quot;</span>,<span style="color: #ff0000;">&quot;Not a matching value sorry&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
				<span style="color: #b1b100;">return</span> results;
			<span style="color: #66cc66;">&#125;</span>
			<span style="color: #b1b100;">return</span> results;
		<span style="color: #66cc66;">&#125;</span>
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<p>This is the code you need in your view to use the validator.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p100code22'); return false;">View Code</a> XML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p10022"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
</pre></td><td class="code" id="p100code22"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;utf-8&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mx:Panel</span> <span style="color: #000066;">xmlns:mx</span>=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span> <span style="color: #000066;">xmlns:tsclasses</span>=<span style="color: #ff0000;">&quot;com.flextradeshow.classes.*&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mx:StringValidator</span></span>
<span style="color: #009900;">		<span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;nameValidator&quot;</span></span>
<span style="color: #009900;">		<span style="color: #000066;">source</span>=<span style="color: #ff0000;">&quot;{_iname}&quot;</span></span>
<span style="color: #009900;">		<span style="color: #000066;">property</span>=<span style="color: #ff0000;">&quot;text&quot;</span></span>
<span style="color: #009900;">		<span style="color: #000066;">minLength</span>=<span style="color: #ff0000;">&quot;4&quot;</span></span>
<span style="color: #009900;">	<span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mx:EmailValidator</span></span>
<span style="color: #009900;">		<span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;emailValidator&quot;</span></span>
<span style="color: #009900;">		<span style="color: #000066;">source</span>=<span style="color: #ff0000;">&quot;{_iemail}&quot;</span></span>
<span style="color: #009900;">		<span style="color: #000066;">property</span>=<span style="color: #ff0000;">&quot;text&quot;</span></span>
<span style="color: #009900;">	<span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mx:EmailValidator</span></span>
<span style="color: #009900;">		<span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;emailConfirmationValidator&quot;</span></span>
<span style="color: #009900;">		<span style="color: #000066;">source</span>=<span style="color: #ff0000;">&quot;{_iconfirmemail}&quot;</span></span>
<span style="color: #009900;">		<span style="color: #000066;">property</span>=<span style="color: #ff0000;">&quot;text&quot;</span></span>
<span style="color: #009900;">	<span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;tsclasses:EqualValidator</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;sameEmailValidator&quot;</span> <span style="color: #000066;">source</span>=<span style="color: #ff0000;">&quot;{_iconfirmemail}&quot;</span> <span style="color: #000066;">textbox</span>=<span style="color: #ff0000;">&quot;{_iemail}&quot;</span> <span style="color: #000066;">property</span>=<span style="color: #ff0000;">&quot;text&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mx:Form</span> <span style="color: #000066;">labelWidth</span>=<span style="color: #ff0000;">&quot;100&quot;</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;302&quot;</span> <span style="color: #000066;">height</span>=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="color: #000066;">horizontalScrollPolicy</span>=<span style="color: #ff0000;">&quot;off&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mx:FormItem</span> <span style="color: #000066;">label</span>=<span style="color: #ff0000;">&quot;Full Name&quot;</span> <span style="color: #000066;">required</span>=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mx:TextInput</span>  <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;_iname&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/mx:FormItem<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mx:FormItem</span> <span style="color: #000066;">label</span>=<span style="color: #ff0000;">&quot;Email&quot;</span> <span style="color: #000066;">required</span>=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mx:TextInput</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;_iemail&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/mx:FormItem<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mx:FormItem</span> <span style="color: #000066;">label</span>=<span style="color: #ff0000;">&quot;Confirm Email&quot;</span> <span style="color: #000066;">required</span>=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mx:TextInput</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;_iconfirmemail&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/mx:FormItem<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mx:FormItem</span> <span style="color: #000066;">label</span>=<span style="color: #ff0000;">&quot;Birthday&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mx:DateField</span>  <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;_ibirthday&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/mx:FormItem<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mx:Spacer</span> <span style="color: #000066;">height</span>=<span style="color: #ff0000;">&quot;15&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mx:Label</span> <span style="color: #000066;">text</span>=<span style="color: #ff0000;">&quot;Free mimoDesk Sample (Choose One)&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/mx:Label<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mx:Box</span> <span style="color: #000066;">paddingLeft</span>=<span style="color: #ff0000;">&quot;110&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mx:RadioButtonGroup</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;freemimodesk&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mx:RadioButton</span> <span style="color: #000066;">label</span>=<span style="color: #ff0000;">&quot;Star Wars&quot;</span> <span style="color: #000066;">groupName</span>=<span style="color: #ff0000;">&quot;freemimodesk&quot;</span> <span style="color: #000066;">selected</span>=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mx:RadioButton</span> <span style="color: #000066;">label</span>=<span style="color: #ff0000;">&quot;Tokidoki&quot;</span> <span style="color: #000066;">groupName</span>=<span style="color: #ff0000;">&quot;freemimodesk&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mx:RadioButton</span> <span style="color: #000066;">label</span>=<span style="color: #ff0000;">&quot;Original Core Series&quot;</span> <span style="color: #000066;">groupName</span>=<span style="color: #ff0000;">&quot;freemimodesk&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mx:RadioButton</span> <span style="color: #000066;">label</span>=<span style="color: #ff0000;">&quot;Not Interested&quot;</span> <span style="color: #000066;">groupName</span>=<span style="color: #ff0000;">&quot;freemimodesk&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/mx:Box<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mx:Spacer</span> <span style="color: #000066;">height</span>=<span style="color: #ff0000;">&quot;15&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mx:Label</span> <span style="color: #000066;">text</span>=<span style="color: #ff0000;">&quot;Subscribe to any of the following Newsletters&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/mx:Label<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mx:Box</span> <span style="color: #000066;">paddingLeft</span>=<span style="color: #ff0000;">&quot;110&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mx:CheckBox</span> <span style="color: #000066;">label</span>=<span style="color: #ff0000;">&quot;Consumer&quot;</span> <span style="color: #000066;">selected</span>=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mx:CheckBox</span> <span style="color: #000066;">label</span>=<span style="color: #ff0000;">&quot;Press&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mx:CheckBox</span> <span style="color: #000066;">label</span>=<span style="color: #ff0000;">&quot;Wholesale&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/mx:Box<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mx:Box</span> <span style="color: #000066;">horizontalAlign</span>=<span style="color: #ff0000;">&quot;right&quot;</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;100%&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mx:Button</span> <span style="color: #000066;">label</span>=<span style="color: #ff0000;">&quot;Subscribe&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/mx:Box<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/mx:Form<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/mx:Panel<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>



<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://blowingthroughlines.com/2009/02/18/uncategorized/flex-custom-validator-email-confirmation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Facebook Post Image Test</title>
		<link>http://blowingthroughlines.com/2009/02/11/api/facebook-post-image-test/</link>
		<comments>http://blowingthroughlines.com/2009/02/11/api/facebook-post-image-test/#comments</comments>
		<pubDate>Wed, 11 Feb 2009 17:58:28 +0000</pubDate>
		<dc:creator>nilloc</dc:creator>
				<category><![CDATA[api]]></category>

		<guid isPermaLink="false">http://blowingthroughlines.com/?p=91</guid>
		<description><![CDATA[ 
Yeah old F1 Pics.
Some explanation: We&#8217;re working on a RSS feed that can be read by Facebook so it can add images to the newsfeed post automagically. Then we want to see if when we change it in the RSS feed, it updates on FB or not. Fingers Crossed.
Update: This worked out fine, but [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p><img src="http://blowingthroughlines.com/wp-content/uploads/2009/02/various032-300x198.jpg" alt="Gilles Villeneuve(CDN) Ferrari 312T4" title="Gilles Villeneuve(CDN) Ferrari 312T4" width="300" height="198" class="alignnone size-medium wp-image-92" /> <img src="http://blowingthroughlines.com/wp-content/uploads/2009/02/various238-300x209.jpg" alt="Graham Hill(GBR) Lotus 33" title="Graham Hill(GBR) Lotus 33" width="300" height="209" class="alignnone size-medium wp-image-93" /></p>
<h4>Yeah old F1 Pics.</h4>
<p>Some explanation: We&#8217;re working on a RSS feed that can be read by Facebook so it can add images to the newsfeed post automagically. Then we want to see if when we change it in the RSS feed, it updates on FB or not. Fingers Crossed.</p>
<p><strong>Update:</strong> This worked out fine, but once the image is posted you&#8217;d have to replace the image on <em>your</em> webserver, with one of the same name, to change the one on FB (Since they externally load it each time).</p>


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://blowingthroughlines.com/2009/02/11/api/facebook-post-image-test/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quick Look for Actionscript (and most other c-like source-code)</title>
		<link>http://blowingthroughlines.com/2008/10/04/flash-as-3/quick-look-for-actionscript-and-most-other-c-like-source-code/</link>
		<comments>http://blowingthroughlines.com/2008/10/04/flash-as-3/quick-look-for-actionscript-and-most-other-c-like-source-code/#comments</comments>
		<pubDate>Sat, 04 Oct 2008 20:51:09 +0000</pubDate>
		<dc:creator>nilloc</dc:creator>
				<category><![CDATA[Flash AS 3.0]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[hints]]></category>
		<category><![CDATA[as]]></category>
		<category><![CDATA[util]]></category>

		<guid isPermaLink="false">http://blowingthroughlines.com/?p=85</guid>
		<description><![CDATA[Stumbled across this Quick Look plugin the other day while learning Objective-C, and while it previewed and code colored my .h and .m files, it was a bit disappointing that it didn&#8217;t work on .as files.
So not quite as simple as adding .as to the info.plist&#8212;what I&#8217;ve done is add public.archive.applesingle to the list of [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Stumbled across this Quick Look plugin the other day while learning Objective-C, and while it previewed and code colored my .h and .m files, it was a bit disappointing that it didn&#8217;t work on .as files.</p>
<p>So not quite as simple as adding .as to the info.plist&mdash;what I&#8217;ve done is add public.archive.applesingle to the list of UTI types. This is a bit of a hack, because Adobe doesn&#8217;t export a profile UTI with .as files. So if they do start doing that someday, this may cause problems, but in the meantime, it&#8217;s the simplest way to get quicklook working for .as files.</p>
<p><a href='http://blowingthroughlines.com/wp-content/uploads/2008/10/qlenscript_with_as.zip' title='quicklook as plugin'>Download Quick Look with ActionScript Plugin</a></p>


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://blowingthroughlines.com/2008/10/04/flash-as-3/quick-look-for-actionscript-and-most-other-c-like-source-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quick Look can do EPS too.</title>
		<link>http://blowingthroughlines.com/2008/09/29/hints/osx/quick-look-can-do-eps-too/</link>
		<comments>http://blowingthroughlines.com/2008/09/29/hints/osx/quick-look-can-do-eps-too/#comments</comments>
		<pubDate>Mon, 29 Sep 2008 08:15:44 +0000</pubDate>
		<dc:creator>nilloc</dc:creator>
				<category><![CDATA[OS X]]></category>

		<guid isPermaLink="false">http://blowingthroughlines.com/?p=80</guid>
		<description><![CDATA[Have to find the correct version of that logo to add to flash, but don&#8217;t want to load them all in the unbelievably slow preview app, or bother loading up Illustrator only to find out the designer sent you a photoshop eps without vector data? Sorry I&#8217;m venting a bit, but this plugin really saves [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Have to find the correct version of that logo to add to flash, but don&#8217;t want to load them all in the unbelievably slow preview app, or bother loading up Illustrator only to find out the designer sent you a photoshop eps without vector data? Sorry I&#8217;m venting a bit, but this plugin really saves me time—and it&#8217;s free.<br />
<a href="http://www.eternalstorms.at/utilities/epsqlplg/" target="_blank">EPS Quicklook Plugin</a></p>
<p>There&#8217;s actually a whole bunch of other plugins that are helpful too (beware: the zip one is pretty slow though).<br />
<a href="http://hrmpf.com/wordpress/218/quick-look-plugins-for-leopard">List of Quick Look Plugins for Leopard</a></p>


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://blowingthroughlines.com/2008/09/29/hints/osx/quick-look-can-do-eps-too/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FIVe3D Rocks, but name is hard to type fast&#8230;</title>
		<link>http://blowingthroughlines.com/2008/08/03/flash-as-3/five3d-rocks/</link>
		<comments>http://blowingthroughlines.com/2008/08/03/flash-as-3/five3d-rocks/#comments</comments>
		<pubDate>Sun, 03 Aug 2008 17:52:12 +0000</pubDate>
		<dc:creator>nilloc</dc:creator>
				<category><![CDATA[3D]]></category>
		<category><![CDATA[Flash AS 3.0]]></category>
		<category><![CDATA[Flex 3]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[flex]]></category>

		<guid isPermaLink="false">http://blowingthroughlines.com/?p=53</guid>
		<description><![CDATA[I don&#8217;t know where the capitalization came from, but it&#8217;s such a simple API for anyone who&#8217;s happy with AS3 (is there anyone who isn&#8217;t?) that FIVe3D worth the challenging finger-work. I made this demo in about 3 hours total, it draws bitmaps, and adds them to Sprite3Ds, and mimicks what we&#8217;ve been working on [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>I don&#8217;t know where the capitalization came from, but it&#8217;s such a simple API for anyone who&#8217;s happy with AS3 (is there anyone who isn&#8217;t?) that <a href="http://five3d.mathieu-badimon.com/" target="_blank" title="Kick-assingly simple 3D in Flash">FIVe3D</a> worth the challenging finger-work. I made this demo in about 3 hours total, it draws bitmaps, and adds them to Sprite3Ds, and mimicks what we&#8217;ve been working on for 2 months in <a href="http://blog.papervision3d.org" target="_blank" title="Kick-assingly complicated 3D in Flash">Papervision3D</a> (I&#8217;ll definitly have a link to that when its fully launched).</p>
<p>For a great many simpler 3D applications, I think FIVe3D is the way-to-go, but Papervision3D still does have an edge in speed (when properly optimized that is) if dealing with more then 20 or so planes.</p>
<p>One quirk of FIVe3D that I initially didn&#8217;t get, was that the order of my addChild statements determines what shows up on top of what, <em>not</em> the Z value of the sprite, so included with this source is a handy depth sorter loop, that will work with any 53D setup.</p>
<p><object type="application/x-shockwave-flash" data="http://blowingthroughlines.com/wp-content/uploads/2008/08/five3dtest.swf" width="100%" height="500" class="embedflash"><param name="movie" value="http://blowingthroughlines.com/wp-content/uploads/2008/08/five3dtest.swf" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><small>(Please open the article to see the flash file or player.)</small></object><br />
<a href='http://blowingthroughlines.com/wp-content/uploads/2008/08/five3dtest.zip'>FIVe3D Test Source</a></p>
<p>Also modified it a little so that height and width could be stored in the sprite3D class, i know bad me, but until i get my head around Mathieu&#8217;s version of Matrix3D. That ugly blinking plane on the right side is actually a series of bitmapDatas, that are playing back (like cached animation) that I learned from <a href="http://www.rockonflash.com/blog/" target="_blank">John Grden</a> a few weeks ago. I&#8217;m working on my own version of a class to automatically create bmp animations from a timeline swf, unless his goes open source&hellip;</p>


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://blowingthroughlines.com/2008/08/03/flash-as-3/five3d-rocks/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Some Flash Spring Physics</title>
		<link>http://blowingthroughlines.com/2008/08/03/flash-as-3/some-flash-spring-physics/</link>
		<comments>http://blowingthroughlines.com/2008/08/03/flash-as-3/some-flash-spring-physics/#comments</comments>
		<pubDate>Sun, 03 Aug 2008 16:45:14 +0000</pubDate>
		<dc:creator>nilloc</dc:creator>
				<category><![CDATA[Flash AS 3.0]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[nodes]]></category>
		<category><![CDATA[physics]]></category>
		<category><![CDATA[springy]]></category>

		<guid isPermaLink="false">http://blowingthroughlines.com/?p=43</guid>
		<description><![CDATA[Finally had an excuse to make some connected springs, ala the Visual Thesaurus. This was the last of the tests before realizing that the project would be simpler.
(Please open the article to see the flash file or player.)
Double-click a dot to add a child dot, or click and drag any dot to move it.
Some code [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Finally had an excuse to make some connected springs, ala the <a href="http://www.visualthesaurus.com/" target="_blank" title="what I ripped off, but in Flash">Visual Thesaurus</a>. This was the last of the tests before realizing that the project would be simpler.</p>
<p><object type="application/x-shockwave-flash" data="http://blowingthroughlines.com/wp-content/uploads/2008/08/tethering.swf" width="100%" height="500" class="embedflash"><param name="movie" value="http://blowingthroughlines.com/wp-content/uploads/2008/08/tethering.swf" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><small>(Please open the article to see the flash file or player.)</small></object></p>
<h6>Double-click a dot to add a child dot, or click and drag any dot to move it.</h6>
<p><del datetime="2009-04-01T18:26:12+00:00">Some code will be on the way in a bit.</del></p>
<h3>Update</h3>
<p class="postmetadata">Last edited by nilloc on Wednesday, April 1, 2009</p>
<p>Oh yeah, this is kinda late (my how the last 7 months flew by), but here&#8217;s the actual project in action:<br />
<a href="http://www.fuse.tv/ontv/shows/lil-wayne/" target="_blank">Lil&#8217; Wayne&#8217;s World</a></p>
<p>Oh yeah and here&#8217;s the source for the simple spring example above (AS2):<br />
<a href='http://blowingthroughlines.com/wp-content/uploads/2008/08/blowingthroughlinescom_spring_physics.zip'>blowingthroughlinescom_spring_physics</a></p>


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://blowingthroughlines.com/2008/08/03/flash-as-3/some-flash-spring-physics/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>ruby on rails 2.1 upload music and read id3 tags before saving to amazon S3</title>
		<link>http://blowingthroughlines.com/2008/07/22/ruby/ruby-on-rails-21-upload-music-and-read-id3-tags-before-saving-to-amazon-s3/</link>
		<comments>http://blowingthroughlines.com/2008/07/22/ruby/ruby-on-rails-21-upload-music-and-read-id3-tags-before-saving-to-amazon-s3/#comments</comments>
		<pubDate>Wed, 23 Jul 2008 01:29:06 +0000</pubDate>
		<dc:creator>jeff</dc:creator>
				<category><![CDATA[amazon]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[id3]]></category>
		<category><![CDATA[mp3]]></category>
		<category><![CDATA[upload]]></category>

		<guid isPermaLink="false">http://blowingthroughlines.com/?p=42</guid>
		<description><![CDATA[Sorry it has been so long since my last post. I doubt anyone is reading this anyways. In this article i&#8217;m going to attempt to show you what you need to know in order to upload a file (music in this case) into your rails application and safely tuck it away on amazons simple storage [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Sorry it has been so long since my last post. I doubt anyone is reading this anyways. In this article i&#8217;m going to attempt to show you what you need to know in order to upload a file (music in this case) into your rails application and safely tuck it away on amazons simple storage solution. I realize this is a very specific application. However, it took me two days to get this working properly so I figured i&#8217;d share what I did in order to get this working.  I&#8217;m assuming you are using rails 2.1 (but that may not be required) and have already created your application.  if not you can create and application by issuing the typical <code>rails application_nam</code> command
</p>
<p>
If you are just planning to upload file to S3 and do not need to manipulate them else do anything to them before they end up on the server. Then I suggest you just use the plugin.
</p>
<p>
simply install</p>
<pre>script/plugin install http://svn.techno-weenie.net/projects/plugins/attachment_fu/</pre>
<p>after that just follow the instructions on <a href="http://clarkware.com/cgi/blosxom/2007/02/24">http://clarkware.com/cgi/blosxom/2007/02/24</a> you should be up and running in no time with the help of this plugin</p>
<h3>Lets assume you don&#8217;t want to use the plugin</h3>
<p>But why would we not want to use the plugin:?<br/></p>
<ol>
<li>Way more code than you need for the task at hand</li>
<li>No simple way to manipulate the file or extract data from it before sending to S3</li>
<p></o><br />
So now that we are going to perform this operation manually there are a few things you will need for this example.  You will need to install the mp3info gem as root at command prompt.<br />
<code>gem install mp3info</code><br />
<code>gem install aws-s3 </code><br />
Say yes to any dependencies once those two gems successfully install you will have to restart your webserver and they will be ready to use in your application
</p>
<p>  I&#8217;m going to skip over a lot here because I don&#8217;t know how you want to configure your application however the steps are pretty simple create some scaffold.  Make an upload form.<br />
and then save the data.  I&#8217;m only going to show you the model code.  I believe everything is self explanatory from there.  I will be happy to field any questions if anyone cares to ask.  Enought chit chat show me the code</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p42code24'); return false;">View Code</a> RUBY</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p4224"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
</pre></td><td class="code" id="p42code24"><pre class="ruby" style="font-family:monospace;"><span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">&quot;ftools&quot;</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">&quot;aws/s3&quot;</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">&quot;mp3info&quot;</span>
<span style="color:#9966CC; font-weight:bold;">class</span> Song <span style="color:#006600; font-weight:bold;">&lt;</span> <span style="color:#6666ff; font-weight:bold;">ActiveRecord::Base</span>
   <span style="color:#9966CC; font-weight:bold;">include</span> <span style="color:#6666ff; font-weight:bold;">AWS::S3</span>
   belongs_to              <span style="color:#ff3333; font-weight:bold;">:user</span>
   has_one                 <span style="color:#ff3333; font-weight:bold;">:song_metadata</span>
   before_validation       <span style="color:#ff3333; font-weight:bold;">:set_all_meta_data</span>
   after_save              <span style="color:#ff3333; font-weight:bold;">:write_file</span>
   after_destroy           <span style="color:#ff3333; font-weight:bold;">:delete_file</span>
   before_create           <span style="color:#ff3333; font-weight:bold;">:connect_to_amazon</span>
   validates_inclusion_of  <span style="color:#ff3333; font-weight:bold;">:mime_type</span>, :<span style="color:#9966CC; font-weight:bold;">in</span> <span style="color:#006600; font-weight:bold;">=&gt;%</span>w<span style="color:#006600; font-weight:bold;">&#40;</span> audio<span style="color:#006600; font-weight:bold;">/</span>mpeg audio<span style="color:#006600; font-weight:bold;">/</span>mpg <span style="color:#006600; font-weight:bold;">&#41;</span>, <span style="color:#ff3333; font-weight:bold;">:message</span> <span style="color:#006600; font-weight:bold;">=&gt;</span><span style="color:#996600;">&quot;The file you uploaded is not an mp3&quot;</span>
   validates_inclusion_of  <span style="color:#ff3333; font-weight:bold;">:file_size</span>, :<span style="color:#9966CC; font-weight:bold;">in</span> <span style="color:#006600; font-weight:bold;">=&gt;</span><span style="color:#006666;">300</span>.<span style="color:#9900CC;">kilobytes</span>..20.<span style="color:#9900CC;">megabytes</span>, <span style="color:#ff3333; font-weight:bold;">:message</span><span style="color:#006600; font-weight:bold;">=&gt;</span><span style="color:#996600;">&quot;must be between 300k and 20mb&quot;</span>
   attr_accessor <span style="color:#ff3333; font-weight:bold;">:id3tags</span>
   <span style="color:#9966CC; font-weight:bold;">def</span> song=<span style="color:#006600; font-weight:bold;">&#40;</span>file_data<span style="color:#006600; font-weight:bold;">&#41;</span>
     <span style="color:#0066ff; font-weight:bold;">@file_data</span> = file_data
   <span style="color:#9966CC; font-weight:bold;">end</span>
   <span style="color:#9966CC; font-weight:bold;">def</span> write_file
     buckets = Service.<span style="color:#9900CC;">buckets</span>
     bucketexists=<span style="color:#0000FF; font-weight:bold;">false</span>
     buckets.<span style="color:#9900CC;">each</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>bucket<span style="color:#006600; font-weight:bold;">|</span>
       <span style="color:#9966CC; font-weight:bold;">if</span> bucket.<span style="color:#9900CC;">name</span> == AppConfig.<span style="color:#9900CC;">ec2</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;bucket&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span>
         bucketexists=<span style="color:#0000FF; font-weight:bold;">true</span>
       <span style="color:#9966CC; font-weight:bold;">end</span>
     <span style="color:#9966CC; font-weight:bold;">end</span>
     <span style="color:#9966CC; font-weight:bold;">if</span> !bucketexists
       Bucket.<span style="color:#9900CC;">create</span><span style="color:#006600; font-weight:bold;">&#40;</span>AppConfig.<span style="color:#9900CC;">ec2</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;bucket&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
     <span style="color:#9966CC; font-weight:bold;">end</span>
     <span style="color:#0066ff; font-weight:bold;">@file_data</span>.<span style="color:#9900CC;">rewind</span>
     <span style="color:#9966CC; font-weight:bold;">if</span> !S3Object.<span style="color:#9900CC;">exists</span>? get_file_url, AppConfig.<span style="color:#9900CC;">ec2</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;bucket&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span>
      createsong_meta
      S3Object.<span style="color:#9900CC;">store</span><span style="color:#006600; font-weight:bold;">&#40;</span>get_file_url, <span style="color:#0066ff; font-weight:bold;">@file_data</span>.<span style="color:#9900CC;">read</span>, AppConfig.<span style="color:#9900CC;">ec2</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;bucket&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span>,:access <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#ff3333; font-weight:bold;">:public_read</span><span style="color:#006600; font-weight:bold;">&#41;</span>
     <span style="color:#9966CC; font-weight:bold;">end</span>
   <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">def</span> createsong_meta
        m = SongMetadata.<span style="color:#9900CC;">new</span>
        <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">song_metadata</span> = m
        <span style="color:#9966CC; font-weight:bold;">if</span> id3tags.<span style="color:#9900CC;">title</span>
         m.<span style="color:#9900CC;">title</span>       = id3tags.<span style="color:#9900CC;">title</span>
        <span style="color:#9966CC; font-weight:bold;">else</span>
         m.<span style="color:#9900CC;">title</span> = <span style="color:#996600;">&quot;No song name set&quot;</span>
        <span style="color:#9966CC; font-weight:bold;">end</span>
        <span style="color:#9966CC; font-weight:bold;">if</span> id3tags.<span style="color:#9900CC;">artist</span>
          m.<span style="color:#9900CC;">artist</span>      = id3tags.<span style="color:#9900CC;">artist</span>
        <span style="color:#9966CC; font-weight:bold;">else</span>
          m.<span style="color:#9900CC;">artist</span> = <span style="color:#996600;">&quot;No artist name set&quot;</span>
        <span style="color:#9966CC; font-weight:bold;">end</span>
        <span style="color:#9966CC; font-weight:bold;">if</span> id3tags.<span style="color:#9900CC;">album</span>
          m.<span style="color:#9900CC;">album</span> = id3tags.<span style="color:#9900CC;">album</span>
        <span style="color:#9966CC; font-weight:bold;">else</span>
          m.<span style="color:#9900CC;">album</span> = <span style="color:#996600;">&quot;No album name set&quot;</span>
        <span style="color:#9966CC; font-weight:bold;">end</span>
        m.<span style="color:#9900CC;">year</span>        = id3tags.<span style="color:#9900CC;">year</span>
        m.<span style="color:#9900CC;">track_number</span>= id3tags.<span style="color:#9900CC;">tracknum</span>
        m.<span style="color:#9900CC;">save</span>!
   <span style="color:#9966CC; font-weight:bold;">end</span>
   <span style="color:#9966CC; font-weight:bold;">def</span> get_song
     <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">connect_to_amazon</span>
     S3Object.<span style="color:#9900CC;">value</span> mp3_url, AppConfig.<span style="color:#9900CC;">ec2</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;bucket&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span>
   <span style="color:#9966CC; font-weight:bold;">end</span>
   <span style="color:#9966CC; font-weight:bold;">def</span> delete_file
     <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">connect_to_amazon</span>
     S3Object.<span style="color:#9900CC;">delete</span> mp3_url, AppConfig.<span style="color:#9900CC;">ec2</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;bucket&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span>
   <span style="color:#9966CC; font-weight:bold;">end</span>
   <span style="color:#9966CC; font-weight:bold;">def</span> set_all_meta_data
     <span style="color:#9966CC; font-weight:bold;">if</span> <span style="color:#0066ff; font-weight:bold;">@file_data</span>!=<span style="color:#996600;">&quot;&quot;</span> <span style="color:#006600; font-weight:bold;">&amp;&amp;</span> <span style="color:#0066ff; font-weight:bold;">@file_data</span>
      <span style="color:#0066ff; font-weight:bold;">@file_data</span>.<span style="color:#9900CC;">rewind</span>
      <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">mime_type</span> = <span style="color:#0066ff; font-weight:bold;">@file_data</span>.<span style="color:#9900CC;">content_type</span>
      <span style="color:#9966CC; font-weight:bold;">if</span> <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">mime_type</span> == <span style="color:#996600;">&quot;audio/mpg&quot;</span> <span style="color:#006600; font-weight:bold;">||</span> <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">mime_type</span>==<span style="color:#996600;">&quot;audio/mpeg&quot;</span>
        tmplocal = <span style="color:#996600;">&quot;#{RAILS_ROOT}/tmp/musicfiles&quot;</span>
        tmpname = <span style="color:#996600;">&quot;#{Time.now}-#{@file_data.original_filename}&quot;</span>
        <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">makedirs</span><span style="color:#006600; font-weight:bold;">&#40;</span>tmplocal<span style="color:#006600; font-weight:bold;">&#41;</span>
        <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#CC0066; font-weight:bold;">open</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;#{tmplocal}/#{tmpname}&quot;</span>, <span style="color:#996600;">&quot;w&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#006600; font-weight:bold;">|</span>file<span style="color:#006600; font-weight:bold;">|</span> file.<span style="color:#9900CC;">write</span><span style="color:#006600; font-weight:bold;">&#40;</span>@file_data.<span style="color:#9900CC;">read</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#125;</span>
        mymp3 = Mp3Info.<span style="color:#CC0066; font-weight:bold;">open</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;#{tmplocal}/#{tmpname}&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>        <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">id3tags</span>     = mymp3.<span style="color:#9900CC;">tag</span>
        <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">bitrate</span>     = mymp3.<span style="color:#9900CC;">bitrate</span>
        <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">samplerate</span>  = mymp3.<span style="color:#9900CC;">samplerate</span>
        <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">samplerate</span>  = mymp3.<span style="color:#9900CC;">samplerate</span>
        <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">mpeg_version</span>= mymp3.<span style="color:#9900CC;">mpeg_version</span>
        <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">layer</span>       = mymp3.<span style="color:#9900CC;">layer</span>
        <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">length</span>      = mymp3.<span style="color:#9900CC;">length</span>
        <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">file_size</span>   = <span style="color:#0066ff; font-weight:bold;">@file_data</span>.<span style="color:#9900CC;">size</span>
        mymp3.<span style="color:#9900CC;">close</span>
        <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">delete</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;#{tmplocal}/#{tmpname}&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
        <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">mp3_url</span> = get_file_url
      <span style="color:#9966CC; font-weight:bold;">end</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
   <span style="color:#9966CC; font-weight:bold;">end</span>
   <span style="color:#9966CC; font-weight:bold;">def</span> get_file_url
    <span style="color:#996600;">&quot;#{user_id}/xrays/#{id}/song/#{@file_data.original_filename}&quot;</span>
   <span style="color:#9966CC; font-weight:bold;">end</span>
   <span style="color:#9966CC; font-weight:bold;">def</span> connect_to_amazon
     Base.<span style="color:#9900CC;">establish_connection</span>!<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:access_key_id</span><span style="color:#006600; font-weight:bold;">=&gt;</span> AppConfig.<span style="color:#9900CC;">ec2</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;access_key&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span>, <span style="color:#ff3333; font-weight:bold;">:secret_access_key</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> AppConfig.<span style="color:#9900CC;">ec2</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;secret_key&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
   <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></td></tr></table></div>

<p>
That is really the meat and potatoes.  It is all hanging out in the model nicely tucked away.  getting the data out of S3 is simple and is left as an exercise for the reader.  Obviously you need to insert your own access_key and secret key.  I&#8217;m not making any assumptions about the configuration of your application and thus this is entirely us to you the reader as well.  Hope this helps someone..</p>


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://blowingthroughlines.com/2008/07/22/ruby/ruby-on-rails-21-upload-music-and-read-id3-tags-before-saving-to-amazon-s3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fixed Opening FLAs in Flex 3 for OS X</title>
		<link>http://blowingthroughlines.com/2008/07/05/flex-3/opening-flas-in-flex/</link>
		<comments>http://blowingthroughlines.com/2008/07/05/flex-3/opening-flas-in-flex/#comments</comments>
		<pubDate>Sat, 05 Jul 2008 21:54:05 +0000</pubDate>
		<dc:creator>nilloc</dc:creator>
				<category><![CDATA[Flex 3]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[fix]]></category>
		<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://blowingthroughlines.com/?p=41</guid>
		<description><![CDATA[So we&#8217;ve been developing in Flex 3 for the last 3 months now, and I&#8217;m wondering why I didn&#8217;t switch earlier&#8230; Anyway a small annoyance that bothered me for the first couple weeks was the inability to double click any files that needed to be edited outside of Flex. It just throws this weird error:
Unable [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>So we&#8217;ve been developing in Flex 3 for the last 3 months now, and I&#8217;m wondering why I didn&#8217;t switch earlier&#8230; Anyway a small annoyance that bothered me for the first couple weeks was the inability to double click any files that needed to be edited outside of Flex. It just throws this weird error:<br />
Unable to open external editor&#8230;<br />
(com.adobe.flexbuilder.ui.osx_3.0.194161)<br />
<a href="http://bugs.adobe.com/jira/browse/FB-10670" target="_blank">Sort of more about the error hereâ€¦</a></p>
<p>With a little research it seems that this is a problem with the System Editor settings with Eclipse itself (which Flex Builder is based, for the noobs like I me).</p>
<p>So taking a bit of a shot in the dark I looked through com.adobe.flexbuilder.ui.osx_3.0.194161, and it didn&#8217;t seem to have anything other then commands to open system editable? files. So just deleted the package from the plugins folder (actually i moved it to a plugins-disabled folder in the main Flex directory), and holy crap it worked!</p>
<p>So far I and my co-developer Sean, and our intern Derek haven&#8217;t come across any other errors, or changes in performance, just the unfettered ability to double-click FLAs and watch them load in Flash.</p>
<p>Give it a try and lemme know if your results vary. Though I suppose you should be doing so at your own risk&#8230;</p>


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://blowingthroughlines.com/2008/07/05/flex-3/opening-flas-in-flex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Automatic Bending Joints in As3 (Simple Bones)</title>
		<link>http://blowingthroughlines.com/2008/02/10/cs3/automatic-bending-joints-in-as3-simple-bones/</link>
		<comments>http://blowingthroughlines.com/2008/02/10/cs3/automatic-bending-joints-in-as3-simple-bones/#comments</comments>
		<pubDate>Sun, 10 Feb 2008 22:32:40 +0000</pubDate>
		<dc:creator>nilloc</dc:creator>
				<category><![CDATA[Animation]]></category>
		<category><![CDATA[CS3]]></category>
		<category><![CDATA[Flash AS 3.0]]></category>

		<guid isPermaLink="false">http://blowingthroughlines.com/2008/02/10/flash-as3/automatic-bending-joints-in-as3-simple-bones/</guid>
		<description><![CDATA[This was part of a Rock&#8217;em Sock&#8217;em Robot game&#038; 8212;for an internal sales project no less! At any rate the budget was good, but the timeline was a little tight, and I was still getting my head around AS3 and the new Flash 9 features.
So I had this idea:
I&#8217;m working with a bunch of designer&#8217;s [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>This was part of a Rock&#8217;em Sock&#8217;em Robot game&#038; 8212;for an internal sales project no less! At any rate the budget was good, but the timeline was a little tight, and I was still getting my head around AS3 and the new Flash 9 features.</p>
<h3>So I had this idea:</h3>
<p>I&#8217;m working with a bunch of designer&#8217;s who are really good with illustrator, and keyframe animating, but don&#8217;t have the time to animate all the movements (each head, body, upper arm x2 lower arm x2, legs, hands, feet&#8230; well you get the idea). So I needed a way to reduce the number of animations that the designers would be needed for, but also not create too many Tweeners or other hard coded animation solutions. I really needed <a href="http://aralbalkan.com/1072" target="_blank" title="Animated IK (bones) in Diesel (Flash CS4)">bones</a>, but those don&#8217;t seem to be arriving for a while, so the next best thing was automatically animated elbows (and knees). Fortunately for me the illustrator I was working with designed the robot&#8217;s arms and legs with even length upper and lower lengths so I could do some trig and get this:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p35code26'); return false;">View Code</a> ACTIONSCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p3526"><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code" id="p35code26"><pre class="actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> theta:<span style="color: #0066CC;">Number</span> = <span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">acos</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>distance<span style="color: #66cc66;">/</span><span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">/</span>limbL<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">*</span><span style="color: #cc66cc;">180</span><span style="color: #66cc66;">/</span><span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">PI</span>;
&nbsp;
<span style="color: #0066CC;">this</span>.<span style="color: #006600;">limb</span>.<span style="color: #006600;">rotation</span> =  baseRotation - theta;
<span style="color: #0066CC;">this</span>.<span style="color: #006600;">omoLimb</span>.<span style="color: #006600;">rotation</span> = theta <span style="color: #66cc66;">*</span> <span style="color: #cc66cc;">2</span>;</pre></td></tr></table></div>

<p><object type="application/x-shockwave-flash" data="http://blowingthroughlines.com/wp-content/uploads/2008/02/joint_test4.swf" width="500" height="400" class="embedflash"><param name="movie" value="http://blowingthroughlines.com/wp-content/uploads/2008/02/joint_test4.swf" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><small>(Please open the article to see the flash file or player.)</small></object><br />
<span class="caption">Click and drag the hand or foot to see the automagic joint rotation</span></p>
<p><a href='http://blowingthroughlines.com/wp-content/uploads/2008/02/blowingthroughlines_joint.zip' title='AS3 Joint class source'>AS3 Joint class source file</a></p>
<p>Right now it&#8217;s limited to even length bones, but my little brother with the physics and math degrees, says he has a better equation, so as soon as I have time I&#8217;ll update the classes. A public SVN repository is in the works too, stay tuned.</p>


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://blowingthroughlines.com/2008/02/10/cs3/automatic-bending-joints-in-as3-simple-bones/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rsyslogd man pages have a great sense of humor</title>
		<link>http://blowingthroughlines.com/2008/02/09/rsyslog/rsyslogd-man-pages-have-a-great-sense-of-humor/</link>
		<comments>http://blowingthroughlines.com/2008/02/09/rsyslog/rsyslogd-man-pages-have-a-great-sense-of-humor/#comments</comments>
		<pubDate>Sat, 09 Feb 2008 17:08:43 +0000</pubDate>
		<dc:creator>jeff</dc:creator>
				<category><![CDATA[red5]]></category>
		<category><![CDATA[rsyslog]]></category>

		<guid isPermaLink="false">http://blowingthroughlines.com/2008/02/09/rsyslog/rsyslogd-man-pages-have-a-great-sense-of-humor/</guid>
		<description><![CDATA[During a day of red5 programming, in the hopes to get a true streaming solution for my flash projects I stumbled upon this little gem.   I&#8217;ll post about my experiences with red5 at a later time.  However, for now I think you should check out this excerpt from the rsyslogd man pages. [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>During a day of <a href="http://osflash.org/red5">red5</a> programming, in the hopes to get a true streaming solution for my flash projects I stumbled upon this little gem.   I&#8217;ll post about my experiences with red5 at a later time.  However, for now I think you should check out this excerpt from the <a href="http://www.rsyslog.com/">rsyslogd</a> man pages.  We are using rsyslog in the hopes that we can log all the red5 events to a centralized server for easier reporting.  Check back for updates on that.  As always if you like this article please digg it and or leave a comment so we don&#8217;t feel like we are talking to ourselves&#8230;.  Enjoy</p>
<p><a href="http://blowingthroughlines.com/wp-content/uploads/2008/02/rsyslogscreen.jpg" title="sucker rod and rsyslog"><img src="http://blowingthroughlines.com/wp-content/uploads/2008/02/rsyslogscreen.jpg" alt="sucker rod and rsyslog" /></a></p>
<p>At least the suggest violence as a last ditch effort.  Hilarious open source world keep it up&#8230;</p>


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://blowingthroughlines.com/2008/02/09/rsyslog/rsyslogd-man-pages-have-a-great-sense-of-humor/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Highlight selected navigation item in ruby on rails</title>
		<link>http://blowingthroughlines.com/2008/02/03/ruby/highlight-selected-navigation-item-in-ruby-on-rails/</link>
		<comments>http://blowingthroughlines.com/2008/02/03/ruby/highlight-selected-navigation-item-in-ruby-on-rails/#comments</comments>
		<pubDate>Sun, 03 Feb 2008 15:54:30 +0000</pubDate>
		<dc:creator>jeff</dc:creator>
				<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[site navigation]]></category>

		<guid isPermaLink="false">http://blowingthroughlines.com/2008/02/03/flash-as3/highlight-selected-navigation-item-in-ruby-on-rails/</guid>
		<description><![CDATA[For an example site where I used this technique please refer to www.howcuteismypet.com you&#8217;ll notice that when you click on best / worst or most recent it is highlighted with a black underline.  This type of highlighting seems trivial.  However to do it in rails in a nice elegant way is not obvious. [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>For an example site where I used this technique please refer to <a href="http://www.howcuteismypet.com" target="_blank">www.howcuteismypet.com</a> you&#8217;ll notice that when you click on best / worst or most recent it is highlighted with a black underline.  This type of highlighting seems trivial.  However to do it in rails in a nice elegant way is not obvious.  So without further a do, I present my method.  This method dis-involves the controller which makes for a cleaner more centralized place for managing your highlighted navigation.</p>
<p>The primary thing required is a method for creating navigation items.  I choose to put my method / helper. in the app/helpers/application_helper.rb that way it will be available to all all of my views.   The method I chose to use is</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p32code29'); return false;">View Code</a> RUBY</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p3229"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code" id="p32code29"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">def</span> nav_selected_no_span<span style="color:#006600; font-weight:bold;">&#40;</span>hash_name, selectedkey <span style="color:#006600; font-weight:bold;">&#41;</span>
                result =<span style="color:#996600;">&quot;&quot;</span>
                hash_name.<span style="color:#9900CC;">each</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>item<span style="color:#006600; font-weight:bold;">|</span>
                        <span style="color:#9966CC; font-weight:bold;">if</span><span style="color:#006600; font-weight:bold;">&#40;</span>item<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;">0</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#9900CC;">to_s</span>== selectedkey<span style="color:#006600; font-weight:bold;">&#41;</span>
                                result <span style="color:#006600; font-weight:bold;">+</span>=<span style="color:#996600;">&quot;&lt;li class=&quot;</span>selected<span style="color:#996600;">&quot;+item[0].to_s.gsub(&quot;</span> <span style="color:#996600;">&quot;, &quot;</span>_<span style="color:#996600;">&quot;).downcase+&quot;</span> selected<span style="color:#996600;">&quot;&gt;&quot;</span><span style="color:#006600; font-weight:bold;">+</span>link_to<span style="color:#006600; font-weight:bold;">&#40;</span>item<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;">0</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#9900CC;">to_s</span>,item<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;">1</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#9900CC;">to_s</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">+</span><span style="color:#996600;">&quot;&lt;/li&gt;&quot;</span>
                        <span style="color:#9966CC; font-weight:bold;">else</span>
                                result <span style="color:#006600; font-weight:bold;">+</span>=<span style="color:#996600;">&quot;&lt;li class=&quot;</span><span style="color:#996600;">&quot;+item[0].to_s.gsub(&quot;</span> <span style="color:#996600;">&quot;,&quot;</span>_<span style="color:#996600;">&quot;).downcase+&quot;</span> ns<span style="color:#996600;">&quot;&gt;&quot;</span><span style="color:#006600; font-weight:bold;">+</span>link_to<span style="color:#006600; font-weight:bold;">&#40;</span>item<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;">0</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#9900CC;">to_s</span>,item<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;">1</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#9900CC;">to_s</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">+</span><span style="color:#996600;">&quot;&lt;/li&gt;&quot;</span>
                        <span style="color:#9966CC; font-weight:bold;">end</span>
                  <span style="color:#9966CC; font-weight:bold;">end</span>
                  <span style="color:#0000FF; font-weight:bold;">return</span> result
        <span style="color:#9966CC; font-weight:bold;">end</span></pre></td></tr></table></div>

<p>This function is fairly, simple what it allows you to do in your view is, make an unorded list of your navigation items.  You would use this method most likely in your app/views/layout/application.rb.  An example of the navigation from howcuteismypet.com is:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p32code30'); return false;">View Code</a> RUBY</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p3230"><td class="line_numbers"><pre>6
7
8
</pre></td><td class="code" id="p32code30"><pre class="ruby" style="font-family:monospace;"><span style="color:#006600; font-weight:bold;">&lt;</span>ul<span style="color:#006600; font-weight:bold;">&gt;</span>
     <span style="color:#006600; font-weight:bold;">&lt;%</span>= nav_selected_no_span<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;Vote On Pets&quot;</span>,home_path<span style="color:#006600; font-weight:bold;">&#93;</span>,<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;Best / Worst&quot;</span>,best_worst_path<span style="color:#006600; font-weight:bold;">&#93;</span>,<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;Most Recent&quot;</span>,most_recent_path<span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#93;</span>, params<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:location</span><span style="color:#006600; font-weight:bold;">&#93;</span> <span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">%&gt;</span>
<span style="color:#006600; font-weight:bold;">&lt;/</span>ul<span style="color:#006600; font-weight:bold;">&gt;</span></pre></td></tr></table></div>

<p>The important thing to notice is the params[:location] the function above says that if params[:location] matches one of the names like &#8220;Vote On Pets&#8221; then highlight that item.  Pretty simple.  Then in your css you can define the rules that make something selected.  Now you may be wondering where params[:location] is set.  And you would be correct to wonder that.  That parameter is actually set in your routes file believe it or not.  As an example i&#8217;ll show you the route for &#8220;Vote On Pets&#8221;.  located in config/routes.rb your could do something like this.</p>
<pre>map.home '', :controller =&gt; 'index', :action =&gt; 'index', :location=&gt;'Vote On Pets'</pre>
<p>if you wanted most recent you would do something like this</p>
<pre>map.most_recent '/most_recent', :controller=&gt;'index',:action=&gt;'recent',:location=&gt;'Most Recent'</pre>
<p>The location parameter is sent to the helper and the correct items is selected.  So I hope this helps you in your efforts to stay dry and much more organized.</p>
<p>Questions and comments are very welcome on this blog.  We like to know we are not talking to ourselves, so if you would like further explanation please feel free to post a comment.</p>


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://blowingthroughlines.com/2008/02/03/ruby/highlight-selected-navigation-item-in-ruby-on-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Accordion Meets XML</title>
		<link>http://blowingthroughlines.com/2008/01/27/cs3/accordion-meets-xml/</link>
		<comments>http://blowingthroughlines.com/2008/01/27/cs3/accordion-meets-xml/#comments</comments>
		<pubDate>Mon, 28 Jan 2008 06:53:40 +0000</pubDate>
		<dc:creator>nilloc</dc:creator>
				<category><![CDATA[CS3]]></category>
		<category><![CDATA[Flash AS 3.0]]></category>

		<guid isPermaLink="false">http://blowingthroughlines.com/2008/01/27/flash-as3/accordion-meets-xml/</guid>
		<description><![CDATA[So a reader asked how to implement our accordion script using XML to populate it, and I think the results aren&#8217;t half bad. I&#8217;m not sure what he meant by a cervical shaped accordion though&#8230; Circular maybe? hopefully?
(Please open the article to see the flash file or player.)
source files for the xml&#8217;d accordion

?View Code ACTIONSCRIPTprivate [...]


Related posts:<ol><li><a href='http://blowingthroughlines.com/2009/12/13/flash-as-3/tabs-and-linefeeds-newlines-in-xml-driven-textfields/' rel='bookmark' title='Permanent Link: Tabs and Linefeeds (Newlines) in XML driven TextFields'>Tabs and Linefeeds (Newlines) in XML driven TextFields</a> <small>Man Flash can be annoying sometimes. So I&#8217;m showing some...</small></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>So a reader asked how to implement <a href="http://blowingthroughlines.com/2007/09/17/flash-as3/accordion-component-as3-flash-9/">our accordion script</a> using XML to populate it, and I think the results aren&#8217;t half bad. I&#8217;m not sure what he meant by a <em>cervical</em> shaped accordion though&#8230; Circular maybe? hopefully?</p>
<p><object type="application/x-shockwave-flash" data="http://blowingthroughlines.com/wp-content/uploads/2008/01/accordionxml.swf" width="500" height="400" class="embedflash"><param name="movie" value="http://blowingthroughlines.com/wp-content/uploads/2008/01/accordionxml.swf" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><small>(Please open the article to see the flash file or player.)</small></object></p>
<p><a href='http://blowingthroughlines.com/wp-content/uploads/2008/01/accordion_xml.zip' title='source files for the xmled accordion'>source files for the xml&#8217;d accordion</a></p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p30code35'); return false;">View Code</a> ACTIONSCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p3035"><td class="code" id="p30code35"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">private</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: #66cc66;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">var</span> request:URLRequest = <span style="color: #000000; font-weight: bold;">new</span> URLRequest<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;wp-content/xml/images.xml&quot;</span><span style="color: #66cc66;">&#41;</span>;
	loader = <span style="color: #000000; font-weight: bold;">new</span> URLLoader<span style="color: #66cc66;">&#40;</span>request<span style="color: #66cc66;">&#41;</span>;
	loader.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">COMPLETE</span>, loadComplete<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> loadComplete<span style="color: #66cc66;">&#40;</span>evt:Event<span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #0066CC;">data</span> = <span style="color: #0066CC;">XML</span><span style="color: #66cc66;">&#40;</span>evt.<span style="color: #0066CC;">target</span>.<span style="color: #0066CC;">data</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">data</span>.<span style="color: #006600;">panel</span>.<span style="color: #0066CC;">length</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
	accord = <span style="color: #000000; font-weight: bold;">new</span> accordion<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">500</span>, <span style="color: #cc66cc;">400</span>, <span style="color: #0066CC;">data</span>.<span style="color: #006600;">panel</span>.<span style="color: #0066CC;">length</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>, <span style="color: #cc66cc;">20</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
	<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> <span style="color: #0066CC;">data</span>.<span style="color: #006600;">panel</span>.<span style="color: #0066CC;">length</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>; i++<span style="color: #66cc66;">&#41;</span>
	<span style="color: #66cc66;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">var</span> panel:<span style="color: #0066CC;">MovieClip</span> = <span style="color: #000000; font-weight: bold;">new</span> NavPanel<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">data</span>.<span style="color: #006600;">panel</span><span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span>.<span style="color: #0066CC;">name</span><span style="color: #66cc66;">&#41;</span>;
		<span style="color: #000000; font-weight: bold;">var</span> contents:<span style="color: #0066CC;">MovieClip</span> = <span style="color: #000000; font-weight: bold;">new</span> ImgHolder<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">data</span>.<span style="color: #006600;">panel</span><span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span>.<span style="color: #006600;">img</span><span style="color: #66cc66;">&#41;</span>;
		accord.<span style="color: #006600;">addPanel</span><span style="color: #66cc66;">&#40;</span>panel, contents<span style="color: #66cc66;">&#41;</span>;
	<span style="color: #66cc66;">&#125;</span>
	addChild<span style="color: #66cc66;">&#40;</span>accord<span style="color: #66cc66;">&#41;</span>;
	accord.<span style="color: #006600;">openPanel</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>


<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p30code36'); return false;">View Code</a> XML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p3036"><td class="code" id="p30code36"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;panels<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;panel<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>panel one<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;img<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>img/1905143678_218d1aa13a.jpg<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/img<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/panel<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;panel<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>panel zwei<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;img<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>img/1904306625_fa9cf2cd33.jpg<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/img<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/panel<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;panel<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>panel tre<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;img<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>img/1904436509_2266d2daf2.jpg<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/img<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/panel<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;panel<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>panel quattre<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;img<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>img/1904437975_441fec52af.jpg<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/img<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/panel<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/panels<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>



<p>Related posts:<ol><li><a href='http://blowingthroughlines.com/2009/12/13/flash-as-3/tabs-and-linefeeds-newlines-in-xml-driven-textfields/' rel='bookmark' title='Permanent Link: Tabs and Linefeeds (Newlines) in XML driven TextFields'>Tabs and Linefeeds (Newlines) in XML driven TextFields</a> <small>Man Flash can be annoying sometimes. So I&#8217;m showing some...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://blowingthroughlines.com/2008/01/27/cs3/accordion-meets-xml/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Prototype javascript css Tabs</title>
		<link>http://blowingthroughlines.com/2007/12/29/javascript/prototype-css-tabs/</link>
		<comments>http://blowingthroughlines.com/2007/12/29/javascript/prototype-css-tabs/#comments</comments>
		<pubDate>Sat, 29 Dec 2007 21:53:30 +0000</pubDate>
		<dc:creator>jeff</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[prototype]]></category>
		<category><![CDATA[tabs]]></category>

		<guid isPermaLink="false">http://blowingthroughlines.com/2007/12/29/flash-as3/prototype-css-tabs/</guid>
		<description><![CDATA[Recently I had to make tabs.  Something that has been solved hundreds of times.  However I didn&#8217;t want to fuck around with a special user interface framework like http://developer.yahoo.com/yui/.  Since I use prototype on almost every project since its inception, I decided to just roll out my own solution using the prototype [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Recently I had to make tabs.  Something that has been solved hundreds of times.  However I didn&#8217;t want to fuck around with a special user interface framework like <a href="http://developer.yahoo.com/yui/">http://developer.yahoo.com/yui/</a>.  Since I use <a href="http://www.prototypejs.org/">prototype</a> on almost every project since its inception, I decided to just roll out my own solution using the prototype library as a base.  It turns out that the implementation was incredibly simple.  I have attached a working example for your copy and paste pleasure.   The javascript is incredibly simple.  The entire javascript programming was less than 25 lines.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p28code39'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p2839"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
</pre></td><td class="code" id="p28code39"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> tablinks <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> tabcontent <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">function</span> handletab<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> element <span style="color: #339933;">=</span> event.<span style="color: #660066;">element</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;">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>tablinks.<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: #003366; font-weight: bold;">var</span> tabli <span style="color: #339933;">=</span> tablinks<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">up</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'li'</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>tablinks<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">==</span>element<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
			tabcontent<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">show</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			tabli.<span style="color: #660066;">removeClassName</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'deactivetab'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			tabli.<span style="color: #660066;">addClassName</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'activetab'</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>
			tabcontent<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			tabli.<span style="color: #660066;">removeClassName</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'activetab'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			tabli.<span style="color: #660066;">addClassName</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'deactivetab'</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;">&#125;</span>
<span style="color: #003366; font-weight: bold;">function</span> homepageSetup<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	tablinks <span style="color: #339933;">=</span> $$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'a.tablink'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	tabcontent <span style="color: #339933;">=</span> $$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'div.tabcontent'</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>tablinks.<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>
		tablinks<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">observe</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'click'</span><span style="color: #339933;">,</span>handletab<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		tablinks<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">onclick</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: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p><a href="http://blowingthroughlines.com/wp-content/uploads/2007/12/blowingthroughlinescom-tabs-example.zip" title="Prototype javascript css tabs - blowingthroughlines.com">Prototype javascript css tabs &#8211; blowingthroughlines.com</a></p>
<p>If you find this article and or code useful feel free to leave a comment.  I&#8217;d love to hear what you think.</p>


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://blowingthroughlines.com/2007/12/29/javascript/prototype-css-tabs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google maps state zoom and center code</title>
		<link>http://blowingthroughlines.com/2007/12/17/javascript/google-maps-state-zoom-and-center-code/</link>
		<comments>http://blowingthroughlines.com/2007/12/17/javascript/google-maps-state-zoom-and-center-code/#comments</comments>
		<pubDate>Mon, 17 Dec 2007 22:56:00 +0000</pubDate>
		<dc:creator>jeff</dc:creator>
				<category><![CDATA[api]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[maps]]></category>

		<guid isPermaLink="false">http://blowingthroughlines.com/2007/12/17/flash-as3/google-maps-state-zoom-and-center-code/</guid>
		<description><![CDATA[This is exactly what you would think it is.  I fucked around with getting these bounding values so you don&#8217;t have to.  I think you will find this useful if a client says to you, &#8220;now how do I jump to a state&#8221;.  You will need the prototype library for this to [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>This is exactly what you would think it is.  I fucked around with getting these bounding values so you don&#8217;t have to.  I think you will find this useful if a client says to you, &#8220;now how do I jump to a state&#8221;.  You will need the prototype library for this to work.  I use it for element selection.  If you know how to get the element in other ways then you likely don&#8217;t need me to tell you how to change this code.  If you would like to download prototype <a href="http://www.prototypejs.org/" title="prototype javascript library" target="_blank">click here.</a></p>
<p>make sure you include the prototype library before the code for you map.</p>
<p><strong>First the select box that you will need somewhere on your UI</strong></p>
<select name="state" id="state" onchange="zoomState();"> <option selected="selected"> Select location </option> <option value="AL"> Alabama </option> <option value="AK"> Alaska </option> <option value="AZ"> Arizona </option> <option value="AR"> Arkansas </option> <option value="CA"> California </option> <option value="CO"> Colorado </option> <option value="CT"> Connecticut </option> <option value="DE"> Delaware </option> <option value="DC"> District of Columbia </option> <option value="FL"> Florida </option> <option value="GA"> Georgia </option> <option value="HI"> Hawaii </option> <option value="ID"> Idaho </option> <option value="IL"> Illinois </option> <option value="IN"> Indiana </option> <option value="IA"> Iowa </option> <option value="KS"> Kansas </option> <option value="KY"> Kentucky </option> <option value="LA"> Louisiana </option> <option value="ME"> Maine </option> <option value="MD"> Maryland </option> <option value="MA"> Massachusetts </option> <option value="MI"> Michigan </option> <option value="MN"> Minnesota </option> <option value="MS"> Mississippi </option> <option value="MO"> Missouri </option> <option value="MT"> Montana </option> <option value="NE"> Nebraska </option> <option value="NV"> Nevada </option> <option value="NH"> New Hampshire </option> <option value="NJ"> New Jersey </option> <option value="NM"> New Mexico </option> <option value="NY"> New York </option> <option value="NC"> North Carolina </option> <option value="ND"> North Dakota </option> <option value="OH"> Ohio </option> <option value="OK"> Oklahoma </option> <option value="OR"> Oregon </option> <option value="PA"> Pennsylvania </option> <option value="RI"> Rhode Island </option> <option value="SC"> South Carolina </option> <option value="SD"> South Dakota </option> <option value="TN"> Tennessee </option> <option value="TX"> Texas </option> <option value="UT"> Utah </option> <option value="VT"> Vermont </option> <option value="VA"> Virginia </option> <option value="WA"> Washington </option> <option value="WV"> West Virginia </option> <option value="WI"> Wisconsin </option> <option value="WY"> Wyoming </option> </select>
<p>The javascript you no doubt need, is the zoom to state code.  It is basically a large switch statement with sensible latitudes and longitudes for zooming and centering.  So here it is</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p26code41'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p2641"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
</pre></td><td class="code" id="p26code41"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> zoomState<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> sw<span style="color: #339933;">;</span>
	<span style="color: #003366; font-weight: bold;">var</span> ne<span style="color: #339933;">;</span>
	<span style="color: #000066; font-weight: bold;">switch</span><span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'state'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">value</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		<span style="color: #000066; font-weight: bold;">case</span> <span style="color: #3366CC;">'AL'</span><span style="color: #339933;">:</span>
			sw<span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">29.11377539511439</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">92.7685546875</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> ne <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">35.96022296929667</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">80.4638671875</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">case</span> <span style="color: #3366CC;">'AK'</span><span style="color: #339933;">:</span>
			sw<span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">58.17070248348609</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">175.166015625</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> ne <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">71.63599288330606</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">125.94726562500001</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">case</span> <span style="color: #3366CC;">'AZ'</span><span style="color: #339933;">:</span>
			sw<span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">30.977609093348686</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">117.421875</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> ne <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">37.68382032669382</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">105.1171875</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">case</span> <span style="color: #3366CC;">'AR'</span><span style="color: #339933;">:</span>
			sw<span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">31.409912194070973</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">97.998046875</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> ne <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">38.08268954483802</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">85.693359375</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">case</span> <span style="color: #3366CC;">'CA'</span><span style="color: #339933;">:</span>
			sw<span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">30.14512718337613</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">127.13378906250001</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> ne <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">43.13306116240612</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">102.5244140625</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">case</span> <span style="color: #3366CC;">'CO'</span><span style="color: #339933;">:</span>
			sw<span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">35.55010533588551</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">111.6650390625</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> ne <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">41.88592102814744</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">99.3603515625</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">case</span> <span style="color: #3366CC;">'CT'</span><span style="color: #339933;">:</span>
			sw<span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">40.75557964275588</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">74.24560546875</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> ne <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">42.27730877423709</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">71.16943359375</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">case</span> <span style="color: #3366CC;">'DE'</span><span style="color: #339933;">:</span>
			sw<span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">37.361425501905146</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">78.321533203125</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> ne <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">40.52215098562377</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">72.169189453125</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">case</span> <span style="color: #3366CC;">'DC'</span><span style="color: #339933;">:</span>
			sw<span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">37.142803443716836</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">80.101318359375</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> ne <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">40.3130432088809</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">73.948974609375</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">case</span> <span style="color: #3366CC;">'FL'</span><span style="color: #339933;">:</span>
			sw<span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">24.86650252692691</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">89.4287109375</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> ne <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">32.008075959291055</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">77.1240234375</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">case</span> <span style="color: #3366CC;">'GA'</span><span style="color: #339933;">:</span>
			sw<span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">29.286398892934763</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">89.296875</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> ne <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">36.12012758978146</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">76.9921875</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">case</span> <span style="color: #3366CC;">'HI'</span><span style="color: #339933;">:</span>
			sw<span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">18.656654486539995</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">160.499267578125</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> ne <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">22.46180203533398</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">154.346923828125</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">case</span> <span style="color: #3366CC;">'ID'</span><span style="color: #339933;">:</span>
			sw<span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">39.061849134291535</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">127.17773437499999</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> ne <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">50.54136296522161</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">102.568359375</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">case</span> <span style="color: #3366CC;">'IL'</span><span style="color: #339933;">:</span>
			sw<span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">36.79169061907076</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">95.009765625</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> ne <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">43.02071359427862</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">82.705078125</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">case</span> <span style="color: #3366CC;">'IN'</span><span style="color: #339933;">:</span>
			sw<span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">36.84446074079564</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">92.26318359375</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> ne <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">43.068887774169625</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">79.95849609375</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">case</span> <span style="color: #3366CC;">'IA'</span><span style="color: #339933;">:</span>
			sw<span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">38.99357205820944</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">99.99755859375</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> ne <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">45.02695045318543</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">87.69287109375</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">case</span> <span style="color: #3366CC;">'KS'</span><span style="color: #339933;">:</span>
			sw<span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">35.28150065789119</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">104.39208984375</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> ne <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">41.64007838467891</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">92.08740234375</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">case</span> <span style="color: #3366CC;">'KY'</span><span style="color: #339933;">:</span>
			sw<span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">34.488447837809304</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">91.4501953125</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> ne <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">40.91351257612757</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">79.1455078125</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">case</span> <span style="color: #3366CC;">'LA'</span><span style="color: #339933;">:</span>
			sw<span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">27.955591004642528</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">98.67919921875</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> ne <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">34.88593094075315</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">86.37451171875</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">case</span> <span style="color: #3366CC;">'ME'</span><span style="color: #339933;">:</span>
			sw<span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">42.212245162885814</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">75.12451171875</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> ne <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">47.945786463687185</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">62.81982421875</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">case</span> <span style="color: #3366CC;">'MD'</span><span style="color: #339933;">:</span>
			sw<span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">37.509725842937485</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">80.057373046875</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> ne <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">40.66397287638688</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">73.905029296875</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">case</span> <span style="color: #3366CC;">'MA'</span><span style="color: #339933;">:</span>
			sw<span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">40.6723059714534</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">75.047607421875</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> ne <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">43.683763524273346</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">68.895263671875</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">case</span> <span style="color: #3366CC;">'MI'</span><span style="color: #339933;">:</span>
			sw<span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">40.38002840251183</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">90.17578125</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> ne <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">46.28622391806705</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">77.87109375</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">case</span> <span style="color: #3366CC;">'MN'</span><span style="color: #339933;">:</span>
			sw<span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">40.58058466412761</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">105.5126953125</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> ne <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">51.781435604431195</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">80.9033203125</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">case</span> <span style="color: #3366CC;">'MS'</span><span style="color: #339933;">:</span>
			sw<span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">29.24806324379655</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">95.361328125</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> ne <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">36.08462129606931</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">83.056640625</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">case</span> <span style="color: #3366CC;">'MO'</span><span style="color: #339933;">:</span>
			sw<span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">35.40696093270201</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">98.7451171875</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> ne <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">41.75492216766298</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">86.4404296875</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">case</span> <span style="color: #3366CC;">'MT'</span><span style="color: #339933;">:</span>
			sw<span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">40.58058466412761</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">122.12402343749999</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> ne <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">51.781435604431195</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">97.5146484375</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">case</span> <span style="color: #3366CC;">'NE'</span><span style="color: #339933;">:</span>
			sw<span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">38.70265930723801</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">106.23779296875</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> ne <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">44.762336674810996</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">93.93310546875</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">case</span> <span style="color: #3366CC;">'NV'</span><span style="color: #339933;">:</span>
			sw<span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">35.79999392988527</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">122.80517578125</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> ne <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">42.114523952464246</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">110.50048828125</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">case</span> <span style="color: #3366CC;">'NH'</span><span style="color: #339933;">:</span>
			sw<span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">42.512601715736665</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">74.77294921875</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> ne <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">45.43700828867389</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">68.62060546875</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">case</span> <span style="color: #3366CC;">'NJ'</span><span style="color: #339933;">:</span>
			sw<span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">37.86618078529668</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">77.926025390625</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> ne <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">41.004775422229464</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">71.773681640625</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">case</span> <span style="color: #3366CC;">'NM'</span><span style="color: #339933;">:</span>
			sw<span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">30.902224705171417</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">111.708984375</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> ne <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">37.614231415424165</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">99.404296875</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">case</span> <span style="color: #3366CC;">'NY'</span><span style="color: #339933;">:</span>
			sw<span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">40.212440718286466</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">80.88134765625</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> ne <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">46.13417004624326</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">68.57666015625</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">case</span> <span style="color: #3366CC;">'NC'</span><span style="color: #339933;">:</span>
			sw<span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">31.9148675032762</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">87.1435546875</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> ne <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">38.54816542304656</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">74.8388671875</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">case</span> <span style="color: #3366CC;">'ND'</span><span style="color: #339933;">:</span>
			sw<span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">44.49650533109345</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">106.80908203125</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> ne <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">50.00773901463685</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">94.50439453125</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">case</span> <span style="color: #3366CC;">'OH'</span><span style="color: #339933;">:</span>
			sw<span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">37.35269280367273</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">87.978515625</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> ne <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">43.5326204268101</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">75.673828125</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">case</span> <span style="color: #3366CC;">'OK'</span><span style="color: #339933;">:</span>
			sw<span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">31.877557643340015</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">104.12841796875</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> ne <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">38.51378825951165</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">91.82373046875</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">case</span> <span style="color: #3366CC;">'OR'</span><span style="color: #339933;">:</span>
			sw<span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">41.21172151054787</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">126.123046875</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> ne <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">47.040182144806664</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">113.818359375</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">case</span> <span style="color: #3366CC;">'PA'</span><span style="color: #339933;">:</span>
			sw<span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">37.63163475580643</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">83.43017578125</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> ne <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">43.78695837311561</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">71.12548828125</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">case</span> <span style="color: #3366CC;">'RI'</span><span style="color: #339933;">:</span>
			sw<span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">41.3500103516271</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">72.2186279296875</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> ne <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">42.108411365705855</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">70.6805419921875</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">case</span> <span style="color: #3366CC;">'SC'</span><span style="color: #339933;">:</span>
			sw<span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">32.01739159980399</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">83.814697265625</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> ne <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">35.398005947151056</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">77.662353515625</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">case</span> <span style="color: #3366CC;">'SD'</span><span style="color: #339933;">:</span>
			sw<span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">41.73852846935917</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">106.36962890625</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> ne <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">47.517200697839414</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">94.06494140625</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">case</span> <span style="color: #3366CC;">'TN'</span><span style="color: #339933;">:</span>
			sw<span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">32.287132632616355</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">92.900390625</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> ne <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">38.89103282648846</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">80.595703125</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">case</span> <span style="color: #3366CC;">'TX'</span><span style="color: #339933;">:</span>
			sw<span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">24.5271348225978</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">112.060546875</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> ne <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">38.341656192795924</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">87.451171875</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">case</span> <span style="color: #3366CC;">'UT'</span><span style="color: #339933;">:</span>
			sw<span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">36.29741818650808</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">117.44384765625</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> ne <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">42.56926437219384</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">105.13916015625</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">case</span> <span style="color: #3366CC;">'VT'</span><span style="color: #339933;">:</span>
			sw<span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">42.36666166373274</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">75.706787109375</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> ne <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">45.29807513870794</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">69.554443359375</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">case</span> <span style="color: #3366CC;">'VA'</span><span style="color: #339933;">:</span>
			sw<span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">34.397844946449844</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">85.4736328125</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> ne <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">40.83043687764923</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">73.1689453125</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">case</span> <span style="color: #3366CC;">'WA'</span><span style="color: #339933;">:</span>
			sw<span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">44.99588261816546</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">126.58447265624999</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> ne <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">50.45750402042055</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">114.27978515625</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">case</span> <span style="color: #3366CC;">'WV'</span><span style="color: #339933;">:</span>
			sw<span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">35.79999392988527</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">86.41845703125</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> ne <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">42.114523952464246</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">74.11376953125</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">case</span> <span style="color: #3366CC;">'WI'</span><span style="color: #339933;">:</span>
			sw<span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">41.62365539068639</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">95.80078125</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> ne <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">47.41322033016902</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">83.49609375</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">case</span> <span style="color: #3366CC;">'WY'</span><span style="color: #339933;">:</span>
			sw<span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">39.99395569397331</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">113.8623046875</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> ne <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">45.93587062119052</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">101.5576171875</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span>
		<span style="color: #003366; font-weight: bold;">default</span><span style="color: #339933;">:</span>
			sw<span style="color: #339933;">=</span><span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">10.141931686131018</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">145.1953125</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> ne <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">59.88893689676585</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">46.7578125</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #009900;">&#125;</span>
	bound <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> GLatLngBounds<span style="color: #009900;">&#40;</span>sw<span style="color: #339933;">,</span>ne<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	map.<span style="color: #660066;">setZoom</span><span style="color: #009900;">&#40;</span>map.<span style="color: #660066;">getBoundsZoomLevel</span><span style="color: #009900;">&#40;</span>bound<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	map.<span style="color: #660066;">panTo</span><span style="color: #009900;">&#40;</span>bound.<span style="color: #660066;">getCenter</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>



<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://blowingthroughlines.com/2007/12/17/javascript/google-maps-state-zoom-and-center-code/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Flash Input Text Bug</title>
		<link>http://blowingthroughlines.com/2007/12/08/cs3/flash-input-text-bug/</link>
		<comments>http://blowingthroughlines.com/2007/12/08/cs3/flash-input-text-bug/#comments</comments>
		<pubDate>Sat, 08 Dec 2007 17:59:35 +0000</pubDate>
		<dc:creator>nilloc</dc:creator>
				<category><![CDATA[Bugs]]></category>
		<category><![CDATA[CS3]]></category>

		<guid isPermaLink="false">http://blowingthroughlines.com/2007/12/08/cs3/flash-input-text-bug/</guid>
		<description><![CDATA[The other day I was throwing an email form together really quickly, and decided to lay it out on the stage. So added 4 input fields, for name, email, subject, and message, and used those names as the instance names. then i put some labels in them, since i was planning on doing some nice [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>The other day I was throwing an email form together really quickly, and decided to lay it out on the stage. So added 4 input fields, for <em>name</em>, <em>email</em>, <em>subject</em>, and <em>message</em>, and used those names as the instance names. then i put some labels in them, since i was planning on doing some nice ON_FOCUS text relacement. but before going much farther i needed to check to see if the alignment was right, and tested the movie.<br />
At which point I quite unexpectedly got this error:</p>
<pre>Error: Error #2078: The name property of a Timeline-placed object cannot be modified.
	at flash.display::DisplayObject/set name()
	at flash.display::Sprite/flash.display:Sprite::constructChildren()
	at flash.display::Sprite$iinit()
	at flash.display::MovieClip$iinit()</pre>
<p><br/>And I hadn&#8217;t even imported the form class I had used a dozen times before&#8230; </p>
<p><span id="more-25"></span></p>
<h3>Solution</h3>
<p>The Flash IDE has some reserved instance names stored in it that will give you immediate warnings when you try to use them (try entering <em>name txt</em>) <em>name</em> isn&#8217;t one of the reserved words, but&mdash;at least for input text fields&mdash;it should be.<br />
Seems like they could have saved users some time and frustration by reserving that word in the IDE so that it can&#8217;t be entered.</p>


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://blowingthroughlines.com/2007/12/08/cs3/flash-input-text-bug/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Tweener Tips</title>
		<link>http://blowingthroughlines.com/2007/11/20/flash-as-3/tweener-tips/</link>
		<comments>http://blowingthroughlines.com/2007/11/20/flash-as-3/tweener-tips/#comments</comments>
		<pubDate>Wed, 21 Nov 2007 05:03:42 +0000</pubDate>
		<dc:creator>nilloc</dc:creator>
				<category><![CDATA[Flash AS 3.0]]></category>

		<guid isPermaLink="false">http://blowingthroughlines.com/2007/11/20/flash-as3/tweener-tips/</guid>
		<description><![CDATA[We&#8217;ve been using Tweener here for a few of our examples and while looking for info on Bezier Movement like the old MC_Tween used to support I came across one of Tweener&#8217;s co-creator&#8217;s blogs: labs.zeh.com.br
It has a really good post about how he decided on the syntax for the bezier Tween. It also includes a [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve been using Tweener here for a few of our <a href="http://blowingthroughlines.com/category/wii/">examples</a> and while looking for info on Bezier Movement like the old MC_Tween used to support I came across one of Tweener&#8217;s co-creator&#8217;s blogs:<a href="http://labs.zeh.com.br/blog/?p=104" target="_blank"> labs.zeh.com.br</a><br />
It has a really good post about how he decided on the syntax for the bezier Tween. It also includes a terrific example that applies it to a <a href="http://blog.papervision.org" target="_blank">Papervision3D</a> camera object.</p>
<h4>Also:</h4>
<ul>
<li>For those not already familiar with Tweener there are some decent flas <a href="http://www.webdevils.com/?p=66">here</a>.</li>
<li>And some pretty neat tricks (especially tip 3) for the more experienced Tweenerers <a href="http://www.stimuli.com.br/trane/2007/nov/07/tweener-tips/">here</a>.</li>
</ul>
<p>Happy Tweenering.</p>


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://blowingthroughlines.com/2007/11/20/flash-as-3/tweener-tips/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>E4X &amp; XMLList fails when defined in a switch statement.</title>
		<link>http://blowingthroughlines.com/2007/11/17/bugs/e4x-xmllist-fails-when-defined-in-a-switch-statement/</link>
		<comments>http://blowingthroughlines.com/2007/11/17/bugs/e4x-xmllist-fails-when-defined-in-a-switch-statement/#comments</comments>
		<pubDate>Sun, 18 Nov 2007 01:01:58 +0000</pubDate>
		<dc:creator>nilloc</dc:creator>
				<category><![CDATA[Bugs]]></category>
		<category><![CDATA[Flash AS 3.0]]></category>

		<guid isPermaLink="false">http://blowingthroughlines.com/flash-as3/nilloc/e4x-xmllist-fails-when-defined-in-a-switch-statement/</guid>
		<description><![CDATA[This one had me REALLY confused, for a good bit of time, luckily a co-worker helped be go through a rather vigorous debugging session to pinpoint the problem. Apparently if you are attempting to access a piece of a larger XML object using the new E4X capabilities and you attempt to do it with a [...]


Related posts:<ol><li><a href='http://blowingthroughlines.com/2009/09/28/bugs/external-interface-callbacks-with-jquery/' rel='bookmark' title='Permanent Link: External Interface Callbacks with Jquery'>External Interface Callbacks with Jquery</a> <small>So first off, NEVER use this most lazy of hacks...</small></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>This one had me REALLY confused, for a good bit of time, luckily a co-worker helped be go through a rather vigorous debugging session to pinpoint the problem. Apparently if you are attempting to access a piece of a larger XML object using the new E4X capabilities and you attempt to do it with a single line of code, it will return a null object instead of the expected XMLList object it should. After looking into it further, I discovered that if you define the variable, but don&#8217;t set it&#8217;s value on the same line, then it works fine&#8230; See wonky huh?</p>
<h2>Example (Based on Adobes example documentation):</h2>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p23code49'); return false;">View Code</a> ACTIONSCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p2349"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
</pre></td><td class="code" id="p23code49"><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>;
&nbsp;
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> XMLListExample <span style="color: #0066CC;">extends</span> Sprite
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> books:<span style="color: #0066CC;">XML</span>;
&nbsp;
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> XMLListExample<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
	<span style="color: #66cc66;">&#123;</span>
		books =		<span style="color: #66cc66;">&lt;</span>books<span style="color: #66cc66;">&gt;</span>
			<span style="color: #66cc66;">&lt;</span>book publisher=<span style="color: #ff0000;">&quot;Addison-Wesley&quot;</span> <span style="color: #0066CC;">name</span>=<span style="color: #ff0000;">&quot;Design Patterns&quot;</span> <span style="color: #66cc66;">/&gt;</span>
			<span style="color: #66cc66;">&lt;</span>book publisher=<span style="color: #ff0000;">&quot;Addison-Wesley&quot;</span> <span style="color: #0066CC;">name</span>=<span style="color: #ff0000;">&quot;The Pragmatic Programmer&quot;</span> <span style="color: #66cc66;">/&gt;</span>
			<span style="color: #66cc66;">&lt;</span>book publisher=<span style="color: #ff0000;">&quot;Addison-Wesley&quot;</span> <span style="color: #0066CC;">name</span>=<span style="color: #ff0000;">&quot;Test Driven Development&quot;</span> <span style="color: #66cc66;">/&gt;</span>
			<span style="color: #66cc66;">&lt;</span>book publisher=<span style="color: #ff0000;">&quot;Addison-Wesley&quot;</span> <span style="color: #0066CC;">name</span>=<span style="color: #ff0000;">&quot;Refactoring to Patterns&quot;</span> <span style="color: #66cc66;">/&gt;</span>
			<span style="color: #66cc66;">&lt;</span>book publisher=<span style="color: #ff0000;">&quot;O'Reilly Media&quot;</span> <span style="color: #0066CC;">name</span>=<span style="color: #ff0000;">&quot;The Cathedral &amp; the Bazaar&quot;</span> <span style="color: #66cc66;">/&gt;</span>
			<span style="color: #66cc66;">&lt;</span>book publisher=<span style="color: #ff0000;">&quot;O'Reilly Media&quot;</span> <span style="color: #0066CC;">name</span>=<span style="color: #ff0000;">&quot;Unit Test Frameworks&quot;</span> <span style="color: #66cc66;">/&gt;</span>
		<span style="color: #66cc66;">&lt;/</span>books<span style="color: #66cc66;">&gt;</span>;
&nbsp;
		showBooksByPublisher<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> showBooksByPublisher<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> ner = <span style="color: #ff0000;">&quot;ren&quot;</span>;
		<span style="color: #b1b100;">switch</span><span style="color: #66cc66;">&#40;</span>ner<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
			<span style="color: #b1b100;">case</span> <span style="color: #ff0000;">&quot;ren&quot;</span>:
			<span style="color: #808080; font-style: italic;">// the working code</span>
			<span style="color: #000000; font-weight: bold;">var</span> results:XMLList;<span style="color: #808080; font-style: italic;">// = new XMLList();</span>
			results = books.<span style="color: #006600;">book</span>.<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">@</span>publisher == <span style="color: #ff0000;">&quot;Addison-Wesley&quot;</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;results:<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>+results<span style="color: #66cc66;">&#41;</span>; <span style="color: #808080; font-style: italic;">// returns a the first 4 items (which contain &quot;Adison...&quot;)</span>
&nbsp;
			<span style="color: #808080; font-style: italic;">// now for the fun!!!</span>
			<span style="color: #000000; font-weight: bold;">var</span> otherResults:XMLList = books.<span style="color: #006600;">book</span>.<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">@</span>publisher == <span style="color: #ff0000;">&quot;O'Reilly Media&quot;</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;other results:<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>+otherResults<span style="color: #66cc66;">&#41;</span>; <span style="color: #808080; font-style: italic;">// returns null? (actually a null object)</span>
&nbsp;
			<span style="color: #808080; font-style: italic;">// just to see if oneline variable definitions work</span>
			<span style="color: #000000; font-weight: bold;">var</span> test:<span style="color: #0066CC;">String</span> = <span style="color: #ff0000;">'ner'</span>;
			<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;test string: &quot;</span>+test<span style="color: #66cc66;">&#41;</span>;
&nbsp;
			<span style="color: #808080; font-style: italic;">// seeing what else is a problem to do this way</span>
			<span style="color: #000000; font-weight: bold;">var</span> objTest:<span style="color: #0066CC;">Object</span> = <span style="color: #66cc66;">&#123;</span>ner:<span style="color: #ff0000;">&quot;ren&quot;</span><span style="color: #66cc66;">&#125;</span>;
			<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'test object: '</span>+objTest.<span style="color: #006600;">ner</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #808080; font-style: italic;">// yup works fine.</span>
			<span style="color: #808080; font-style: italic;">//</span>
			<span style="color: #000000; font-weight: bold;">var</span> xmlTest:<span style="color: #0066CC;">XML</span> = <span style="color: #66cc66;">&lt;</span>ners<span style="color: #66cc66;">&gt;</span>
			<span style="color: #66cc66;">&lt;</span>ner<span style="color: #66cc66;">&gt;</span>ren<span style="color: #66cc66;">&lt;/</span>ner<span style="color: #66cc66;">&gt;</span>
			<span style="color: #66cc66;">&lt;/</span>ners<span style="color: #66cc66;">&gt;</span>;
			<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'test xml:<span style="color: #000099; font-weight: bold;">\n</span>'</span>+xmlTest<span style="color: #66cc66;">&#41;</span>; <span style="color: #808080; font-style: italic;">// no problem here either.</span>
			<span style="color: #808080; font-style: italic;">//</span>
			<span style="color: #000000; font-weight: bold;">var</span> numTest:<span style="color: #0066CC;">Number</span> = <span style="color: #cc66cc;">45</span>;
			<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'test number: '</span>+numTest<span style="color: #66cc66;">&#41;</span>; <span style="color: #808080; font-style: italic;">// this is fine too.</span>
			<span style="color: #b1b100;">break</span>;
		<span style="color: #66cc66;">&#125;</span>
		<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>ner == <span style="color: #ff0000;">&quot;ren&quot;</span><span style="color: #66cc66;">&#41;</span>
		<span style="color: #66cc66;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">var</span> otherOtherResults:XMLList = books.<span style="color: #006600;">book</span>.<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">@</span>publisher == <span style="color: #ff0000;">&quot;O'Reilly Media&quot;</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;other other results:<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>+otherOtherResults<span style="color: #66cc66;">&#41;</span>; <span style="color: #808080; font-style: italic;">// works fine as well.</span>
		<span style="color: #66cc66;">&#125;</span>
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span><span style="color: #808080; font-style: italic;">// end of class</span>
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<p><a href="http://blowingthroughlines.com/wp-content/uploads/2007/11/xmllist_bug_tester.zip" title="Tester file for the XMLList Bug">Download the code.</a></p>
<p>Tell your friends, I&#8217;m letting Adobe know. And please let us know if your testing shows differently.</p>


<p>Related posts:<ol><li><a href='http://blowingthroughlines.com/2009/09/28/bugs/external-interface-callbacks-with-jquery/' rel='bookmark' title='Permanent Link: External Interface Callbacks with Jquery'>External Interface Callbacks with Jquery</a> <small>So first off, NEVER use this most lazy of hacks...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://blowingthroughlines.com/2007/11/17/bugs/e4x-xmllist-fails-when-defined-in-a-switch-statement/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>As3 event management</title>
		<link>http://blowingthroughlines.com/2007/11/03/flash-as-3/as3-event-management/</link>
		<comments>http://blowingthroughlines.com/2007/11/03/flash-as-3/as3-event-management/#comments</comments>
		<pubDate>Sat, 03 Nov 2007 13:44:46 +0000</pubDate>
		<dc:creator>jeff</dc:creator>
				<category><![CDATA[Flash AS 3.0]]></category>

		<guid isPermaLink="false">http://blowingthroughlines.com/flash-as3/jeff/as3-event-management/</guid>
		<description><![CDATA[Recently while working on an as3 project the project manager of the project came over to me and asked that something happen automatically that was currently happening only on a mouse click.  Normally I would have said fuck you that is impossible and get the hell out of my face.  I was feeling [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Recently while working on an as3 project the project manager of the project came over to me and asked that something happen automatically that was currently happening only on a mouse click.  Normally I would have said fuck you that is impossible and get the hell out of my face.  I was feeling confident today though with the event model of as3 so I said yeah I think we can make that happen.  The logic was that at worst I would have to make a separate function based on the one I already had.  So in a quest to solve this problem I offer you the most awesome kick ass thing you could ask for.</p>
<p>With as3 you quite literally fake an event.  And you can do so very easily.  All you need to do is import the events classes:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p21code55'); return false;">View Code</a> ACTIONSCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p2155"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p21code55"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #66cc66;">*</span>;</pre></td></tr></table></div>

<p>Then any time you have a button you can fake whatever event you want.  You can fake all sorts of events not just button.  But faking a click is often the most useful.  The code for doing such a thing is as follows.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p21code56'); return false;">View Code</a> ACTIONSCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p2156"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
</pre></td><td class="code" id="p21code56"><pre class="actionscript" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">// note you must make a symbol and link it in order to make an instance.</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: #66cc66;">&#123;</span>
	mybutton = <span style="color: #000000; font-weight: bold;">new</span> customSymbolIHaveLinked<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
	mybutton.<span style="color: #006600;">mouseChildren</span> = <span style="color: #000000; font-weight: bold;">false</span>;
	mybutton.<span style="color: #006600;">mouseEnabled</span> = <span style="color: #000000; font-weight: bold;">true</span>;
&nbsp;
	<span style="color: #808080; font-style: italic;">// this makes the button listen for the click event</span>
	mybutton.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">CLICK</span>, functiontorun<span style="color: #66cc66;">&#41;</span>;
	<span style="color: #808080; font-style: italic;">// now if you would like to automatially run this event on start up to perhaps ensure the user is at a default</span>
	<span style="color: #808080; font-style: italic;">// position you simply need to dispatch an event</span>
&nbsp;
	mybutton.<span style="color: #006600;">dispatchEvent</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> Event<span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">CLICK</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
<span style="color: #000000; font-weight: bold;">function</span> functiontorun<span style="color: #66cc66;">&#40;</span>evt:Event<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;recieved event from &quot;</span>+evt.<span style="color: #0066CC;">target</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<p>That&#8217;s all there is to it really.  I hope this has been helpful.  It has been a lifesaver for me.  Thanks again as3 for making life a hell of a lot easier&#8230;</p>


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://blowingthroughlines.com/2007/11/03/flash-as-3/as3-event-management/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
