<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Nobien &#187; JavaScript</title>
	<atom:link href="http://blog.nobien.net/category/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.nobien.net</link>
	<description>A nerd blog about nerdy things by ... nerdy guys?</description>
	<lastBuildDate>Mon, 19 Jul 2010 14:27:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Pretty Pleased with the SWFAddress Apache, mod_rewrite, and PHP SEO Implementation</title>
		<link>http://blog.nobien.net/2009/09/11/swfaddress-apache-mod_rewrite-php-seo-implementation/</link>
		<comments>http://blog.nobien.net/2009/09/11/swfaddress-apache-mod_rewrite-php-seo-implementation/#comments</comments>
		<pubDate>Fri, 11 Sep 2009 19:30:07 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[ActionScript 3]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Server Side Scripting]]></category>

		<guid isPermaLink="false">http://blog.nobien.net/?p=162</guid>
		<description><![CDATA[The latest project I've been working on at Rokkan has been umbro.com. When the project first came to us there was quite a bit of discussion over what technology to use, specifically HTML vs. Flash. The client, naturally, was concerned about SEO but also wanted a nice "rich" experience. Sure, there's been a little bit [...]]]></description>
			<content:encoded><![CDATA[<p>The latest project I've been working on at Rokkan has been umbro.com. When the project first came to us there was quite a bit of discussion over what technology to use, specifically HTML vs. Flash. The client, naturally, was concerned about SEO but also wanted a nice "rich" experience. Sure, there's been a little bit of talk lately over the fact that Google can now index certain types of content with regards to SWF files and the files which they load, but its still sketchy at best. Not to mention you have to pay close attention to how you setup your text fields 'n such. Hell, when is the last time you searched on Google for something significant and got a result that takes you to a specific page of a Flash site/app? I honestly can't think of that every happening to me.</p>
<p><span id="more-162"></span></p>
<p>At any rate, after much debate we decided that the experience was a bit more important to us so we would focus on the Flash front end. Regardless of that decision, we also would create a text-only/HTML/SEO friendly version of the site for search engines to crawl using <a href="http://www.asual.com/swfaddress/" target="_blank">SWFAddress's SEO setup</a> that uses a little special JavaScript, Apache's mod_rewrite and PHP. If you haven't checked this out yet, I highly recommend it.</p>
<p>If you're too lazy to go check out the SWFAddress site, I'll summarize what it does for you. Essentially, with the combination of the aforementioned technologies, SWFAddress now ships with a simple rule-based URL rewriting engine to handle entry URLs that do not contain the SWFAddress hash mark (#). This allows us to display equivalent content under the same folder structure that the Flash site/app uses for users that do not have both JavaScript and the Flash Player. For example, if you have JavaScript enabled and the Flash Player installed and go to <a href="http://www.umbro.com/en_UK/about/" target="_blank">www.umbro.com/en_UK/about/</a> you will be redirected to the SWFAddress/Flash friendly URL <a href="http://www.umbro.com/en_UK/#/about/" target="_blank">www.umbro.com/en_UK/#/about/</a>. If you don't have JavaScript enabled or the Flash Player installed at all, mod_rewrite sends the folder path as a string to a PHP script. In this script you setup rules that determine what HTML content to display. Thus, you can display equivalent textual/semantic/SEO friendly content to anything that doesn't use JavaScript and Flash, eg: search engine spiders.</p>
<p>The only drawback I can see with this implementation at this point is the way in which users share URLs with each other. I'm guessing most users are more apt to simply copy and paste the URL from their browser's address bar than anything else. In this case they're grabbing the SWFAddress/Flash friendly URL with the hash (#) mark in it. Unfortunately if this is the URL that gets posted around the internet and shared via blogs, twitter, facebook, etc, then these pages aren't really going to increase in page rank all that much. However, in order to facilitate the sharing of the non-hash-marked URL, we've placed a "Share This" tool on as many pages within the Flash app as possible. This button uses the link sharing API's for a few social networks and passes in the SEO friendly URLs (without the hash mark) instead of whats in the address bar.</p>
<p>One thing I will say if you do decide to use this approach is to be aware of the amount of extra work that it will entail. You're essentially creating two sites, one in HTML and one in Flash. This can become rather time consuming depending on the scope fo the project and the amount of content. In the case of umbro.com we didn't really have that many pages to duplicate but we did have four markets/languages. On top of this, we initially created very bare-bones and unstyled HTML content that we knew would get indexed as long as it was being spidered. However, once a few people checked out umbro.com on their mobile devices and noticed that the "mobile" version was different than the version they saw on the desktops or laptops, those people suddenly thought that they were indeed seeing THE "mobile" version, not the version that anyone or anything that doesn't have JavaScript and Flash will see. So suddenly we had to pretty up that content with some nice images and CSS styles which required a bit more work than we had anticipated from the start.</p>
<p>I'm pretty happy with how things turned out with umbro.com, if you do some obvious Google searches such as '<a href="http://www.google.com/search?rlz=1C1GGLS_enUS291US304&amp;sourceid=chrome&amp;ie=UTF-8&amp;q=about+umbro" target="_blank">about umbro</a>' or '<a href="http://www.google.com/search?hl=en&amp;rlz=1C1GGLS_enUS291US304&amp;q=where+to+buy+umbro&amp;aq=f&amp;oq=&amp;aqi=g10" target="_blank">where to buy umbro</a>' you can see that pages from umbro.com are appearing pretty high in the results right now and thats honestly good enough for me at this point as I've never built an entire site in Flash and had any sort of results show up in Google before. I'm also pretty curious as to who else out there has implemented this with good results, so if you or any other sites you know of that have gone with this solution please leave a comment and URL. Thanks in advance.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nobien.net/2009/09/11/swfaddress-apache-mod_rewrite-php-seo-implementation/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Just One of My Favorite Flash Tools: swffit</title>
		<link>http://blog.nobien.net/2008/11/17/just-one-of-my-favorite-flash-tools-swffit/</link>
		<comments>http://blog.nobien.net/2008/11/17/just-one-of-my-favorite-flash-tools-swffit/#comments</comments>
		<pubDate>Mon, 17 Nov 2008 14:38:44 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://blog.nobien.net/?p=91</guid>
		<description><![CDATA[I just have to mention this really quickly. When working on tridentgum.com I was introduced to, what I thought might be, a little known JavaScript tool for Flash proejcts. We had to give the site a minimum height and width in the browser but still go 100% if the screen is larger than the minimum [...]]]></description>
			<content:encoded><![CDATA[<p>I just have to mention this really quickly. When working on <a href="http://www.tridentgum.com" target="_blank">tridentgum.com</a> I was introduced to, what I thought might be, a little known JavaScript tool for Flash proejcts. We had to give the site a minimum height and width in the browser but still go 100% if the screen is larger than the minimum size. Something I've done before but just not so easily. At any rate, the lead developer at the other agency we were working with discovered <a href="http://swffit.millermedeiros.com/" target="_blank">swffit</a>. It makes doing this sort of thing ridiculously easy. In most of my cases, I just need a minimum width and height, which is usually the width and height of my FLA's. Otherwise, the site can stretch to the size of the browser.</p>
<p>I recommend <a href="http://swffit.millermedeiros.com/" target="_blank">swffit </a>to everyone!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nobien.net/2008/11/17/just-one-of-my-favorite-flash-tools-swffit/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>SWFAddress 2.1 &amp; SWFObject 2 Work Together.</title>
		<link>http://blog.nobien.net/2008/04/26/swfaddress-21-swfobject-2-work-together/</link>
		<comments>http://blog.nobien.net/2008/04/26/swfaddress-21-swfobject-2-work-together/#comments</comments>
		<pubDate>Sat, 26 Apr 2008 12:24:48 +0000</pubDate>
		<dc:creator>Marc</dc:creator>
				<category><![CDATA[ActionScript 2]]></category>
		<category><![CDATA[ActionScript 3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://blog.nobien.net/?p=56</guid>
		<description><![CDATA[I spent a good hour yesterday trying to get SWFAddress 2.1 and SWFObject 2 to work together. First off, they do work together. Second, there's nothing to it. Then why did it take me an hour? Because I'm a dummy and I had the order in which each JavaScript set was called. In hindsight, this [...]]]></description>
			<content:encoded><![CDATA[<p>I spent a good hour yesterday trying to get <a href="http://www.asual.com/swfaddress/">SWFAddress 2.1</a> and <a href="http://code.google.com/p/swfobject/">SWFObject 2</a> to work together. First off, they do work together. Second, there's nothing to it. Then why did it take me an hour? Because I'm a dummy and I had the order in which each JavaScript set was called. In hindsight, this is common sense, but the golden ticket here is calling SWFAddress javascript BEFORE declaring the SWFObject. This more applies to people using the dynamic way of embedding the SWFObject. ie:</p>
<pre>&nbsp;
&lt;head&gt;
    &lt;title&gt;SWFObject v2.0 - step 3&lt;/title&gt;
    &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot; /&gt;
    &lt;script type=&quot;text/javascript&quot; src=&quot;js/swfobject.js&quot;&gt;&lt;/script&gt;
    &lt;script type=&quot;text/javascript&quot; src=&quot;js/swfaddress.js&quot;&gt;&lt;/script&gt;
    &lt;script type=&quot;text/javascript&quot;&gt;
                swfobject.embedSWF('website.swf', 'website', '100%', '100%', '9.0.45', 
                'swfobject/expressinstall.swf', {}, {bgcolor: '#CCCCCC', menu: 'false'}, {id: 'website'});
    &lt;/script&gt;
&lt;/head&gt;
&nbsp;</pre>
<p>Silly right? I saw a couple of posts out there of people having a hard time getting this going. Once I flipped the JS declaration, it worked. And I felt kinda dumb. But hey ... That's life. </p>
<p>BTW: both SWFAddress and SWFObject 2 are pretty amazing and should be worked into your site/app flow if they aren't already.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nobien.net/2008/04/26/swfaddress-21-swfobject-2-work-together/feed/</wfw:commentRss>
		<slash:comments>23</slash:comments>
		</item>
		<item>
		<title>Flash Embed Tip: Minimum width and height for liquid layouts</title>
		<link>http://blog.nobien.net/2007/11/01/flash-embed-tip-minimum-widthheight-for-liquid-layouts/</link>
		<comments>http://blog.nobien.net/2007/11/01/flash-embed-tip-minimum-widthheight-for-liquid-layouts/#comments</comments>
		<pubDate>Thu, 01 Nov 2007 20:20:12 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://blog.nobien.net/2007/11/01/flash-embed-tip-minimum-widthheight-for-liquid-layouts/</guid>
		<description><![CDATA[Update: This post is old, and getting a decent amount of traffic, so I've decided to provide a link to a more recent post that handles this situation much better! Just One of My Favorite Flash Tools: swffit Over the course of your career you often come up with solutions to such small problems that [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Update:</strong> This post is old, and getting a decent amount of traffic, so I've decided to provide a link to a more recent post that handles this situation much better! <a href="http://blog.nobien.net/2008/11/17/just-one-of-my-favorite-flash-tools-swffit/" target="_self">Just One of My Favorite Flash Tools: swffit</a></p>
<p>Over the course of your career you often come up with solutions to such small problems that you completely forget about them. One instance for me is coming with a really simple way to ensure that a Flash site has a minimum height and/or width while using a liquid layout. When a designer gives you a comp and he or she says "I want this to be 'fullscreen'", you immediately think that you'll be setting the width and height of the embed code to 100%. However, you soon realize that you have to account for smaller screen sizes than the size at which the site was designed for.</p>
<p>You could create you're own horizontal and vertical scrollbars within your Flash piece to handle such a situation, but I much prefer the scrollbars within the browser, as a user is much more apt to recognize them and feel more comfortable using them. Here is my tip for handling this.</p>
<p>Say you have a piece of Flash content embedded in your page with SWFObject as such:</p>
<pre class="javascript"><span style="color: #003366; font-weight: bold;">var</span> so = <span style="color: #003366; font-weight: bold;">new</span> SWFObject<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;Home.swf&quot;</span>, <span style="color: #3366CC;">&quot;myFlashContent&quot;</span>, <span style="color: #3366CC;">&quot;100%&quot;</span>, <span style="color: #3366CC;">&quot;100%&quot;</span>, <span style="color: #3366CC;">&quot;8&quot;</span>, <span style="color: #3366CC;">&quot;#000000&quot;</span><span style="color: #66cc66;">&#41;</span>;
so.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;flashcontent&quot;</span><span style="color: #66cc66;">&#41;</span>;</pre>
<p>Straightforward, of course. Now start by adding this Javascript function up within the page's HEAD tag:</p>
<pre class="javascript"><span style="color: #003366; font-weight: bold;">function</span> adjustSWFHeight<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span>document.<span style="color: #006600;">body</span>.<span style="color: #006600;">clientHeight</span> &amp;lt;= <span style="color: #CC0000;">768</span><span style="color: #66cc66;">&#41;</span>
        document.<span style="color: #006600;">getElementById</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;myFlashContent&quot;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">style</span>.<span style="color: #006600;">height</span> = <span style="color: #3366CC;">&quot;680px&quot;</span>;
    <span style="color: #000066; font-weight: bold;">else</span>
        document.<span style="color: #006600;">getElementById</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;myFlashContent&quot;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">style</span>.<span style="color: #006600;">height</span> = <span style="color: #3366CC;">&quot;100%&quot;</span>;
&nbsp;
    <span style="color: #000066; font-weight: bold;">if</span><span style="color: #66cc66;">&#40;</span>document.<span style="color: #006600;">body</span>.<span style="color: #006600;">clientWidth</span> &amp;lt;= <span style="color: #CC0000;">1000</span><span style="color: #66cc66;">&#41;</span>
        document.<span style="color: #006600;">getElementById</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;myFlashContent&quot;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">style</span>.<span style="color: #006600;">width</span>= <span style="color: #3366CC;">&quot;1000px&quot;</span>;
    <span style="color: #000066; font-weight: bold;">else</span>
        document.<span style="color: #006600;">getElementById</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;myFlashContent&quot;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">style</span>.<span style="color: #006600;">width</span>= <span style="color: #3366CC;">&quot;100%&quot;</span>;
<span style="color: #66cc66;">&#125;</span></pre>
<p>Simple enough, right? The only thing you'll have to customize is the condition statement which defines the minimum height of the Flash content and the edge at which to use the minimum height over a 100% value. Next, set the onLoad and onResize properties of the page's BODY tag.</p>
<p>And thats it! o far it seems to work in Firefox, IE and Safari pretty well. Perhaps it will help you!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nobien.net/2007/11/01/flash-embed-tip-minimum-widthheight-for-liquid-layouts/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Not Bummed About AIR&#8217;s HTML Component: Javascript and Actionscript Integration</title>
		<link>http://blog.nobien.net/2007/07/06/not-bummed-about-airs-html-component-javascript-and-actionscript-integration/</link>
		<comments>http://blog.nobien.net/2007/07/06/not-bummed-about-airs-html-component-javascript-and-actionscript-integration/#comments</comments>
		<pubDate>Fri, 06 Jul 2007 14:08:37 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://blog.nobien.net/2007/07/06/not-bummed-about-airs-html-component-javascript-and-actionscript-integration/</guid>
		<description><![CDATA[So I've had a change of heart. Big whoop! It happens to everyone at some point in there life. Its kind of like when your girlfriend starts to really get on your nerves but then out of no where she...oh nevermind, I think you know what I mean. At any rate, I've been working on [...]]]></description>
			<content:encoded><![CDATA[<p>So I've had a change of heart. Big whoop! It happens to everyone at some point in there life. Its kind of like when your girlfriend starts to really get on your nerves but then out of no where she...oh nevermind, I think you know what I mean. At any rate, I've been working on an HTML/CSS editor program for the book and I have to say that the Javascript/Actionscript integration is simply amazing! Maybe I'm getting excited over nothing, but I can't begin to tell you how awesome it is to be able to loop through stylesheet and css related objects all inline with my actionscript. Sure, there's a few things you have to take into consideration, but it has allowed me to make this application in almost no time. I just have to brush up on my Javascript and bam! CSS editor! Needless to say, I'm stoked. Over and out.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nobien.net/2007/07/06/not-bummed-about-airs-html-component-javascript-and-actionscript-integration/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
