<?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"
	>

<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>
	<pubDate>Wed, 23 Jul 2008 01:35:30 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<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>

		<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 [...]]]></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>
<pre>
require "ftools"
require "aws/s3"
require "mp3info"
class Song < ActiveRecord::Base
   include AWS::S3
   belongs_to              :user
   has_one                 :song_metadata
   before_validation       :set_all_meta_data
   after_save              :write_file
   after_destroy           :delete_file
   before_create           :connect_to_amazon
   validates_inclusion_of  :mime_type, :in =>%w( audio/mpeg audio/mpg ), :message =>&#8221;The file you uploaded is not an mp3&#8243;
   validates_inclusion_of  :file_size, :in =>300.kilobytes..20.megabytes, :message=>&#8221;must be between 300k and 20mb&#8221;
   attr_accessor :id3tags
   def song=(file_data)
     @file_data = file_data
   end
   def write_file
     buckets = Service.buckets
     bucketexists=false
     buckets.each do |bucket|
       if bucket.name == AppConfig.ec2["bucket"]
         bucketexists=true
       end
     end
     if !bucketexists
       Bucket.create(AppConfig.ec2["bucket"])
     end
     @file_data.rewind
     if !S3Object.exists? get_file_url, AppConfig.ec2["bucket"]
      createsong_meta
      S3Object.store(get_file_url, @file_data.read, AppConfig.ec2["bucket"],:access => :public_read)
     end
   end
def createsong_meta
        m = SongMetadata.new
        self.song_metadata = m
        if id3tags.title
         m.title       = id3tags.title
        else
         m.title = &#8220;No song name set&#8221;
        end
        if id3tags.artist
          m.artist      = id3tags.artist
        else
          m.artist = &#8220;No artist name set&#8221;
        end
        if id3tags.album
          m.album = id3tags.album
        else
          m.album = &#8220;No album name set&#8221;
        end
        m.year        = id3tags.year
        m.track_number= id3tags.tracknum
        m.save!
   end
   def get_song
     self.connect_to_amazon
     S3Object.value mp3_url, AppConfig.ec2["bucket"]
   end
   def delete_file
     self.connect_to_amazon
     S3Object.delete mp3_url, AppConfig.ec2["bucket"]
   end
   def set_all_meta_data
     if @file_data!=&#8221;" &#038;&#038; @file_data
      @file_data.rewind
      self.mime_type = @file_data.content_type
      if self.mime_type == &#8220;audio/mpg&#8221; || self.mime_type==&#8221;audio/mpeg&#8221;
        tmplocal = &#8220;#{RAILS_ROOT}/tmp/musicfiles&#8221;
        tmpname = &#8220;#{Time.now}-#{@file_data.original_filename}&#8221;
        File.makedirs(tmplocal)
        File.open(&#8221;#{tmplocal}/#{tmpname}&#8221;, &#8220;w&#8221;) { |file| file.write(@file_data.read) }
        mymp3 = Mp3Info.open(&#8221;#{tmplocal}/#{tmpname}&#8221;)        self.id3tags     = mymp3.tag
        self.bitrate     = mymp3.bitrate
        self.samplerate  = mymp3.samplerate
        self.samplerate  = mymp3.samplerate
        self.mpeg_version= mymp3.mpeg_version
        self.layer       = mymp3.layer
        self.length      = mymp3.length
        self.file_size   = @file_data.size
        mymp3.close
        File.delete(&#8221;#{tmplocal}/#{tmpname}&#8221;)
        self.mp3_url = get_file_url
      end
    end
   end
   def get_file_url
    &#8220;#{user_id}/xrays/#{id}/song/#{@file_data.original_filename}&#8221;
   end
   def connect_to_amazon
     Base.establish_connection!(:access_key_id=> AppConfig.ec2["access_key"], :secret_access_key => AppConfig.ec2["secret_key"])
   end
end
</pre>
<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>
]]></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>
		</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 [...]]]></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>
]]></content:encoded>
			<wfw:commentRss>http://blowingthroughlines.com/2008/07/05/flex-3/opening-flas-in-flex/feed/</wfw:commentRss>
		</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 [...]]]></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 id="wp_codebox_msgheader"><span class="right"><a href="javascript:;" onclick="toggle_collapse('p352');">[<span id="p352_symbol">-</span>]</a><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('p35code2'); return false;">View Code</a> ACTIONSCRIPT</span><div class="codebox_clear"></div></div><div id="wp_codebox"><table width="100%" ><tr id="p352"><td width="1%" class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code" id="p35code2"><pre class="actionscript"><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>
]]></content:encoded>
			<wfw:commentRss>http://blowingthroughlines.com/2008/02/10/cs3/automatic-bending-joints-in-as3-simple-bones/feed/</wfw:commentRss>
		</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. [...]]]></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>
]]></content:encoded>
			<wfw:commentRss>http://blowingthroughlines.com/2008/02/09/rsyslog/rsyslogd-man-pages-have-a-great-sense-of-humor/feed/</wfw:commentRss>
		</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. [...]]]></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 id="wp_codebox_msgheader"><span class="right"><a href="javascript:;" onclick="toggle_collapse('p325');">[<span id="p325_symbol">-</span>]</a><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('p32code5'); return false;">View Code</a> RUBY</span><div class="codebox_clear"></div></div><div id="wp_codebox"><table width="100%" ><tr id="p325"><td width="1%" class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code" id="p32code5"><pre class="ruby"><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 id="wp_codebox_msgheader"><span class="right"><a href="javascript:;" onclick="toggle_collapse('p326');">[<span id="p326_symbol">-</span>]</a><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('p32code6'); return false;">View Code</a> RUBY</span><div class="codebox_clear"></div></div><div id="wp_codebox"><table width="100%" ><tr id="p326"><td width="1%" class="line_numbers"><pre>6
7
8
</pre></td><td class="code" id="p32code6"><pre class="ruby"><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>
]]></content:encoded>
			<wfw:commentRss>http://blowingthroughlines.com/2008/02/03/ruby/highlight-selected-navigation-item-in-ruby-on-rails/feed/</wfw:commentRss>
		</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
The Actionscript
[cc lang='actionscript']
private [...]]]></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>
<h2>The Actionscript</h2>
<p>[cc lang='actionscript']<br />
private function init()<br />
{<br />
	var request:URLRequest = new URLRequest(&#8221;wp-content/xml/images.xml&#8221;);<br />
	loader = new URLLoader(request);<br />
	loader.addEventListener(Event.COMPLETE, loadComplete);<br />
}</p>
<p>private function loadComplete(evt:Event)<br />
{<br />
	data = XML(evt.target.data);<br />
	trace(data.panel.length());</p>
<p>	accord = new accordion(500, 400, data.panel.length(), 20);</p>
<p>	for(var i:int=0; i < data.panel.length(); i++)<br />
	{<br />
		var panel:MovieClip = new NavPanel(data.panel[i].name);<br />
		var contents:MovieClip = new ImgHolder(data.panel[i].img);<br />
		accord.addPanel(panel, contents);<br />
	}<br />
	addChild(accord);<br />
	accord.openPanel(1);<br />
}<br />
[/cc]</p>
<h2>The XML</h2>
<pre>
&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;panels&gt;
	&lt;panel&gt;
		&lt;name&gt;panel one&lt;/name&gt;
		&lt;img&gt;img/1905143678_218d1aa13a.jpg&lt;/img&gt;
	&lt;/panel&gt;
	&lt;panel&gt;
		&lt;name&gt;panel zwei&lt;/name&gt;
		&lt;img&gt;img/1904306625_fa9cf2cd33.jpg&lt;/img&gt;
	&lt;/panel&gt;
	&lt;panel&gt;
		&lt;name&gt;panel tre&lt;/name&gt;
		&lt;img&gt;img/1904436509_2266d2daf2.jpg&lt;/img&gt;
	&lt;/panel&gt;
	&lt;panel&gt;
		&lt;name&gt;panel quattre&lt;/name&gt;
		&lt;img&gt;img/1904437975_441fec52af.jpg&lt;/img&gt;
	&lt;/panel&gt;
&lt;/panels&gt;
</pre>
<p><</p>
]]></content:encoded>
			<wfw:commentRss>http://blowingthroughlines.com/2008/01/27/cs3/accordion-meets-xml/feed/</wfw:commentRss>
		</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 [...]]]></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 id="wp_codebox_msgheader"><span class="right"><a href="javascript:;" onclick="toggle_collapse('p288');">[<span id="p288_symbol">-</span>]</a><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('p28code8'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div id="wp_codebox"><table width="100%" ><tr id="p288"><td width="1%" 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="p28code8"><pre class="javascript"><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: #006600;">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: #006600;">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: #006600;">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: #006600;">show</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			tabli.<span style="color: #006600;">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: #006600;">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: #006600;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			tabli.<span style="color: #006600;">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: #006600;">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: #006600;">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: #006600;">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: #006600;">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 - 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>
]]></content:encoded>
			<wfw:commentRss>http://blowingthroughlines.com/2007/12/29/javascript/prototype-css-tabs/feed/</wfw:commentRss>
		</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 [...]]]></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 id="wp_codebox_msgheader"><span class="right"><a href="javascript:;" onclick="toggle_collapse('p2610');">[<span id="p2610_symbol">-</span>]</a><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('p26code10'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div id="wp_codebox"><table width="100%" ><tr id="p2610"><td width="1%" 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="p26code10"><pre class="javascript"><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: #006600;">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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #006600;">setZoom</span><span style="color: #009900;">&#40;</span>map.<span style="color: #006600;">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: #006600;">panTo</span><span style="color: #009900;">&#40;</span>bound.<span style="color: #006600;">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>

]]></content:encoded>
			<wfw:commentRss>http://blowingthroughlines.com/2007/12/17/javascript/google-maps-state-zoom-and-center-code/feed/</wfw:commentRss>
		</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 [...]]]></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>
]]></content:encoded>
			<wfw:commentRss>http://blowingthroughlines.com/2007/12/08/cs3/flash-input-text-bug/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Tweener Tips</title>
		<link>http://blowingthroughlines.com/2007/11/20/flash-as-30/tweener-tips/</link>
		<comments>http://blowingthroughlines.com/2007/11/20/flash-as-30/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 [...]]]></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>
]]></content:encoded>
			<wfw:commentRss>http://blowingthroughlines.com/2007/11/20/flash-as-30/tweener-tips/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
