<?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>FlexBandit &#187; JavaScript</title>
	<atom:link href="http://flexbandit.com/archives/category/programming/javascript/feed" rel="self" type="application/rss+xml" />
	<link>http://flexbandit.com</link>
	<description>Yet another Flex enthusiast? You Betcha!</description>
	<lastBuildDate>Sun, 04 Dec 2011 15:34:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Creating a Flex Site with SEO in Mind</title>
		<link>http://flexbandit.com/archives/7</link>
		<comments>http://flexbandit.com/archives/7#comments</comments>
		<pubDate>Mon, 30 Jun 2008 18:14:26 +0000</pubDate>
		<dc:creator>donkeybandit</dc:creator>
				<category><![CDATA[Clarisolve]]></category>
		<category><![CDATA[Flex Info]]></category>
		<category><![CDATA[HTML/CSS]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[SEO]]></category>

		<guid isPermaLink="false">http://matt.was-here.org/?p=7</guid>
		<description><![CDATA[- Part 1 &#8211; Creating a Shadow Site Creating a beautiful web 2.0 website in Flash/Flex is very satisfying. I really enjoy the development time savings of Flex versus that of general HTML/javascript solutions and the crispness of the interfaces created. The pleasure of Flex development is something I can talk about for hours and [...]]]></description>
			<content:encoded><![CDATA[<p>-</p>
<h1>Part 1 &#8211; Creating a Shadow Site</h1>
<p>Creating a beautiful web 2.0 website in Flash/Flex is very satisfying. I really enjoy the development time savings of Flex versus that of general HTML/javascript solutions and the crispness of the interfaces created. The pleasure of Flex development is something I can talk about for hours and I have even been known to evangelise in my local bar on a Friday night.</p>
<p>It&#8217;s not all roses though, as Flex solutions do come with one major flaw; They are not search engine friendly (for a number of reasons). Part 1 of this article explores a solution using a &#8220;<strong>Shadow Site</strong>&#8220;, which is a term I surfed across recently and feel it accurately describes the subject. <span id="more-7"></span></p>
<h1>The Problem</h1>
<p>You are probably already aware of the issues associated with <a title="Wikipedia definition of " href="http://en.wikipedia.org/wiki/Search_engine_optimization" target="_blank">SEO (Search Engine Optimisation)</a> and Flex, but just in case this is a new concept for you I will briefly explain the issues that are Flex related:</p>
<h2>Pure Flash/Flex sites are not crawled for search text</h2>
<p>As your SWF is basically a compiled program that is executed through the Flash Player, for a search engine to be able to read any embedded content it would have to effectively decompile your <a title="Wikipedia definition of " href="http://en.wikipedia.org/wiki/SWF" target="_self">SWF</a>. This is a problem for a number of reasons:</p>
<ul>
<li>Google doesn&#8217;t do it (presently)</li>
<li>developers may choose a Flash solution as a means of <a title="Wikipedia definition of " href="http://en.wikipedia.org/wiki/Obfuscation" target="_self">obfuscation </a>(compared to alternative <a title="Wikipedia definition of " href="http://en.wikipedia.org/wiki/Web_2.0" target="_self">web 2.0</a> strategies) so don&#8217;t want their precious code available to the world</li>
<li>the Flash Player/<a title="Wikipedia definition of " href="http://en.wikipedia.org/wiki/SWF" target="_self">SWF</a> standard is owned by Adobe and it is debatable whether it should be decompilable (see point above)</li>
<li>decompilation would cause a large processing overhead for a search engine crawler</li>
</ul>
<h2>Pure Flex solutions are all inclusive within a single SWF structure</h2>
<p>When you compile your Flex programs they ultimately produce a single <a title="Wikipedia definition of " href="http://en.wikipedia.org/wiki/SWF" target="_self">SWF</a> file (not including all of the associated html, javascript, shared resource files, etc.). This single file contains the whole program (and therefore navigation structure) so there is no need to leave the <a title="Wikipedia definition of " href="http://en.wikipedia.org/wiki/SWF" target="_self">SWF</a> just because you are moving to a different page, effectively making the whole URL structure irrelevant. Although this has a lot of advantages, it makes linking to a particular point in your application something you really have to think about. That particular problem is solved in Flex 3 with the improved &#8220;<a title="Wikipedia definition of " href="http://en.wikipedia.org/wiki/Deep_linking" target="_self">Deep Linking</a>&#8221; functionality, but <strong>how does a search engine know about your deep links?</strong></p>
<h1>A Solution</h1>
<p>What I have currently implemented as a solution on the <a title="Clarisolve Web Site" href="http://www.clarisolve.com/" target="_blank">Clarisolve project</a> is a &#8220;shadow site&#8221;. Historically the term &#8220;HTML version&#8221; or &#8220;Text only&#8221; has been used, but in this case the symantics are slightly different because I don&#8217;t really want people to see underlying site, I only want the search engine to. In my implementation, the shadow site is basically a WordPress blog used as a content manager with all the relevant HTML articles stored in the associated MySQL database. <a title="WordPress home page" href="http://wordpress.org/" target="_self">WordPress 2.5.1</a> offers a number of interfaces with which to extract the pages and articles, so I can very easily use the same source text in my Flex application too. <a title="WordPress home page" href="http://wordpress.org/" target="_self">WordPress</a> also has a great publishing element and user manager, so makes for a very rich content management system. You can of course use any CMS of your choice, but I chose WordPress.</p>
<p>The most important part to creating the shadow site is the javascript that queries the current version of Flash Player installed, then either displays the trailing HTML (derived from PHP) or redirects to the Flex version of the site. On redirect, the javascript also interprets the current URL parameters and rearranges them into a friendly format for &#8220;deep linking&#8221;.</p>
<p>The main reason for using WordPress is the great slug support, which is useful on Google as each page is separately displayed. Make sure that the &#8220;PermaLink&#8221; settings are not using the default format as historically search engines could not cope with GET notation very well.</p>
<p>Currently, this solution does need some polish as the way I have implemented it is fairly static, resulting in the RSS feed being broken. Solving the problem should be fairly simple by making the javascript text conditionally addable by a PHP function (based on the URL).</p>
<p>To see the shadow site you need to disable Flash in your browser. The easiest way I found to do this is to use Internet Explorer and go to the &#8220;Tools<strong>-&gt;</strong>Manage Add-ons<strong>-&gt;</strong>Enable or Disable Add-ons..&#8221; and disable the &#8220;Shockwave Flash Object&#8221;. At the time of writing, the HTML site is actually looking prettier than the Flex site but that will change in time <img src='http://flexbandit.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Hopefully that is all the information you&#8217;ll need to create your own shadow site.</p>
<p>The PHP/javascript for selecting whether to use the Flash or HTML looks like this:</p>
<pre>&lt;script src="/AC_OETags.js" language="Javascript"&gt;&lt;/script&gt;
&lt;script language="JavaScript" type="text/javascript"&gt;
&lt;!--
// -----------------------------------------------------------------------------
// Globals
// Major version of Flash required
var requiredMajorVersion = 9;
// Minor version of Flash required
var requiredMinorVersion = 0;
// Minor version of Flash required
var requiredRevision = 0;
// -----------------------------------------------------------------------------
// --&gt;
&lt;/script&gt;
&lt;script language="JavaScript" type="text/javascript"&gt;
&lt;!--
// Version check for the Flash Player that has the ability to start Player Product Install (6.0r65)
var hasProductInstall = DetectFlashVer(6, 0, 65);

// Version check based upon the values defined in globals
var hasRequestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);

// Check to see if a player with Flash Product Install is available and the version does not meet the requirements for playback
if ( hasProductInstall &amp;&amp; !hasRequestedVersion ) {
	// MMdoctitle is the stored document.title value used by the installation process to close the window that started the process
	// This is necessary in order to close browser windows that are still utilizing the older version of the player after installation has completed
	// DO NOT MODIFY THE FOLLOWING FOUR LINES
	// Location visited after installation is complete if installation is required
	var MMPlayerType = (isIE == true) ? "ActiveX" : "PlugIn";
	var MMredirectURL = window.location;
    document.title = document.title.slice(0, 47) + " - Flash Player Installation";
    var MMdoctitle = document.title;

	AC_FL_RunContent(
		"src", "playerProductInstall",
		"FlashVars", "MMredirectURL="+MMredirectURL+'&amp;MMplayerType='+MMPlayerType+'&amp;MMdoctitle='+MMdoctitle+"",
		"width", "100%",
		"height", "100%",
		"align", "middle",
		"id", "ClarisolveWebSite_v2",
		"quality", "high",
		"bgcolor", "#869ca7",
		"name", "ClarisolveWebSite_v2",
		"allowScriptAccess","sameDomain",
		"type", "application/x-shockwave-flash",
		"pluginspage", "http://www.adobe.com/go/getflashplayer"
	);
} else if (hasRequestedVersion) {
    var strReturn = "";
    var strHref = window.location.href;
    if ( strHref.indexOf("/") &gt; -1 ){
        var aQueryString = strHref.split("/");
        for ( var iParam = aQueryString.length-1; iParam &gt; aQueryString.length-3; iParam-- ){
		    if ( isNaN(aQueryString[iParam]) ) {
	            strReturn += "page=" + aQueryString[iParam];
				iParam = 2;
			} else {
	            strReturn += "archives=" + aQueryString[iParam] + "&amp;";
			}
	    }
    }

    window.location = "/ClarisolveWebSite_v2.html#" + strReturn;
}
// --&gt;
&lt;/script&gt;
&lt;noscript&gt;
  	&lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="ClarisolveWebSite_v2" width="100%" height="100%"
			codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab"&gt;
			&lt;param name="movie" value="ClarisolveWebSite_v2.swf" /&gt;
			&lt;param name="quality" value="high" /&gt;
			&lt;param name="bgcolor" value="#869ca7" /&gt;
			&lt;param name="allowScriptAccess" value="sameDomain" /&gt;
			&lt;embed src="ClarisolveWebSite_v2.swf" quality="high" bgcolor="#869ca7"
				width="100%" height="100%" name="ClarisolveWebSite_v2" align="middle"
				play="true"
				loop="false"
				quality="high"
				allowScriptAccess="sameDomain"
				type="application/x-shockwave-flash"
				pluginspage="http://www.adobe.com/go/getflashplayer"&gt;
			&lt;/embed&gt;
	&lt;/object&gt;
&lt;/noscript&gt;

&lt;?php
define('WP_USE_THEMES', true);
require('./wordpress/wp-blog-header.php');
?&gt;</pre>
<h1>Conclusion</h1>
<p>SEO is quite a large subject, so I haven&#8217;t gone into the details of how to understand the inner workings of Google or the use of &#8220;&lt;strong&gt;&#8221; and &#8220;&lt;h1&gt;&#8221; tags. Instead I have concentrated on how to get your HTML recognised in a search engine and how to alter your URL to something more &#8220;Deep Link&#8221; friendly.</p>
<p>The next part of this article will be related to importing WordPress articles and deep linking.</p>
]]></content:encoded>
			<wfw:commentRss>http://flexbandit.com/archives/7/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

