<?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>Web Cash &#187; flash</title>
	<atom:link href="http://www.earn-web-cash.com/tag/flash/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.earn-web-cash.com</link>
	<description>Writing, Designing, and Making Money Online</description>
	<lastBuildDate>Sun, 04 Dec 2011 22:52:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2</generator>
		<item>
		<title>Flash Movies: Standards Compliant Embedding</title>
		<link>http://www.earn-web-cash.com/2008/03/18/flash-movies-standards-compliant-embedding/</link>
		<comments>http://www.earn-web-cash.com/2008/03/18/flash-movies-standards-compliant-embedding/#comments</comments>
		<pubDate>Tue, 18 Mar 2008 22:27:13 +0000</pubDate>
		<dc:creator>Walkere</dc:creator>
				<category><![CDATA[HTML Tutorials]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[slideshow]]></category>
		<category><![CDATA[standards]]></category>
		<category><![CDATA[widget]]></category>

		<guid isPermaLink="false">http://www.earn-web-cash.com/2008/03/18/flash-movies-standards-compliant-embedding/</guid>
		<description><![CDATA[The other day, I was looking into using Picasa to create an image album and embed it as a slideshow on a website. Uploading the images and creating the album was easy. However, I noticed that the code Google creates to embed the slideshow (a flash file) is not standards compliant &#8211; it uses the [...]]]></description>
			<content:encoded><![CDATA[<p>The other day, I was looking into using Picasa to create an image album and embed it as a slideshow on a website.</p>
<p>Uploading the images and creating the album was easy.  However, I noticed that the code Google creates to embed the slideshow (a flash file) is not standards compliant &#8211; it uses the <code>&lt;embed&gt;</code> tag.</p>
<p>How can we convert this code to a standards compliant version?<br />
<span id="more-178"></span></p>
<h4>The Original Picasa Embed Code</h4>
<p>The code that Google generates to embed the flash file uses the embed element.  The embed tag includes all of the pertinent information &#8211; the swf file, the height, the width, and the parameters.</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;embed <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;application/x-shockwave-flash&quot;</span></span>
<span style="color: #009900;">  <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://picasaweb.google.com/s/c/bin/slideshow.swf&quot;</span></span>
<span style="color: #009900;">  <span style="color: #000066;">width</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;288&quot;</span> <span style="color: #000066;">height</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;192&quot;</span></span>
<span style="color: #009900;">  flashvars<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;host=picasaweb.google.com&amp;RGB=0x000000&amp;feed=http%3A%2F%2Fpicasaweb.google.com%2Fdata%2Ffeed%2Fapi%2Fuser%2Fslowwalkere%2Falbumid%2F5178325186511467969%3Fkind%3Dphoto%26alt%3Drss&quot;</span></span>
<span style="color: #009900;">  pluginspage<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://www.macromedia.com/go/getflashplayer&quot;</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span>embed&gt;</span></pre></div></div>

<p>The problem here is that the code uses the embed tag.  This is no longer recognized as a valid html element &#8211; although it still functions in most browsers.</p>
<h4>Converting Embed to Object</h4>
<p>We can, however, convert this embed element into an object element.  The object element <strong>is</strong> standards compliant, and <a href="http://www.alistapart.com/articles/flashsatay">with a few parameters</a> it is compatible across most browsers.</p>
<p>To do this, let&#8217;s identify the information that we&#8217;ll need from the original Picasa code.</p>
<p>Obviously, we&#8217;ll need the flash file.  This is the value of the &#8220;src=&#8221; attribute.  We&#8217;ll also need the height and width, which are pretty obvious.  Finally, we&#8217;ll need the parameters to be passed to the flash movie &#8211; located in the flashvars parameter.</p>
<p>Here&#8217;s what an object element might look like to display a flash movie.</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">object</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;application/x-shockwave-flash&quot;</span></span>
<span style="color: #009900;">  <span style="color: #000066;">data</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;flash-file.swf&quot;</span> <span style="color: #000066;">height</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;400&quot;</span> <span style="color: #000066;">width</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;400&quot;</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">param</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;movie&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;flash-file.swf&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">object</span>&gt;</span></pre></div></div>

<p>We create the object and give it the attribute <code>type="application/x-shockwave-flash"</code>.  This tells the browser it is a flash movie.</p>
<p>We pass the name of the flash file with the data attribute and the &#8220;movie&#8221; param element &#8211; notice that the filename is passed twice here.</p>
<p>Finally, we pass the height and width parameters as attributes to the object element.</p>
<h4>Filling Out the Object</h4>
<p>Now we can take the values provided for us by Google and create a new, valid object to display the flash slideshow.</p>
<p>The only extra thing we need to know is that we can send another param element &#8211; name=&#8221;flashVars&#8221; &#8211; to contain the flash parameters.</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">object</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;application/x-shockwave-flash&quot;</span></span>
<span style="color: #009900;">  <span style="color: #000066;">data</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://picasaweb.google.com/s/c/bin/slideshow.swf&quot;</span></span>
<span style="color: #009900;">  <span style="color: #000066;">width</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;288&quot;</span> <span style="color: #000066;">height</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;192&quot;</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">param</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;movie&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://picasaweb.google.com/s/c/bin/slideshow.swf&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">param</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;flashVars&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;host=picasaweb.google.com&amp;amp;RGB=0x000000&amp;amp;feed=http%3A%2F%2Fpicasaweb.google.com%2Fdata%2Ffeed%2Fapi%2Fuser%2Fslowwalkere%2Falbumid%2F5178325186511467969%3Fkind%3Dphoto%26alt%3Drss&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">object</span>&gt;</span></pre></div></div>

<p>This should do the trick and display our Flash slideshow in a standards compliant way.  You should also be able to apply this to any other widget that displays a flash movie.</p>
<p>Also, here are two minor things to keep in mind.</p>
<p>The param elements are self closing &#8211; i.e. <code>&lt;param /&gt;</code>.  The param element doesn&#8217;t contain any text, so it must be self closing to be standards compliant.</p>
<p>The flashVars value is constructed as a query string.  It utilizes ampersands (&amp;) to separate key/value pairs.  Ampersands are a standards no-no &#8211; they should be escaped as an html entity (<code>&amp;amp;</code>).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.earn-web-cash.com/2008/03/18/flash-movies-standards-compliant-embedding/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

