<?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>Alekkus » Empowering social media with Flash &#187; SWFObject</title>
	<atom:link href="http://alekkus.com/blog/tag/swfobject/feed/" rel="self" type="application/rss+xml" />
	<link>http://alekkus.com/blog</link>
	<description>flex consultant + social media specialist</description>
	<lastBuildDate>Wed, 17 Mar 2010 07:54:54 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Flex tutorial: Embedding Flash content with SWFObject 2</title>
		<link>http://alekkus.com/blog/2009/02/flex-tutorial-embedding-flash-content-with-swfobject-2/</link>
		<comments>http://alekkus.com/blog/2009/02/flex-tutorial-embedding-flash-content-with-swfobject-2/#comments</comments>
		<pubDate>Wed, 04 Feb 2009 13:16:34 +0000</pubDate>
		<dc:creator>Alekkus</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex 3 (Moxie)]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[SWFObject]]></category>

		<guid isPermaLink="false">http://alekkus.com/blog/?p=109</guid>
		<description><![CDATA[If you are building your Flash content with Flex Builder 3 or Flash CS3, you will see that both came with a default HTML template that provides a way to embed your compiled SWF file. Although there&#8217;s nothing wrong with that way of doing it, SWFObject seems to be a better way (the author&#8217;s explanation [...]]]></description>
			<content:encoded><![CDATA[<p>If you are building your Flash content with Flex Builder 3 or Flash CS3, you will see that both came with a default HTML template that provides a way to embed your compiled SWF file. Although there&#8217;s nothing wrong with that way of doing it, <a href="http://code.google.com/p/swfobject/">SWFObject</a> seems to be a better way (the author&#8217;s explanation is <a href="http://blog.deconcept.com/swfobject/#whyitsbetter">here</a>). In fact in the CS4 release, Adobe has <a href="http://theflashblog.com/?p=406">made this the standard way</a> of embedding Flash content. </p>
<p>To manually work with SWFObject in Flex Builder, replace the codes in &#8220;html-template/index.template.html&#8221; with the codes below. Then place the following files into the &#8220;html-template&#8221; folder. </p>
<ul>
<li>swfobject.js</li>
<li>expressInstall.swf</li>
</ul>
<p>The files are available <a href="http://code.google.com/p/swfobject/">here</a>, or you can download the my source files to get those files.</p>
<p><strong>[update]</strong> If you are using Flex SDK 3.1 and below, deep linking (more specifically, the BrowserManager class) may not work with SWFObject. If that happens, simply replace the codes in the &#8220;history.js&#8221; file with <a href="http://alekkus.com/flex3/extra/history.js">this</a></p>
<p><strong>Demo:</strong><br />
<a href="http://alekkus.com/flex3/swfobject2.html">SWFObject 2</a> (view source enabled)</p>
<p><strong>Source Codes:</strong></p>
<pre name="code" class="html">

&lt;!-- saved from url=(0014)about:internet --&gt;
&lt;html lang=&quot;en&quot;&gt;

&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;history/history.css&quot; /&gt;
&lt;title&gt;${title}&lt;/title&gt;
&lt;script src=&quot;AC_OETags.js&quot; language=&quot;javascript&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;history/history.js&quot; language=&quot;javascript&quot;&gt;&lt;/script&gt;

&lt;style&gt;
body { margin: 0px; overflow:hidden }
&lt;/style&gt;

&lt;/head&gt;

&lt;body scroll=&quot;no&quot;&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;swfobject.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;

	var flashVars = {};

	var params = { play: &quot;true&quot;,
				   loop: &quot;false&quot;,
				   quality: &quot;high&quot;,
				   wmode: &quot;window&quot;,
				   allowscriptaccess: &quot;sameDomain&quot; };

	var attributes = { id: &quot;${application}&quot; };

	swfobject.embedSWF( &quot;${swf}.swf&quot;,
						&quot;divContent&quot;,
						&quot;100%&quot;, &quot;100%&quot;,
						&quot;9.0.0&quot;,
						&quot;expressInstall.swf&quot;,
						flashVars,
						params,
						attributes );
&lt;/script&gt;

&lt;div id=&quot;divContent&quot;&gt;
	&lt;h1&gt;Alternative content&lt;/h1&gt;
	&lt;p&gt;&lt;a href=&quot;http://www.adobe.com/go/getflashplayer&quot;&gt;&lt;img src=&quot;http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif&quot; alt=&quot;Get Adobe Flash player&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://alekkus.com/blog/2009/02/flex-tutorial-embedding-flash-content-with-swfobject-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
