<?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>Blog of Ruy Adorno &#187; flash</title>
	<atom:link href="http://blog.ruyadorno.com/category/flash/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.ruyadorno.com</link>
	<description>Flash, Actionscript, Haxe, Flex and more</description>
	<lastBuildDate>Sun, 11 Apr 2010 04:04:31 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Using your html as a xml data source</title>
		<link>http://blog.ruyadorno.com/2010/01/using-your-html-as-a-xml-data-source/</link>
		<comments>http://blog.ruyadorno.com/2010/01/using-your-html-as-a-xml-data-source/#comments</comments>
		<pubDate>Mon, 11 Jan 2010 14:53:17 +0000</pubDate>
		<dc:creator>Ruy Adorno</dc:creator>
				<category><![CDATA[flash]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[seo]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://blog.ruyadorno.com/?p=62</guid>
		<description><![CDATA[Since a long time ago I've been wanting to write this post, it is all about a simple technique that I used in my portfolio and turned it so much more friendly to search engines.
It basically consists on turning the html itself in the content source for flash. But in order to achieve this we have to make sure that all required steps were well done.]]></description>
			<content:encoded><![CDATA[<p>Since a long time ago I&#8217;ve been wanting to write this post, it is all about a simple technique that I used in my portfolio and turned it so much more friendly to search engines.</p>
<p>It basically consists on turning the html itself in the content source for flash. But in order to achieve this we have to make sure that all required steps were well done. Here is a little diagram to show what it looks like.</p>
<p><a href="http://blog.ruyadorno.com/wp-content/uploads/2010/01/xhtml_flash_diagram.jpg"><img class="alignnone size-full wp-image-67" title="xhtml_flash_diagram" src="http://blog.ruyadorno.com/wp-content/uploads/2010/01/xhtml_flash_diagram.jpg" alt="Xhtml as content source for flash" width="550" height="385" /></a></p>
<p>First of all we need to use swfobject or another similar tool for flash insertion. It is essential for the final result because the javascript will replace the actual html in the page and it will allow us to actually fill the html with information and the user will only see the flash content.</p>
<p>Second step is make sure that your html will be xhtml strict compatible. This is essential to make sure that the flash will be able to parse it as a xml.</p>
<p>After having everything setup we have to start filling the html with some relevant information and the third step is to do this wiselly, making a good use of class and id attributes on your div&#8217;s. They&#8217;ll be essential when parsing the data on flash.</p>
<p>Once we have all html is finally time to go start creating some flash, the unique difference on your flash code will be some adjustements before xml parsing, we&#8217;ll get the xml loaded as a string and direct replace some tags to avoid problems during the parsing, in my case I&#8217;ll start by getting just the content from <strong>body</strong>, like: <em>xmlString.split(&#8220;&lt;body&gt;&#8221;)[1].split(&#8220;&lt;/body&gt;&#8221;)[0]</em> and after that insert a cdata inside all <strong>p</strong> tags to avoid problems with <strong>a</strong> and <strong>br</strong> tags like: <em>xmlString.split(&#8216;&lt;p&gt;&#8217;).join(&#8216;&lt;p&gt;&lt;![CDATA[').split("&lt;/p&gt;").join("]]&gt;&lt;/p&gt;&#8221;)</em>, in my case I had to keep splitting all <strong>p</strong> tags that have different ids, you might do the same or find a smart way to add all the cdata blocks to the xml.</p>
<p>And that&#8217;s it! Now you can even create a nice css and you will have an alternative version of your site avaiable to users without flash player (like in the iphone).</p>
<p>If you want you can check my online <a title="Flash Developer Portfolio" href="http://www.ruyadorno.com" target="_blank">portfolio</a> html as an example for the xhtml code organization and you may also disable javascript to see how it looks like for users that don&#8217;t have flashplayer avaiable.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ruyadorno.com/2010/01/using-your-html-as-a-xml-data-source/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
