<?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>Rareview Blog &#187; Code</title>
	<atom:link href="http://www.rareviewblog.com/category/code/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rareviewblog.com</link>
	<description>Rareview's Blog</description>
	<lastBuildDate>Wed, 28 Jul 2010 19:11:20 +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>Search Engine &amp; iPhone-Friendly Websites Using Web Standards</title>
		<link>http://www.rareviewblog.com/2009/03/31/search-engine-iphone-friendly-websites-using-web-standards/</link>
		<comments>http://www.rareviewblog.com/2009/03/31/search-engine-iphone-friendly-websites-using-web-standards/#comments</comments>
		<pubDate>Wed, 01 Apr 2009 04:02:30 +0000</pubDate>
		<dc:creator>Rareview</dc:creator>
				<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://www.rareviewblog.com/?p=171</guid>
		<description><![CDATA[If you&#8217;ve used an iPhone, you&#8217;ve noticed that Flash content cannot be displayed. Also, for users that have Flash turned off, those using screen readers, and for Search Engines, animation cannot be seen or indexed. However, there is a great method we&#8217;ve been using to display content that will work for everyone. First, let&#8217;s say [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;ve used an iPhone, you&#8217;ve noticed that Flash content cannot be displayed. Also, for users that have Flash turned off, those using screen readers, and for Search Engines, animation cannot be seen or indexed. However, there is a great method we&#8217;ve been using to display content that will work for everyone.</p>
<p>First, let&#8217;s say you have a page with a Flash animation on it. For this example, we&#8217;re going to use our project management tool, <a href="http://www.projecturf.com" target="_blank">Projecturf</a>, to explain how we do this. If you look at the site in a browser with Flash installed, you&#8217;ll notice that we have animation to show the user various parts of the application in a cool, dynamic way. Those screenshots have animated talk bubbles with some text that explain each section. All of this is useful information for the user <em>and</em> a Search Engine. However, it&#8217;s in Flash. If you&#8217;re on an iPhone, you would see a big blank box where the Flash is suppose to be when you visit the website. This just won&#8217;t do.</p>
<p>Here&#8217;s the method we&#8217;re using. First, we use SWFObject (see our post about using <a href="http://www.rareviewblog.com/2009/03/31/swfobject-flashvars-instead-of-external-xml-files/" target="_self">SWFObject and Flashvars</a>) to load the SWF. The SWF is displayed in a <strong>&lt;div&gt;</strong> tag using an ID. In addition to having the animated version, we have also taken a screenshot of what the first frame of the animation looks like (which we&#8217;ll use later). You can <a href="http://www.projecturf.com/images/projecturf-screenCaptures.jpg" target="_blank">see it here</a>. In addition, we have included the text that is inside the SWF within the <strong>&lt;div&gt;</strong> and have told it not to display on the page using CSS.</p>
<p>Here&#8217;s the logic of how this works. If the user is viewing the site in a browser with Flash installed, they will see the animation, which is on the very top layer. If the user is on an iPhone or does not have Flash installed, they will see the image that is sitting underneath in the <strong>&lt;div&gt;</strong> (which displays a completed, static site rather than a big blank spot where the animation should be). If a Search Engine crawls the site, it will read the content that is also in the <strong>&lt;div&gt;</strong>. This information is otherwise displayed in the image and/or animation. This has been a very effective method for ensuring maximum compatibility with multiple devices, browsers, user preferences, and Search Engines.</p>
<p><strong>Below is the SWFObject code used to insert the Flash in the &#8220;flashBanner&#8221; &lt;div&gt; (note that SWFObject now has a cleaner, more updated way of inserting SWF files with Version 2)</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;</span>
    // <span style="color: #009900;">&lt;!<span style="color: #66cc66;">&#91;</span>CDATA<span style="color: #66cc66;">&#91;</span></span>
<span style="color: #009900;">        var so <span style="color: #66cc66;">=</span> new SWFObject<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;flash/pt_home.swf&quot;</span>, <span style="color: #ff0000;">&quot;Home&quot;</span>, <span style="color: #ff0000;">&quot;950&quot;</span>, <span style="color: #ff0000;">&quot;604&quot;</span>, <span style="color: #ff0000;">&quot;8&quot;</span>, <span style="color: #ff0000;">&quot;#202020&quot;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #009900;">     	so.addParam<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;wmode&quot;</span>, <span style="color: #ff0000;">&quot;transparent&quot;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #009900;">    	so.useExpressInstall<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'flash/expressinstall.swf'</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #009900;">    	so.write<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;flashBanner&quot;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #009900;">    <span style="color: #66cc66;">//</span> <span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#93;</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span></pre></td></tr></table></div>

<p><strong>Below is the code used in the HTML file</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;flashBanner&quot;</span>&gt;</span>
     <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">img</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;images/projecturf-screenCaptures.jpg&quot;</span> <span style="color: #000066;">alt</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Projecturf Screen Captures&quot;</span> <span style="color: #000066;">width</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;950&quot;</span> <span style="color: #000066;">height</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;604&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">h2</span>&gt;</span>Projects<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">h2</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;</span>Create projects in a snap! Your master calendar shows all milestones on all projects.<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span>
&nbsp;
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">h2</span>&gt;</span>Dashboard<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">h2</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;</span>Post announcements, update the project brief, and follow the latest activities.<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span>
&nbsp;
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">h2</span>&gt;</span>Milestones<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">h2</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;</span>Calendar important milestones, set deadlines, and assign to team members.<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span>
&nbsp;
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">h2</span>&gt;</span>Tasks<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">h2</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;</span>Quickly create tasks, associate them with milestones, assign responsibility, and track progress.<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span>
&nbsp;
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">h2</span>&gt;</span>Timecard<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">h2</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;</span>Track billable time, export to excel, and send it to project managers or clients.<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span>
&nbsp;
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">h2</span>&gt;</span>Documents<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">h2</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;</span>Share documents without storage limits and organize by folders.<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span>
&nbsp;
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">h2</span>&gt;</span>Designs<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">h2</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;</span>Upload, share, rate, and get design concepts approved.<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span>
&nbsp;
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">h2</span>&gt;</span>Development<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">h2</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;</span>Share your development work using your servers and log progress.<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span>
&nbsp;
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">h2</span>&gt;</span>Discussions<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">h2</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;</span>Collaborate, discuss important topics, create threads, and comment on documents and designs.<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span>
&nbsp;
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">h2</span>&gt;</span>Search<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">h2</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;</span>Quickly find information and have it segmented by section for you automatically.<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span>
&nbsp;
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">h2</span>&gt;</span>Tools<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">h2</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;</span>Use the Project Completion Report and dynamic Gantt charts for status reports.<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span>
&nbsp;
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">h2</span>&gt;</span>Contacts<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">h2</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;</span>Manage project teams, view contact cards, and change permission levels.<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span>
&nbsp;
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">h2</span>&gt;</span>Address Book<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">h2</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;</span>Import contacts into your address book to quickly create project teams.<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span>
&nbsp;
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">h2</span>&gt;</span>Personalization<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">h2</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;</span>Personalize Projecturf with a color theme, your own logo, a private Web address, and more.<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span>
&nbsp;
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">h2</span>&gt;</span>Systems<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">h2</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;</span>Use a single login to access all your Projecturf accounts.<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span><span style="color: #808080; font-style: italic;">&lt;!-- !end flashBanner --&gt;</span></pre></td></tr></table></div>

<p><strong>Below is the code used in the CSS file to hide the content from users who can already see it in the animation</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#flashBanner</span> p<span style="color: #00AA00;">,</span> <span style="color: #cc00cc;">#flashBanner</span> h2 <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p><!--I'm sure I don't need to say this, but I will anyways. Using this method to hide content that isn't relevant and/or is not suppose to be on the page to trick Search Engines is not recommended. This method is used to provide users, devices, and Search Engines the means to view and read the content that is suppose to be on the page. Hiding content for Search Engines is a bad practice and is cheating. Don't cheat. :) --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.rareviewblog.com/2009/03/31/search-engine-iphone-friendly-websites-using-web-standards/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>SWFObject &#8211; Flashvars Instead of External XML Files</title>
		<link>http://www.rareviewblog.com/2009/03/31/swfobject-flashvars-instead-of-external-xml-files/</link>
		<comments>http://www.rareviewblog.com/2009/03/31/swfobject-flashvars-instead-of-external-xml-files/#comments</comments>
		<pubDate>Wed, 01 Apr 2009 03:46:57 +0000</pubDate>
		<dc:creator>Rareview</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://www.rareviewblog.com/?p=147</guid>
		<description><![CDATA[We&#8217;ve been using SWFObject for quite some time to insert Flash content into a website. It&#8217;s a great way to get around the &#60;embed&#62; tag and remove the dreaded IE &#8220;click to activate this control&#8221; message. Lately, we&#8217;ve started to use Flashvars as opposed to external XML files to generate the content in the Flash [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve been using <a href="http://code.google.com/p/swfobject/wiki/documentation" target="_blank">SWFObject</a> for quite some time to insert Flash content into a website. It&#8217;s a great way to get around the <strong>&lt;embed&gt;</strong> tag and remove the dreaded IE <em>&#8220;click to activate this control&#8221;</em> message.</p>
<p>Lately, we&#8217;ve started to use Flashvars as opposed to external XML files to generate the content in the Flash files. We really like this approach for a few reasons. First, the content is in the HTML page directly, which means there is one less file to manage. Second (and this is a big one), if your SWF looks for an XML file to load content, the browser tends to cache that content. So the next time you visit the page, you will see the cached content even if you&#8217;ve replaced and updated your XML file. In this situation, the user has to manually clear their cache and reload the page to see the new content. The problem here is that most users don&#8217;t clear their cache all that often. So you run the risk of users seeing old, outdated content, even though you&#8217;ve spent the time to update it. So our solution recently has been to use Flashvars when we can. </p>
<p>A good example of this can be seen on our new website. The panels right underneath the clouds on the top of all the pages have text in them. They have a headline, sub-header, and a paragraph of text. The headline and sub-header are part of the SWF file and thus require us to either use an XML file, put the text directly in the Flash file itself (not very friendly for updates), or use Flashvars. Here&#8217;s how we did it (in the <strong>&lt;head&gt;</strong> of our document):</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;js/swfobject.js&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span> <span style="color: #808080; font-style: italic;">&lt;!-- Load SWFObject --&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;</span>
		var flashvars = {mainTitle: &quot;Functional, interactive design.&quot;, subTitle: &quot;Three words that mean more to us than you'd think.&quot;};
		var params = {wmode: &quot;transparent&quot;, allowFullScreen: &quot;false&quot;};
		var attributes = {};
		swfobject.embedSWF(&quot;flash/workheader.swf&quot;, &quot;flash-work&quot;, &quot;950&quot;, &quot;195&quot;, &quot;9.0.0&quot;, &quot;flash/expressInstall.swf&quot;, flashvars, params, attributes);
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span></pre></td></tr></table></div>

<p>You need to be using the latest version of <a href="http://code.google.com/p/swfobject/" target="_blank">SWFObject (version 2)</a> to do this. The benefits of using Flashvars is that the browser shouldn&#8217;t cache old XML data, it&#8217;s easier to maintain (i.e. less files to work with), and it&#8217;s written in the HTML document directly. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.rareviewblog.com/2009/03/31/swfobject-flashvars-instead-of-external-xml-files/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>
