<?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>TheCosmonaut&#187; Flash Studio</title>
	<atom:link href="http://www.thecosmonaut.com/category/flash-studio/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thecosmonaut.com</link>
	<description>Elite Web Design, Programming, and Consulting</description>
	<lastBuildDate>Fri, 02 Jul 2010 16:47:24 +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>5 Steps for Building a SEO-Friendly Flash Site Using SWFObject and SWFAddress</title>
		<link>http://www.thecosmonaut.com/2008/11/09/5-steps-for-building-a-seo-friendly-flash-site-using-swfobject-and-swfaddress/</link>
		<comments>http://www.thecosmonaut.com/2008/11/09/5-steps-for-building-a-seo-friendly-flash-site-using-swfobject-and-swfaddress/#comments</comments>
		<pubDate>Sun, 09 Nov 2008 18:59:11 +0000</pubDate>
		<dc:creator>Eric Oliver</dc:creator>
				<category><![CDATA[Flash Studio]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[SWFAddress]]></category>
		<category><![CDATA[SWFObject]]></category>

		<guid isPermaLink="false">http://www.thecosmonaut.com/?p=96</guid>
		<description><![CDATA[In this post I outline what USED to be the best way to build a Flash site that was SEO-friendly. It would serve Flash to the people who had Flash, HTML to the people who could only support HTML, and would allow HTML to be indexed by search engines, and wouldn&#8217;t have separate URLs for [...]]]></description>
			<content:encoded><![CDATA[<p>In this post I outline what USED to be the best way to build a Flash site that was SEO-friendly. It would serve Flash to the people who had Flash, HTML to the people who could only support HTML, and would allow HTML to be indexed by search engines, and wouldn&#8217;t have separate URLs for your Flash and HTML sites. It was beautiful.</p>
<p>However,  the landscape has changed. Googlebot now indexes BOTH the Flash AND the HTML in SWFObject. The big problem this causes is that Google now gives results with direct links to your SWFs, which can completely mess everything up &#8212; I wrote a post that <a href="http://www.thecosmonaut.com/2008/10/17/flash-indexing-on-google-revisited/" target="_blank">explores the problems presented by Google&#8217;s ability to index Flash</a> if you want to read more. In a nutshell, however, I personally have come to the conclusion that although the method I describe below is not IDEAL, it still offers the best way to build all-Flash sites that will get properly indexed and will most often present the correct links in Google results. </p>
<p>So without further ado, here&#8217;s how to go about building a SEO-friendly Flash site using SWFObject and SWFAddress.</p>
<ol>
<li><strong>Use SWFObject</strong><br />
If you&#8217;re not already using the latest version of <a title="SWFObject" href="http://code.google.com/p/swfobject/" target="_blank">SWFObject</a>, you should be. Adobe has now announced that it is supporting SWFObject specifically. The beauty of SWFObject is that it allows you to serve Flash to people who can support it and (X)HTML to people who can&#8217;t. Also, search engine crawlers index the (X)HTML alternate content you serve, meaning that if you put your content in there, it will get indexed.</li>
<li><strong>Create HTML pages for each of your flash pages</strong><br />
For each of your Flash pages (home, about us, contact us, etc.), create an HTML page that mirrors its content. That means all the text, all the links, all the pictures, etc. The HTML page doesn&#8217;t need to be pretty, but it should semantically reflect the importance of the content on your Flash page (that means have headings, have lists, have paragraphs, use proper links, etc. This will allow search engine crawlers to make proper sense of the content on the site. Also, if you want to make your Flash site mobile-friendly, then make these HTML pages pretty <img src='http://www.thecosmonaut.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </li>
<li><strong>Use SWFObject and multiple Flash files to hide the content</strong><br />
So you have all these pages, but you don&#8217;t want anyone who can support Flash to SEE them &#8211; only search engines. That&#8217;s where SWFObject comes in. On each of these HTML pages, you will use SWFObject to embed the same Flash file, but have the non-Flash content reflect the HTML you built.</li>
<li><strong>Use SWFAddress and deep linking to direct Flash users to the proper content</strong><br />
Like SWFObject, if you&#8217;re not using <a title="SWFAddress" href="http://www.asual.com/swfaddress/" target="_blank">SWFAddress</a>, you probably should be. SWFAddress allows you to read information from the URL and then use that within your Flash. The most common reason for doing this is to be able to do <a title="Deep Linking" href="http://en.wikipedia.org/wiki/Deep_linking" target="_blank">deep linking</a> in Flash. I will write some tutorials on how to use SWFAddress in the future, but for now you should download the example files and work through them. Using SWFAddress, you can use #anchors to define where in your Flash you want to go. So if you go to &#8220;www.mysite.com/index.html#aboutUs&#8221;, you can have SWFAddress load up your &#8220;About Us&#8221; section. The beauty of this is that search engines ignore #anchors so they won&#8217;t get confused and mess up indexing on your site.</li>
<li><strong>Add a JavaScript call using SWFAddress to direct your Flash to the right section</strong><br />
At this point you&#8217;ve got multiple HTML pages and the ability to deep link in Flash. Now you need to direct users who come from a search engine to the right content within your Flash. All you need to do is call SWFAddress from JavaScript and update the page URL. Since your Flash is set up to use SWFAddress, it will read the update and take the user to the proper section.</li>
</ol>
<p>All those steps are a little abstract, so here&#8217;s a more solid example:</p>
<p>Let&#8217;s say I&#8217;ve got a website with three pages: a &#8220;Home&#8221; page, an &#8220;About Us&#8221; page , and a &#8220;Contact Us&#8221; page. I&#8217;ve built this website in Flash with only one Flash file called &#8220;main.swf&#8221;. Now I want to make sure that this site is search engine optimized.</p>
<p>First thing I do is make sure that I embed the page using SWFObject. Since this first page will be my &#8220;Home&#8221; or index page, I create a page called &#8220;index.html&#8221;. At this point, my index.html code will look like:</p>
<p><pre><code>&lt;!-- Start swfobject code --&gt;
&lt;script src=&quot;swfobject.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
 &lt;script type=&quot;text/javascript&quot;&gt;&lt;!--

var flashvars = {};

var params = {};
params.wmode = &quot;transparent&quot;;

var attributes = {};

swfobject.embedSWF(&quot;main.swf&quot;, &quot;flashContent1&quot;, &quot;760&quot;, &quot;420&quot;, &quot;9.0.0&quot;, &quot;expressInstall.swf&quot;, flashvars, params, attributes);

// --&gt;&lt;/script&gt;
&lt;!-- end swfobject code --&gt;
&lt;div id=&quot;flashContent1&quot;&gt;&lt;/div&gt;
</code></pre><br />
Now I will create pages just like the page above for all my interior pages. So I will have three HTML pages &#8220;index.html&#8221;, &#8220;aboutUs.html&#8221;, and &#8220;contactUs.html&#8221;. Once those pages are built, I want to take all the content from inside my Flash file and add it to the html page. For example, the &#8220;aboutUs.html&#8221; page would look like this:</p>
<p><pre><code>&lt;!-- Start swfobject code --&gt;
&lt;script src=&quot;swfobject.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
 &lt;script type=&quot;text/javascript&quot;&gt;&lt;!--

var flashvars = {};

var params = {};
params.wmode = &quot;transparent&quot;;

var attributes = {};

swfobject.embedSWF(&quot;main.swf&quot;, &quot;flashContent1&quot;, &quot;760&quot;, &quot;420&quot;, &quot;9.0.0&quot;, &quot;expressInstall.swf&quot;, flashvars, params, attributes);

// --&gt;&lt;/script&gt;
&lt;!-- end swfobject code --&gt;
&lt;div id=&quot;flashContent1&quot;&gt;
&lt;h1&gt;About Us&lt;/h1&gt;
Here is a bunch of information that I&#039;ve copied and pasted from my Flash file. It&#039;s all the content from my About Us page.
&lt;ul&gt;
&nbsp;&nbsp;&lt;li&gt;&lt;a href=&quot;home.html&quot;&gt;Home&lt;/a&gt;&lt;/li&gt;
&nbsp;&nbsp;&lt;li&gt;&lt;a href=&quot;aboutUs.html&quot;&gt;Home&lt;/a&gt;&lt;/li&gt;
&nbsp;&nbsp;&lt;li&gt;&lt;a href=&quot;contactUs.html&quot;&gt;Home&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;

</code></pre></p>
<p>I&#8217;ve now got three files with HTML content within them that mirrors my Flash. This means that Googlebot can now see my content. However if someone searches for an item that appears on my About Us page and clicks on the link in Google, they&#8217;ll be taken to &#8220;www.mysite.com/aboutUs.html&#8221; and will see my Flash. The only problem is they&#8217;ll see my HOME page in Flash, not my About Us page. That&#8217;s where SWFAddress comes in.</p>
<p>First, I have to set up SWFAddress in my Flash file. NOTE: You should always build your site from the beginning using SWFAddress to navigate your Flash. It&#8217;s a HUGE pain to try to go back and retrofit your site to work with SWFAddress, but it&#8217;s pretty easy to build your site to use SWFAddress from the beginning. Either way you go, you will add ActionScript which looks similar to this:</p>
<p><pre><code>// SWFAddress handling
import com.asual.swfaddress.*;
function handleSWFAddress(e:SWFAddressEvent) {
try {
if (currentFrame == 2 &amp;amp;&amp;amp; e.value == &#039;/&#039;) {
play();
} else {
gotoAndStop(&#039;$&#039; + e.value);
}
} catch(err) {
gotoAndStop(&#039;$/error/&#039;);
}
}
SWFAddress.addEventListener(SWFAddressEvent.CHANGE, handleSWFAddress);
</code></pre><br />
See the &#8220;CS3&#8243; example inside the SWFAddress download in order to see how the above script would navigate you to the sections in your site (I personally use a different, more complex way but that&#8217;s just me). In any case, now the Flash is set up that if I go to &#8220;www.mysite.com/index.html#/aboutUs/&#8221; it will show the about us section. Deep linking is working.</p>
<p>However, what happens if a person goes to &#8220;www.mysite.com/aboutUs.html&#8221;? SWFAddress looks for information following the &#8220;#&#8221; so it doesn&#8217;t know that it has to go to the About Us section. You do this by adding updating SWFAddress using a call to it in your javascript. The code for this is really simple:</p>
<p><pre><code>SWFAddress.setValue([link value]);
</code></pre></p>
<p>So your About Us page code becomes:</p>
<p><pre><code>&lt;!-- Start swfobject code --&gt;
&lt;script src=&quot;swfobject.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
 &lt;script type=&quot;text/javascript&quot;&gt;&lt;!--

var flashvars = {};

var params = {};
params.wmode = &quot;transparent&quot;;

var attributes = {};

swfobject.embedSWF(&quot;main.swf&quot;, &quot;flashContent1&quot;, &quot;760&quot;, &quot;420&quot;, &quot;9.0.0&quot;, &quot;expressInstall.swf&quot;, flashvars, params, attributes);

SWFAddress.setValue(&quot;/aboutUs&quot;);

// --&gt;&lt;/script&gt;
&lt;!-- end swfobject code --&gt;
&lt;div id=&quot;flashContent1&quot;&gt;
&lt;h1&gt;About Us&lt;/h1&gt;
Here is a bunch of information that I&#039;ve copied and pasted from my Flash file. It&#039;s all the content from my About Us page.
&lt;ul&gt;
&nbsp;&nbsp;&lt;li&gt;&lt;a href=&quot;home.html&quot;&gt;Home&lt;/a&gt;&lt;/li&gt;
&nbsp;&nbsp;&lt;li&gt;&lt;a href=&quot;aboutUs.html&quot;&gt;Home&lt;/a&gt;&lt;/li&gt;
&nbsp;&nbsp;&lt;li&gt;&lt;a href=&quot;contactUs.html&quot;&gt;Home&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;

</code></pre><br />
And you&#8217;re done! This looks more complicated than it actually is. Using SWFObject is extremely straightforward. SWFAddress is a little more poorly documented, and relying on SWFAddress updates to navigate your Flash can be a little awkward at first, but once you get the hang of it, it becomes a really nice, elegant way of working with site content. I&#8217;ll post a tutorial on working with SWFAddress soon, but for now, hopefully this will get you moving on the path toward search engine optimized Flash sites!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thecosmonaut.com/2008/11/09/5-steps-for-building-a-seo-friendly-flash-site-using-swfobject-and-swfaddress/feed/</wfw:commentRss>
		<slash:comments>46</slash:comments>
		</item>
		<item>
		<title>Have Your Banners Update Themselves: The AS2 Date Detector</title>
		<link>http://www.thecosmonaut.com/2008/10/24/have-your-banners-update-themselves-the-as2-date-detector/</link>
		<comments>http://www.thecosmonaut.com/2008/10/24/have-your-banners-update-themselves-the-as2-date-detector/#comments</comments>
		<pubDate>Fri, 24 Oct 2008 17:02:54 +0000</pubDate>
		<dc:creator>Eric Oliver</dc:creator>
				<category><![CDATA[Flash Studio]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[AS2]]></category>
		<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://www.thecosmonaut.com/?p=91</guid>
		<description><![CDATA[Simple free script which will allow banner campaigns to update themselves when you set specific dates.]]></description>
			<content:encoded><![CDATA[<p>I do a lot of banner ads for video games. These banner ads very often run both pre-launch (before the game is released) and post-launch (after the game is released). The trick is the banners need to include a release date before the game is released (e.g. &#8220;Available November 18th&#8221;) and then a different message AFTER the game is released (e.g. &#8220;Available Now!&#8221;). You don&#8217;t want to have to build a completely different set of banners with a new message on them, so what do you do? Add a date detector.</p>
<p>All you need to do is build a movie clip with at least two frames, one which holds all the art for the &#8220;pre-launch&#8221; message and one which holds all the art for the &#8220;post-launch&#8221; message. Then you have a simple script which takes the cutoff date, checks it against the current date, and if it&#8217;s after launch, go to the &#8220;post-launch&#8221; frame. Here&#8217;s the script that I use:</p>
<p><pre><code>
// Remember months start from 0 (january=0, feb=1, etc.)
var launchDate:Date = new Date(2008,10,18);

function checkDate()
{
&nbsp;&nbsp;// Check to see if this after the launch date
&nbsp;&nbsp;var thisDate:Date = new Date();
&nbsp;&nbsp;if (thisDate &gt;= launchDate)
&nbsp;&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;gotoAndStop(&quot;launch&quot;);
&nbsp;&nbsp;}
}

checkDate();
</code></pre></p>
<p>It&#8217;s as easy as that! The only trick is to remember that in Flash, months start at 0. So November is number 10, instead of 11 (seems simple but it&#8217;s funny how ingrained month numbers are in ones mind!).</p>
<p>Here&#8217;s an example FLA which shows how the code above functions: <a href="http://www.thecosmonaut.com/wp-content/uploads/10/dateSelector.zip">dateSelector.zip</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.thecosmonaut.com/2008/10/24/have-your-banners-update-themselves-the-as2-date-detector/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flash Indexing on Google, Revisited</title>
		<link>http://www.thecosmonaut.com/2008/10/17/flash-indexing-on-google-revisited/</link>
		<comments>http://www.thecosmonaut.com/2008/10/17/flash-indexing-on-google-revisited/#comments</comments>
		<pubDate>Fri, 17 Oct 2008 17:45:55 +0000</pubDate>
		<dc:creator>Eric Oliver</dc:creator>
				<category><![CDATA[Flash Studio]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[search engine optimization]]></category>
		<category><![CDATA[SEO]]></category>

		<guid isPermaLink="false">http://www.thecosmonaut.com/?p=79</guid>
		<description><![CDATA[Brian Ussery has conducted some excellent case studies on how Googlebot interacts with Flash. I interpret these studies and some additional research to come up with my suggestion for what to do about Flash search engine optimization.]]></description>
			<content:encoded><![CDATA[<p>NOTE: This article has been revised based on the helpful comments from <a title="Brian Ussery" href="http://www.beussery.com/blog/index.php/2008/10/google-flash-seo/" target="_blank">Brian Ussery</a> and <a title="Bobby van der Sluis" href="http://www.bobbyvandersluis.com/" target="_blank">Bobby van der Sluis</a>. Thanks very much to both!</p>
<p>In my <a title="Flash indexing on Google" href="http://www.thecosmonaut.com/2008/07/08/google-now-indexing-flash-whats-new/" target="_blank">last posting on Flash indexing by Google</a>, I said that we should watch and wait because thorough testing and standards will begin to emerge over time. Well, the wait is over: <a title="Brian Ussery" href="http://www.beussery.com/blog/index.php/2008/10/google-flash-seo/" target="_blank">Brian Ussery</a> has published the first (so I&#8217;ve found) set of case studies on how Google indexes Flash. The results confirm much of what we already suspected.</p>
<p>Ussery conducted <a title="Flash indexing on Google: Case Studies" href="http://www.beussery.com/blog/index.php/2008/10/google-flash-seo/" target="_blank">four case studies</a>, studying different aspects of how Googlebot interacts with Flash. Here&#8217;s the upshot of his studies:</p>
<ul>
<li><strong>CASE STUDY #1: Does Googlebot correctly associate text inside a Flash file with the parent URL (the page that the Flash is embedded in)?</strong><br />
<strong>RESULTS: No.</strong> Usually Googlebot indexes the parent URL and the Flash separately.</li>
<li><strong>CASE STUDY #2: Can Flash files accrue PageRank?</strong><br />
<strong>RESULTS: Yes.</strong> Flash files accrue PageRank independently of their own parent URLs.</li>
<li><strong>CASE STUDY #3: Does Googlebot follow URLs containing #anchors?</strong><br />
<strong>RESULTS: No.</strong> Googlebot ignores #anchors and only extracts URLs preceding the #anchor.</li>
<li><strong>CASE STUDY #4: Can Google translate text inside of a Flash file?</strong><br />
<strong>RESULTS: No.</strong> Googlebot can not translate text inside of a Flash file.</li>
</ul>
<p>All these case studies seem to support the conclusion I came to <a title="Flash indexing on Google" href="http://www.thecosmonaut.com/2008/07/08/google-now-indexing-flash-whats-new/" target="_blank">earlier</a>: Google&#8217;s indexing support of Flash is meager at best, and at its worst, could possibly hurt your placement on search engines. So what should we, as Flash developers, do if we want to have a search engine optimized Flash site?</p>
<p>In the past, you could use SWFObject to embed your Flash and it would present the Flash file to people who could support it (people with the correct Flash plugin) and it would present alternate (X)HTML to people who COULDN&#8217;T support Flash. In the past, this also included Googlebot. So if you set up alternate (X)HTML, Googlebot would index that and if you built it right, your Flash pages could have nearly the same ranking as regular HTML pages (because Google was seeing HTML). This allowed you to build Flash sites normally, then build a bunch of alternate HTML pages that had the same Flash embedded, write out their content in HTML, use deep linking to have each individual page go to the correct &#8220;page&#8221; within Flash, and nobody was the wiser &#8212; Google indexed your content and people clicking on Google&#8217;s links would see the correct Flash. <a href="http://www.thecosmonaut.com/2008/11/09/5-steps-for-building-a-seo-friendly-flash-site-using-swfobject-and-swfaddress/">You can click here to see my tutorial on how to build a site this way.</a></p>
<p>However, that&#8217;s no longer the case. Brian Ussery and Bobby van der Sluis in <a href="http://groups.google.com/group/swfobject/browse_thread/thread/ad41ca3ddd9628c2#" target="_blank">their testing</a> have found that Google now indexes BOTH the (X)HTML content AND the Flash content in SWFObject. You might say &#8220;So what? Now Google is guaranteed to find my content &#8212; great news!&#8221; The problem is that Google, in the search results, could present a link DIRECTLY to your Flash file which may or may not be the correct &#8220;page&#8221; reflected in your (X)HTML. So now in your Google search results you can have a bunch of (X)HTML pages show up AS WELL AS a bunch of Flash files. There&#8217;s no way for you to dictate which page Google puts at the top of the list, so you could have people clicking through to Flash files that you don&#8217;t want.</p>
<p>So what do we do? Well, for my two cents I think we should still build sites using the <a href="http://www.thecosmonaut.com/2008/11/09/5-steps-for-building-a-seo-friendly-flash-site-using-swfobject-and-swfaddress/">original method for building SEO-friendly websites</a>. While it you may get multiple results, I think that the benefits outweigh the negatives. Here&#8217;s why:</p>
<ul>
<li><strong>Not all search engines can index Flash,</strong> so the other search engines will index your (X)HTML content and serve up the intended pages as you intended.</li>
<li><strong>Google still indexes the (X)HTML pages</strong>. Since most (X)HTML pages will be more SEO friendly than the Flash, chances are that the (X)HTML pages will be ranked higher in the results, and since people are more inclined to click higher results, chances are you&#8217;ll still get the intended results. I know that &#8220;chances are&#8221; is contrary to most practices in SEO, but it&#8217;s the best we&#8217;ve got at this juncture</li>
<li><strong>It&#8217;s the only option we&#8217;ve got</strong>. Googlebot is indexing Flash now, whether we like it or not. Given that Googlebot&#8217;s ability to index Flash files is not as good as its ability to index (X)HTML files, the only option I can think of to help people find the content they&#8217;re looking for is to make sure that we&#8217;ve got (X)HTML content that WILL be correctly indexed (alongside the Flash that WON&#8217;T).</li>
</ul>
<p>I sincerely hope that Googlebot&#8217;s ability to index Flash sites will continue to get better so that we can simply build Flash sites as Flash sites. I also hope that the entire Flash community continues to do research and testing to help this process. I recognize that the process that I endorse carries with it some problems and I welcome suggestions for better ways to optimize Flash for search engines. But from my current vantage point, this looks like the best way to do it to me.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thecosmonaut.com/2008/10/17/flash-indexing-on-google-revisited/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Flash 9 Policy Files, or &#8220;How I Got Rid of That Damn Error #2048!&#8221;</title>
		<link>http://www.thecosmonaut.com/2008/08/28/flash-9-policy-files/</link>
		<comments>http://www.thecosmonaut.com/2008/08/28/flash-9-policy-files/#comments</comments>
		<pubDate>Thu, 28 Aug 2008 22:06:16 +0000</pubDate>
		<dc:creator>Eric Oliver</dc:creator>
				<category><![CDATA[Flash Studio]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://www.thecosmonaut.com/?p=47</guid>
		<description><![CDATA[Find out how I banished Error #2048 forever, without having to resort to violence!]]></description>
			<content:encoded><![CDATA[<p>I ran into a very interesting Flash issue. I had a Flash form that was being hosted on Server A. It was submitting data to a PHP file on Server B, then receiving the results from that PHP file (whether the form was processed correctly). Server B had a crossdomain xml file set up, and I had my security permissions properly set up, but I kept getting a security error (Error #2048) no matter what I did. Needless to say, this was making me want to play with large-calibur weapons.</p>
<p>The solution lay in <a href="http://www.adobe.com/devnet/flashplayer/articles/fplayer9_security.html" target="_blank">this well-hidden article</a> on Adobe&#8217;s site. In essence, the article states that they&#8217;ve made Flash&#8217;s security settings even more strict, and that means that in some situations, you need to change things around in order to make sure that Flash will accept your policy file. I set my computer up with <a title="Download Flash Debugger Version" href="http://www.adobe.com/support/flashplayer/downloads.html" target="_blank">Flash 9 debugger version</a>, <a title="Learn how to set up your computer to log policy errors" href="http://www.adobe.com/devnet/flashplayer/articles/fplayer9_security_05.html" target="_blank">set it up to log policy errors</a>, and then looked at my policy file log which revealed the problem: Server B was returning the crossdomain xml file as Content-Type &#8220;application/x-httpd-php5-source&#8221;. With Flash 9&#8242;s newer, stricter settings, Flash 9 will only accept policy files of the following content-types:</p>
<ol>
<li>text/* (any text type)</li>
<li>application/xml or application/xhtml+xml</li>
</ol>
<p>As soon as we changed the crossdomain&#8217;s content-type, the Error #2048 went away and the form processed correctly!</p>
<p>So the upshot is that if you&#8217;re getting Error #2048 notices and you can&#8217;t get them to go away no matter what you try, follow the steps outlined on <a title="Learn how to set up your computer to log policy errors" href="http://www.adobe.com/devnet/flashplayer/articles/fplayer9_security_05.html" target="_blank">this page at Adobe</a>. Once you&#8217;ve set your computer up to debug and log your policy files, you&#8217;ll be able to check and see if a policy file content-type problem is causing your troubles.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thecosmonaut.com/2008/08/28/flash-9-policy-files/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Snowflake Modification Tutorial</title>
		<link>http://www.thecosmonaut.com/2008/07/31/snowflake-modification-tutorial/</link>
		<comments>http://www.thecosmonaut.com/2008/07/31/snowflake-modification-tutorial/#comments</comments>
		<pubDate>Fri, 01 Aug 2008 00:07:57 +0000</pubDate>
		<dc:creator>Eric Oliver</dc:creator>
				<category><![CDATA[Flash Studio]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://www.thecosmonaut.com/?p=31</guid>
		<description><![CDATA[Tutorial outlining how to have a snow storm contract in on the user's mouse when clicked, then expand back out when clicked again.]]></description>
			<content:encoded><![CDATA[<p>While helping out on the forums at <a href="http://board.flashkit.com/board/forumdisplay.php?f=2" target="_blank">FlashKit</a>, I came across this post:</p>
<blockquote><p>Hello,<br />
We have a project that requires free falling snow flakes. When the cursor enters the stage we need the flakes to &#8216;rush&#8217; toward the pointer and follow it. When the cursor leaves the stage the flakes drift away and down.</p>
<p>Can anyone point me toward an FLA or tutorial?</p>
<p>Many thanks</p></blockquote>
<p>Well, for some reason I got all obsessed with this question and I wrote the following tutorial:<br />
I did a rough version that emulates this effect. You can probably fine-tune it to be nicer, but this will get you started. Here&#8217;s what you need to do:</p>
<p><strong>1.</strong> You need some sort of snowflake effect. Rather than start from scratch, you can download one. I downloaded the SnowFlakes class from Pixelfumes: <a href="http://pixelfumes.blogspot.com/2006/11/actionscript-3-snow-storm-class.html">http://pixelfumes.blogspot.com/2006/11/actionscript-3-snow-storm-class.html</a> and I&#8217;m using the snowFlake.fla for the example (which you can also download from that link).</p>
<p><strong>2.</strong> This class now needs to be modified to do what you were talking about. So first step is to make it so that the movie can register clicks. I created an invisible button called btnClick that was 450 x 450 (covering the whole movie).</p>
<p><strong>3.</strong> We want to make sure that the snowflakes are underneath the button, or the user&#8217;s click won&#8217;t be registered. So in the actions frame of snowFlake.fla, I changed the createFlakes function to:</p>
<p><pre><pre>
[[code]]czoxMDY6XCJmdW5jdGlvbiBjcmVhdGVGbGFrZXMoKTp2b2lkew0KICAgICB2YXIgc0ZsYWtlOlNub3dGbGFrZSA9IG5ldyBTbm93Rmx7WyYqJl19YWtlKCk7DQogICAgIGFkZENoaWxkQXQoc0ZsYWtlLDApOw0KfVwiO3tbJiomXX0=[[/code]]
</pre></pre></p>
<p>This adds the new snowflake underneath everything else.</p>
<p><strong>4.</strong> Now we want to have something happen when the user clicks on the movie. So we add the following code:<br />
<pre><pre>
[[code]]czo1ODpcImJ0bkNsaWNrLmFkZEV2ZW50TGlzdGVuZXIoTW91c2VFdmVudC5DTElDSywgdG9nZ2xlRmxha2VzKTtcIjt7WyYqJl19[[/code]]
</pre></pre></p>
<p><strong>5.</strong> The toggleFlakes function needs to do a couple of things. First, check to see if it&#8217;s snowing. Then, if it IS snowing, it needs to stop snowing and have all the snowflakes go to the mouse. If it&#8217;s NOT snowing, it needs to have all the snowflakes go away from the mouse and start moving again. To do this, I added the following code:</p>
<p><pre><pre>
[[code]]czozNjk6XCJ2YXIgaXNTbm93aW5nOkJvb2xlYW4gPSB0cnVlOw0KZnVuY3Rpb24gdG9nZ2xlRmxha2VzKGU6RXZlbnQpOnZvaWQgew17WyYqJl19CiAgICAgaWYgKGlzU25vd2luZykgew0KICAgICAgICAgIHN0b3BGbGFrZXMoKTsNCiAgICAgICAgICBpc1Nub3dpbmcgPSBmYWxzZXtbJiomXX07DQogICAgIH0gZWxzZSB7DQogICAgICAgICAgc3RhcnRGbGFrZXMoKTsNCiAgICAgICAgICBpc1Nub3dpbmcgPSB0cnVlOw0KICAge1smKiZdfSAgfQ0KfQ0KDQpmdW5jdGlvbiBzdG9wRmxha2VzKCk6dm9pZCB7DQogICAgIHRyYWNlKFwic3RvcEZsYWtlcyBjbGlja2VkXCIpOw0KfXtbJiomXX0NCg0KZnVuY3Rpb24gc3RhcnRGbGFrZXMoKTp2b2lkIHsNCiAgICAgdHJhY2UoXCJzdGFydEZsYWtlcyBjbGlja2VkXCIpOw0KfVwiO3tbJiomXX0=[[/code]]
</pre></pre><br />
For now, the stop flakes and start flakes functions are not defined &#8212; we&#8217;ll get to that in a second.</p>
<p><strong>6.</strong> So now we know we need to stop the flakes somehow&#8230; enter the stopFlakes function. Without identifying what that function IS, just yet, let&#8217;s assume that it will be a function that we&#8217;ll add to the SnowFlake class that will stop an instance of the snowflake from animating and cause it to move to the mouse. If we&#8217;re going to do it that way, we should create an array which will store references to all the snowflakes so we can trigger them at will. We do this by adding the following code:</p>
<p><pre><pre>
[[code]]czozNTpcInZhciBmbGFrZUFycmF5OkFycmF5ID0gbmV3IEFycmF5KCk7XCI7e1smKiZdfQ==[[/code]]
</pre></pre></p>
<p>And by modifying the createFlakes function to be:</p>
<p><pre><pre>
[[code]]czoxMzc6XCJmdW5jdGlvbiBjcmVhdGVGbGFrZXMoKTp2b2lkew0KICAgICB2YXIgc0ZsYWtlOlNub3dGbGFrZSA9IG5ldyBTbm93Rmx7WyYqJl19YWtlKCk7DQogICAgIGFkZENoaWxkQXQoc0ZsYWtlLDApOw0KICAgICBmbGFrZUFycmF5LnB1c2goc0ZsYWtlKTsNCn1cIjt7WyYqJl19[[/code]]
</pre></pre></p>
<p>Now we can reference all the created snowflakes, let&#8217;s make it so that by running stopFlakes, you run &#8220;gotoMouse&#8221; on all the flake instances:</p>
<p><pre><pre>
[[code]]czoxNTQ6XCJmdW5jdGlvbiBzdG9wRmxha2VzKCk6dm9pZCB7DQogICAgIHRyYWNlKFwic3RvcEZsYWtlcyBjbGlja2VkXCIpOw0KICAgIHtbJiomXX0gZm9yICh2YXIgaTppbnQ7IGk8bnVtRmxha2VzOyBpKyspIHsNCiAgICAgICAgICBmbGFrZUFycmF5W2ldLmdvdG9Nb3VzZSgpOw0Ke1smKiZdfSAgICAgfQ0KfVwiO3tbJiomXX0=[[/code]]
</pre></pre></p>
<p><strong>7.</strong> Now we&#8217;ll need to start the flakes once again&#8230; so this is the startFlakes function. Let&#8217;s assume the function we&#8217;ll build in the SnowFlake class is called &#8220;restoreFlakes&#8221;. So our startFlakes function becomes:</p>
<p><pre><pre>
[[code]]czoxNjA6XCJmdW5jdGlvbiBzdGFydEZsYWtlcygpOnZvaWQgew0KICAgICB0cmFjZShcInN0YXJ0Rmxha2VzIGNsaWNrZWRcIik7DQogIHtbJiomXX0gICBmb3IgKHZhciBpOmludDsgaTxudW1GbGFrZXM7IGkrKykgew0KICAgICAgICAgIGZsYWtlQXJyYXlbaV0ucmVzdG9yZUZsYWtle1smKiZdfXMoKTsNCiAgICAgfQ0KfVwiO3tbJiomXX0=[[/code]]
</pre></pre></p>
<p><strong>8.</strong> OK &#8212; now we&#8217;re ready to start editing the SnowFlakes class and add the real functions. First let&#8217;s do &#8220;gotoMouse&#8221;. Open up the SnowFlake class. Let&#8217;s think about what the gotoMouse function needs to be and needs to do:<br />
* It needs to be referenced by things OUTSIDE of the class<br />
* It needs to stop the snowflake from moving<br />
* It needs to move the snowflake to the mouse position</p>
<p><strong>9.</strong> The first task: It needs to be referenced by things OUTSIDE of the class. This means it needs to be a public function, so add this to the class:</p>
<p><pre><pre>
[[code]]czozNjpcInB1YmxpYyBmdW5jdGlvbiBnb3RvTW91c2UoKTp2b2lkew0KfVwiO3tbJiomXX0=[[/code]]
</pre></pre></p>
<p><strong>10.</strong> The second task: It needs to stop the snowflake from moving. OK, well if we look at the class, we can see that the following code is causing the snowflake to move:</p>
<p><pre><pre>
[[code]]czo5MzpcInByaXZhdGUgZnVuY3Rpb24gbW92ZU1lKCk6dm9pZHsNCiAgICAgdGhpcy5hZGRFdmVudExpc3RlbmVyKEV2ZW50LkVOVEV7WyYqJl19Ul9GUkFNRSxldmVyeUZyYW1lKTsNCn1cIjt7WyYqJl19[[/code]]
</pre></pre></p>
<p>Easy enough to counter:</p>
<p><pre><pre>
[[code]]czo5OTpcInB1YmxpYyBmdW5jdGlvbiBnb3RvTW91c2UoKTp2b2lkew0KICAgICB0aGlzLnJlbW92ZUV2ZW50TGlzdGVuZXIoRXZlbnR7WyYqJl19LkVOVEVSX0ZSQU1FLCBldmVyeUZyYW1lKTsNCn1cIjt7WyYqJl19[[/code]]
</pre></pre></p>
<p><strong>11.</strong> The third task: it needs to move the snowflake to the mouse position. We&#8217;re dealing with movement, so I personally always use Tweener to handle movement (<a href="http://code.google.com/p/tweener/">http://code.google.com/p/tweener/</a>). Download Tweener, put it in the same folder as the FLA, and add the following import command to the top of the class with all the other imports:</p>
<p><pre><pre>
[[code]]czozNTpcImltcG9ydCBjYXVyaW5hLnRyYW5zaXRpb25zLlR3ZWVuZXI7XCI7e1smKiZdfQ==[[/code]]
</pre></pre></p>
<p>We also need to move it to the mouse position, so let&#8217;s pass the mouse position from the original call to this function. So the call in the snowFlake.fla becomes:</p>
<p><pre><pre>
[[code]]czoxNjc6XCJmdW5jdGlvbiBzdG9wRmxha2VzKCk6dm9pZCB7DQogICAgIHRyYWNlKFwic3RvcEZsYWtlcyBjbGlja2VkXCIpOw0KICAgIHtbJiomXX0gZm9yICh2YXIgaTppbnQ7IGk8bnVtRmxha2VzOyBpKyspIHsNCiAgICAgICAgICBmbGFrZUFycmF5W2ldLmdvdG9Nb3VzZShtb3Vze1smKiZdfWVYLG1vdXNlWSk7DQogICAgIH0NCn1cIjt7WyYqJl19[[/code]]
</pre></pre><br />
and our gotoMouse function becomes:</p>
<p><pre><pre>
[[code]]czoxMjM6XCJwdWJsaWMgZnVuY3Rpb24gZ290b01vdXNlKHhQb3M6TnVtYmVyLCB5UG9zOk51bWJlcik6dm9pZHsNCiAgICAgdGhpcy57WyYqJl19cmVtb3ZlRXZlbnRMaXN0ZW5lcihFdmVudC5FTlRFUl9GUkFNRSwgZXZlcnlGcmFtZSk7DQp9XCI7e1smKiZdfQ==[[/code]]
</pre></pre></p>
<p>Now we need to add the tween, so add the Tweener code and the function becomes:</p>
<p><pre><pre>
[[code]]czoyMDc6XCJwdWJsaWMgZnVuY3Rpb24gZ290b01vdXNlKHhQb3M6TnVtYmVyLCB5UG9zOk51bWJlcik6dm9pZHsNCiAgICAgdGhpcy57WyYqJl19cmVtb3ZlRXZlbnRMaXN0ZW5lcihFdmVudC5FTlRFUl9GUkFNRSwgZXZlcnlGcmFtZSk7DQogICAgIFR3ZWVuZXIuYWRkVHdlZW4odHtbJiomXX1oaXMsIHt4OnhQb3MsIHk6eVBvcywgdGltZTowLjUsIHRyYW5zaXRpb246XCJlYXNlT3V0U2luZVwifSk7DQp9XCI7e1smKiZdfQ==[[/code]]
</pre></pre></p>
<p><strong>12.</strong> OK, now we need to create the function that will start the flakes once again. We&#8217;re calling this restoreFlakes. What does it need to do?<br />
* It needs to be referenced by things OUTSIDE of the class<br />
* It needs to move the snowflake back to its original position<br />
* It needs to start the snowflakes moving again.</p>
<p><strong>13.</strong> The first task is easy &#8212; it needs to be a public function:</p>
<p><pre><pre>
[[code]]czo0MDpcInB1YmxpYyBmdW5jdGlvbiByZXN0b3JlRmxha2VzKCk6dm9pZHsNCn1cIjt7WyYqJl19[[/code]]
</pre></pre></p>
<p><strong>14.</strong> The second task &#8212; move back to the original position. This means we need to track where the snowflake was when it got paused, so we need to modify the gotoMouse function to record where the snowflakes were. To do this we add the following variables to the class:</p>
<p><pre><pre>
[[code]]czo2MDpcInByaXZhdGUgdmFyIHRoaXNYOk51bWJlciA9IDA7DQpwcml2YXRlIHZhciB0aGlzWTpOdW1iZXIgPSAwO1wiO3tbJiomXX0=[[/code]]
</pre></pre></p>
<p>We then modify the gotoMouse function:</p>
<p><pre><pre>
[[code]]czoyNTE6XCJwdWJsaWMgZnVuY3Rpb24gZ290b01vdXNlKHhQb3M6TnVtYmVyLCB5UG9zOk51bWJlcik6dm9pZHsNCiAgICAgdGhpcy57WyYqJl19cmVtb3ZlRXZlbnRMaXN0ZW5lcihFdmVudC5FTlRFUl9GUkFNRSwgZXZlcnlGcmFtZSk7DQogICAgIHRoaXNYID0gdGhpcy54Ow0KIHtbJiomXX0gICAgdGhpc1kgPSB0aGlzLnk7DQogICAgIFR3ZWVuZXIuYWRkVHdlZW4odGhpcywge3g6eFBvcywgeTp5UG9zLCB0aW1lOjAuNSwge1smKiZdfXRyYW5zaXRpb246XCJlYXNlT3V0U2luZVwifSk7DQp9XCI7e1smKiZdfQ==[[/code]]
</pre></pre></p>
<p>Then we modify the restoreFlakes function to move the snowflakes back:</p>
<p><pre><pre>
[[code]]czoxMjY6XCJwdWJsaWMgZnVuY3Rpb24gcmVzdG9yZUZsYWtlcygpOnZvaWR7DQogICAgIFR3ZWVuZXIuYWRkVHdlZW4odGhpcywge3h7WyYqJl19OnRoaXNYLCB5OnRoaXNZLCB0aW1lOjAuNSwgdHJhbnNpdGlvbjpcImVhc2VPdXRTaW5lXCJ9KTsNCn1cIjt7WyYqJl19[[/code]]
</pre></pre></p>
<p><strong>15.</strong> The third task &#8212; make them start moving. Well, just add the listener back in and the function becomes</p>
<p><pre><pre>
[[code]]czoxODY6XCJwdWJsaWMgZnVuY3Rpb24gcmVzdG9yZUZsYWtlcygpOnZvaWR7DQogICAgIFR3ZWVuZXIuYWRkVHdlZW4odGhpcywge3h7WyYqJl19OnRoaXNYLCB5OnRoaXNZLCB0aW1lOjAuNSwgdHJhbnNpdGlvbjpcImVhc2VPdXRTaW5lXCJ9KTsNCiAgICAgdGhpcy5hZGRFdmVudExpe1smKiZdfXN0ZW5lcihFdmVudC5FTlRFUl9GUkFNRSwgZXZlcnlGcmFtZSk7DQp9XCI7e1smKiZdfQ==[[/code]]
</pre></pre></p>
<p>Now we&#8217;re done! The revised SnowFlake class becomes this:</p>
<p><pre><pre>
[[code]]czoyNTkwOlwicGFja2FnZSB7DQoNCiAgICAgaW1wb3J0IGZsYXNoLmRpc3BsYXkuTW92aWVDbGlwOw0KICAgICBpbXBvcnQgZmxhc2h7WyYqJl19LmV2ZW50cy4qOw0KICAgICBpbXBvcnQgZmxhc2guZmlsdGVycy5CbHVyRmlsdGVyOw0KICAgICBpbXBvcnQgY2F1cmluYS50cmFuc3tbJiomXX1pdGlvbnMuVHdlZW5lcjsNCg0KICAgICBwdWJsaWMgY2xhc3MgU25vd0ZsYWtlIGV4dGVuZHMgTW92aWVDbGlwew0KDQogICAgICAge1smKiZdfSAgIHByaXZhdGUgdmFyIHNwZWVkTXVsdGlwbGllcjppbnQgPSA1Ow0KICAgICAgICAgIHByaXZhdGUgdmFyIHNwZWVkVmFyaU11bHR7WyYqJl19aXBsaWVyOmludCA9IDEwOw0KICAgICANCiAgICAgICAgICBwcml2YXRlIHZhciBzcGVlZDp1aW50ID0gTWF0aC5yYW5kb20oKSpzcHtbJiomXX1lZWRNdWx0aXBsaWVyOw0KICAgICAgICAgIHByaXZhdGUgdmFyIHNwZWVkVmFyaWF0aW9uID0gTWF0aC5yYW5kb20oKSpzcGVlZFZhe1smKiZdfXJpTXVsdGlwbGllcisxOw0KDQogICAgICAgICAgcHJpdmF0ZSB2YXIgdmlld1dpZHRoOmludCA9IDQ1MDsNCiAgICAgICAgICBwcml7WyYqJl19dmF0ZSB2YXIgdmlld0hlaWdodDppbnQgPSA0NTA7DQoNCiAgICAgICAgICBwcml2YXRlIHZhciB0aGlzWDpOdW1iZXIgPSAwOw0KIHtbJiomXX0gICAgICAgICBwcml2YXRlIHZhciB0aGlzWTpOdW1iZXIgPSAwOw0KDQogICAgICAgICAgcHJpdmF0ZSB2YXIgZHJpZnQ6aW50Ow0Ke1smKiZdfQ0KICAgICAgICAgIGZ1bmN0aW9uIFNub3dGbGFrZSgpew0KICAgICAgICAgICAgICAgc2V0U3BlZWQoc3BlZWQpOw0KICAgICAgICB7WyYqJl19ICAgICAgIHJlYWR5Rmxha2UoKTsNCiAgICAgICAgICAgICAgIG1vdmVNZSgpOw0KICAgICAgICAgIH0NCg0KICAgICAgICAgIHByaXtbJiomXX12YXRlIGZ1bmN0aW9uIHNldFNwZWVkKG46dWludCk6dm9pZHsNCiAgICAgICAgICAgICAgIHRoaXMuc3BlZWQgPSAobiAqIHNwZWVke1smKiZdfVZhcmlhdGlvbikrMTsNCiAgICAgICAgICB9DQoNCiAgICAgICAgICBwcml2YXRlIGZ1bmN0aW9uIHJlYWR5Rmxha2UoKTp2b2lkew17WyYqJl19CiAgICAgICAgICAgICAgIGdldERyaWZ0KCk7DQogICAgICAgICAgICAgICB0aGlzLnkgPSBNYXRoLnJhbmRvbSgpKnZpZXdIZWlnaHtbJiomXX10Ki0xOw0KICAgICAgICAgICAgICAgdGhpcy54ID0gTWF0aC5yYW5kb20oKSp2aWV3V2lkdGg7DQogICAgICAgICAgDQogICAgICAge1smKiZdfSAgICAgICAgdmFyIGJmOkJsdXJGaWx0ZXIgPSBuZXcgQmx1ckZpbHRlcihkcmlmdCoyLHNwZWVkLzIsMik7DQogICAgICAgICAgICB7WyYqJl19ICAgdGhpcy5maWx0ZXJzID0gW2JmXTsNCg0KICAgICAgICAgICAgICAgaWYoc3BlZWQvMiAmbHQ7IHNwZWVkVmFyaWF0aW9uKXsNCntbJiomXX0gICAgICAgICAgICAgICAgICAgIHRoaXMuc2NhbGVYID0gdGhpcy5zY2FsZVkgPSAuNTsNCiAgICAgICAgICAgICAgIH0NCg0KICAge1smKiZdfSAgICAgICB9DQoNCiAgICAgICAgICBwcml2YXRlIGZ1bmN0aW9uIGdldERyaWZ0KCk6dm9pZHsNCiAgICAgICAgICAgICAgIGRyaWZ7WyYqJl19dCA9IE1hdGgucmFuZG9tKCkqMzsNCiAgICAgICAgICAgICAgIHZhciBkcmlmdERpcmVjdGlvbjppbnQgPSBNYXRoLnJhbmRvbSgpKntbJiomXX0xMDsNCiAgICAgICAgICAgICAgIGlmKGRyaWZ0RGlyZWN0aW9uICZsdDsgNSl7DQogICAgICAgICAgICAgICAgICAgIGRyaWZ0ICo9e1smKiZdfSAtMTsNCiAgICAgICAgICAgICAgIH0NCg0KICAgICAgICAgIH0NCg0KICAgICAgICAgIHByaXZhdGUgZnVuY3Rpb24gbW92ZU1lKCl7WyYqJl19OnZvaWR7DQogICAgICAgICAgICAgICB0aGlzLmFkZEV2ZW50TGlzdGVuZXIoRXZlbnQuRU5URVJfRlJBTUUsZXZlcnlGcmFtZSk7DXtbJiomXX0KICAgICAgICAgIH0NCg0KICAgICAgICAgIHByaXZhdGUgZnVuY3Rpb24gZXZlcnlGcmFtZShlOkV2ZW50KTp2b2lkew0KICAgICAge1smKiZdfSAgICAgICAgIHRoaXMueSArPSBzcGVlZDsNCiAgICAgICAgICAgICAgIHRoaXMueCArPSBkcmlmdDsNCiAgICAgICAgICAgICAgIGl7WyYqJl19Zih0aGlzLnkgJmd0OyB2aWV3SGVpZ2h0IHx8IHRoaXMueCAmbHQ7IDAgfHwgdGhpcy54ICZndDsgdmlld1dpZHRoKXsNCiAgICAgIHtbJiomXX0gICAgICAgICAgICAgIHJlYWR5Rmxha2UoKTsNCiAgICAgICAgICAgICAgIH0NCg0KICAgICAgICAgIH0NCg0KICAgICAgICAgIHB1e1smKiZdfWJsaWMgZnVuY3Rpb24gZ290b01vdXNlKHhQb3M6TnVtYmVyLCB5UG9zOk51bWJlcik6dm9pZHsNCiAgICAgICAgICAgICAgIHRoaXN7WyYqJl19LnJlbW92ZUV2ZW50TGlzdGVuZXIoRXZlbnQuRU5URVJfRlJBTUUsIGV2ZXJ5RnJhbWUpOw0KICAgICAgICAgICAgICAgdGhpc1ggPXtbJiomXX0gdGhpcy54Ow0KICAgICAgICAgICAgICAgdGhpc1kgPSB0aGlzLnk7DQogICAgICAgICAgICAgICBUd2VlbmVyLmFkZFR3ZWVuKHRoe1smKiZdfWlzLCB7eDp4UG9zLCB5OnlQb3MsIHRpbWU6MC41LCB0cmFuc2l0aW9uOlwiZWFzZU91dFNpbmVcIn0pOw0KICAgICAgICAgIH0NCg0KIHtbJiomXX0gICAgICAgICBwdWJsaWMgZnVuY3Rpb24gcmVzdG9yZUZsYWtlcygpOnZvaWR7DQogICAgICAgICAgICAgICBUd2VlbmVyLmFkZFR3e1smKiZdfWVlbih0aGlzLCB7eDp0aGlzWCwgeTp0aGlzWSwgdGltZTowLjUsIHRyYW5zaXRpb246XCJlYXNlT3V0U2luZVwifSk7DQogICAgICAgIHtbJiomXX0gICAgICAgdGhpcy5hZGRFdmVudExpc3RlbmVyKEV2ZW50LkVOVEVSX0ZSQU1FLCBldmVyeUZyYW1lKTsNCiAgICAgICAgICB9DQoNe1smKiZdfQogICAgIH0NCg0KfQ0KXCI7e1smKiZdfQ==[[/code]]
</pre></pre><br />
The code on the main timeline becomes this:</p>
<p><pre><pre>
[[code]]czo4Nzc6XCJ2YXIgZmxha2VBcnJheTpBcnJheSA9IG5ldyBBcnJheSgpOw0KdmFyIGlzU25vd2luZzpCb29sZWFuID0gdHJ1ZTsNCg17WyYqJl19CmZ1bmN0aW9uIGNyZWF0ZUZsYWtlcygpOnZvaWR7DQogICAgIHZhciBzRmxha2U6U25vd0ZsYWtlID0gbmV3IFNub3dGbGFrZSgpO3tbJiomXX0NCiAgICAgYWRkQ2hpbGRBdChzRmxha2UsMCk7DQogICAgIGZsYWtlQXJyYXkucHVzaChzRmxha2UpOw0KfQ0KDQp2YXIgbnVtRmxhe1smKiZdfWtlczppbnQgPSAxMDAwOw0KDQpmb3IodmFyIGk6aW50O2kNCiAgICAgY3JlYXRlRmxha2VzKCk7DQp9DQoNCmJ0bkNsaWNrLmFkZEV7WyYqJl19dmVudExpc3RlbmVyKE1vdXNlRXZlbnQuQ0xJQ0ssIHRvZ2dsZUZsYWtlcyk7DQoNCmZ1bmN0aW9uIHRvZ2dsZUZsYWtlcyhlOkV2ZXtbJiomXX1udCk6dm9pZCB7DQogICAgIGlmIChpc1Nub3dpbmcpIHsNCiAgICAgICAgICBzdG9wRmxha2VzKCk7DQogICAgICAgICAgaXNTbm93e1smKiZdfWluZyA9IGZhbHNlOw0KICAgICB9IGVsc2Ugew0KICAgICAgICAgIHN0YXJ0Rmxha2VzKCk7DQogICAgICAgICAgaXNTbm93aW5nID17WyYqJl19IHRydWU7DQogICAgIH0NCn0NCg0KZnVuY3Rpb24gc3RvcEZsYWtlcygpOnZvaWQgew0KICAgICB0cmFjZShcInN0b3BGbGFrZXMgY2x7WyYqJl19aWNrZWRcIik7DQogICAgIGZvciAodmFyIGk6aW50OyBpPG51bUZsYWtlczsgaSsrKSB7DQogICAgICAgICAgZmxha2VBcnJheVtpXS57WyYqJl19Z290b01vdXNlKG1vdXNlWCxtb3VzZVkpOw0KICAgICB9DQp9DQoNCmZ1bmN0aW9uIHN0YXJ0Rmxha2VzKCk6dm9pZCB7DQogICAgIHtbJiomXX10cmFjZShcInN0YXJ0Rmxha2VzIGNsaWNrZWRcIik7DQogICAgIGZvciAodmFyIGk6aW50OyBpPG51bUZsYWtlczsgaSsrKSB7DQogICB7WyYqJl19ICAgICAgIGZsYWtlQXJyYXlbaV0ucmVzdG9yZUZsYWtlcygpOw0KICAgICB9DQp9XCI7e1smKiZdfQ==[[/code]]
</pre></pre><br />
And you&#8217;re good to go! Here&#8217;s what it should look like (click on it in order to contract/expand the snowflakes):</p>

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_snowFlake_1122127730"
			class="flashmovie"
			width="450"
			height="450">
	<param name="movie" value="http://www.thecosmonaut.com/wp-content/uploads/2008/07/snowFlake.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://www.thecosmonaut.com/wp-content/uploads/2008/07/snowFlake.swf"
			name="fm_snowFlake_1122127730"
			width="450"
			height="450">
	<!--<![endif]-->
		
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<p>And you can download the source files here:<br />
<a href="http://www.thecosmonaut.com/wp-content/uploads/2008/07/snowflake.zip">snowflake.zip</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.thecosmonaut.com/2008/07/31/snowflake-modification-tutorial/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Now Indexing Flash &#8211; What&#8217;s New?</title>
		<link>http://www.thecosmonaut.com/2008/07/08/google-now-indexing-flash-whats-new/</link>
		<comments>http://www.thecosmonaut.com/2008/07/08/google-now-indexing-flash-whats-new/#comments</comments>
		<pubDate>Tue, 08 Jul 2008 19:08:20 +0000</pubDate>
		<dc:creator>Eric Oliver</dc:creator>
				<category><![CDATA[Flash Studio]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[search engine optimization]]></category>
		<category><![CDATA[SEO]]></category>

		<guid isPermaLink="false">http://www.thecosmonaut.com/?p=30</guid>
		<description><![CDATA[I&#8217;ve had many clients contact me about the recent announcement that Google is now indexing Flash (you can see Google&#8217;s announcement on its blog, see Google&#8217;s Webmaster Blog announcement, and Adobe&#8217;s official announcement). The overriding question is this: What does this mean for my Flash-based site? The short answer is: Not much. While it&#8217;s fantastic [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve had many clients contact me about the recent announcement that Google is now indexing Flash (you can see <a href="http://googleblog.blogspot.com/2008/06/google-learns-to-crawl-flash.html" target="_blank">Google&#8217;s announcement on its blog</a>, see <a href="http://googlewebmastercentral.blogspot.com/2008/06/improved-flash-indexing.html" target="_blank">Google&#8217;s Webmaster Blog announcement</a>, and <a href="http://www.adobe.com/aboutadobe/pressroom/pressreleases/200806/070108AdobeRichMediaSearch.html" target="_blank">Adobe&#8217;s official announcement</a>). The overriding question is this: What does this mean for my Flash-based site?</p>
<p>The short answer is: Not much. While it&#8217;s fantastic that Google is now able to read the text on Flash sites now, they face significant challenges in making sense of the text that they read. The reason is that Flash technology is much different from HTML pages in a couple of key areas:</p>
<ul>
<li><strong>Markup</strong>: HTML has tags which mark bits of text and code on the site. Google uses a variety of these tags in order to make sense of the page (what&#8217;s a link, what&#8217;s a title, what&#8217;s an important bit of text). Flash has no such markup &#8212; the code you use to register a &#8220;click&#8221; can vary widely from programmer to programmer. While it&#8217;s true that this code is eventually compiled into a movie that the Flash Player plays, there are still significant challenges in being able to interpret the text that lies within a Flash movie.</li>
<li><strong>Standardization</strong>: Flash code varies dramatically from developer to developer. For example, Flash designates certain movie clips as &#8220;buttons&#8221; but many developers (including myself) never actually use technical &#8220;buttons&#8221; because other movie clips offer much more flexible ways of animating and handling user interaction. As a result, code and the structural elements that make up a Flash site vary widely. In contrast, HTML and the manner in which pages are displayed is very standardized &#8212; there&#8217;s only one way to indicate that you&#8217;ve got a link. Even if you use a dynamic language like PHP, the PHP will eventually spit out HTML that is widely standardized. Granted, AJAX and use of JavaScript can yield less standardized results, but for most HTML sites, the code is much more standardized than Flash. The end result is that HTML offers Google a much more standard framework for interpreting the meaning of pages than Flash does.</li>
</ul>
<p>I&#8217;m sure that there are numerous other factors that go into it as well. As Google themselves point out, there are additional things which present problems for interpreting Flash content:</p>
<ul>
<li><strong>Images (and video):</strong> Google points out that they are not able to index images that feature text or any video that features text. Nor do they mention way to tag images and/or video in order to make it even partially visible (like you could with the &#8220;alt&#8221; attribute in HTML).</li>
<li><strong>Potential problems with javascript:</strong> Google does not execute some types of JavaScript and therefore won&#8217;t be able to read some Flash files which are embedded via JavaScript. Since pretty much every developer worth his/her salt uses JavaScript to embed their Flash files, this could be a problem for sites.</li>
<li><strong>Externally-loaded content:</strong> Any content that is loaded by Flash (via XML or an additional SWF) will be considered a separate page. Depending on how your site is structured, this could present significant interpretation problems for Google.</li>
</ul>
<p>The reality of the situation is that since Google is now indexing Flash sites, the content it gets back could be even more confusing for Google and could adversely affect your search engine ranking (see<a href="http://www.johnon.com/580/seo-4-flash-websites.html" target="_blank"> John Andrews&#8217; blog entry</a> on why you might want to block Flash from search engines).</p>
<p>In my opinion, all this boils down to the following strategy: watch and wait. No doubt standards for search engine optimization inside Flash will begin to emerge as Flash developers start experimenting with code and SEO, as Google continues to tweak algorithms on their end, and as Adobe keeps working on its Searchable SWF API. Until solid standards start emerging, Flash should still be treated as a system which requires additional work and solid strategies in order to be properly optimized for search engines.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thecosmonaut.com/2008/07/08/google-now-indexing-flash-whats-new/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Experiment: Drip / Splatter Effect</title>
		<link>http://www.thecosmonaut.com/2008/06/15/drip-test/</link>
		<comments>http://www.thecosmonaut.com/2008/06/15/drip-test/#comments</comments>
		<pubDate>Mon, 16 Jun 2008 03:46:32 +0000</pubDate>
		<dc:creator>Eric Oliver</dc:creator>
				<category><![CDATA[Flash Studio]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[drip effect]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[paint splatter effect]]></category>

		<guid isPermaLink="false">http://s40441.gridserver.com/?p=27</guid>
		<description><![CDATA[AS3 Experiment Creating a Paint Drip / Splatter Effect.]]></description>
			<content:encoded><![CDATA[<p>This is a simple AS3 experiment creating a drip splatter effect which reveals text on a page.</p>
<div style="float:left; margin-right:20px; margin-top:15px;"><a href="http://www.thecosmonaut.com/wp-content/uploads/2008/06/drips/" target="_blank"><img class="alignnone size-medium wp-image-28 aligncenter" title="Drips" src="http://www.thecosmonaut.com/wp-content/uploads/2008/06/drips-300x177.jpg" alt="Click to view drip test" width="300" height="177" /></a></div>
<p>The idea here is to have mouse movement which creates drips or paint splatters which then reveals text on the page. The challenge is that if you&#8217;re dropping bitmaps onto the stage with each mouse movement, the SWF very quickly becomes overfull of bitmaps and your CPU will slow to a crawl. So I used the Flash bitmapData.draw method to basically take a &#8220;snapshot&#8221; of the drip layer after 10 bitmaps have been added and then toss the bitmaps after the snapshot has been taken. That way the flash doesn&#8217;t have to keep track of a huge number of bitmaps and the SWF takes it very easy on the CPU.</p>
<p>You can download the source files <a href="http://s40441.gridserver.com/wp-content/uploads/2008/06/drips/dripTest.zip">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thecosmonaut.com/2008/06/15/drip-test/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
