<?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>Monokai &#187; Flash developing</title>
	<atom:link href="http://www.monokai.nl/blog/category/flash-developing/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.monokai.nl/blog</link>
	<description>Graphics, music, photos, flash experiments</description>
	<lastBuildDate>Thu, 20 Aug 2009 08:53:41 +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>Monoslideshow Facebook app</title>
		<link>http://www.monokai.nl/blog/2009/08/20/monoslideshow-facebook-app/</link>
		<comments>http://www.monokai.nl/blog/2009/08/20/monoslideshow-facebook-app/#comments</comments>
		<pubDate>Thu, 20 Aug 2009 08:53:41 +0000</pubDate>
		<dc:creator>Wimer Hazenberg</dc:creator>
				<category><![CDATA[Flash developing]]></category>

		<guid isPermaLink="false">http://www.monokai.nl/blog/?p=40</guid>
		<description><![CDATA[Monoslideshow for Facebook has just been released:
apps.facebook.com/monoslideshow
You can use this app to display your photos in your profile page, either in the boxes tab (large), or in the wall tab (small). You can also choose to populate Monoslideshow with Flickr images from any Flickr feed.Â Best thing, it&#8217;s totally free for Facebook users!
]]></description>
			<content:encoded><![CDATA[<p>Monoslideshow for Facebook has just been released:</p>
<p><a href="http://apps.facebook.com/monoslideshow/">apps.facebook.com/monoslideshow</a></p>
<p>You can use this app to display your photos in your profile page, either in the boxes tab (large), or in the wall tab (small). You can also choose to populate Monoslideshow with Flickr images from any Flickr feed.Â Best thing, it&#8217;s totally free for Facebook users!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.monokai.nl/blog/2009/08/20/monoslideshow-facebook-app/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Monoslideshow 2.0 is out!</title>
		<link>http://www.monokai.nl/blog/2009/06/30/monoslideshow-20-is-out/</link>
		<comments>http://www.monokai.nl/blog/2009/06/30/monoslideshow-20-is-out/#comments</comments>
		<pubDate>Tue, 30 Jun 2009 15:10:29 +0000</pubDate>
		<dc:creator>Wimer Hazenberg</dc:creator>
				<category><![CDATA[Flash developing]]></category>

		<guid isPermaLink="false">http://www.monokai.nl/blog/?p=38</guid>
		<description><![CDATA[Monoslideshow 2.0 has just been released:

Monoslideshow is the ultra customizable Flash image viewer for your site. This new version has been completely rewritten and has a ton of new features and professional photo transitions. You can find the all new interactive demo right here:Â http://www.monoslideshow.com/demo
]]></description>
			<content:encoded><![CDATA[<p><a title="Monoslideshow 2.0" href="http://www.monoslideshow.com">Monoslideshow 2.0</a> has just been released:</p>
<p><a href="http://www.monoslideshow.com"><img class=" alignnone" title="Monoslideshow 2.0 website" src="/blog/wp-content/images/mss2.jpg" alt="Monoslideshow 2.0 website" width="450" height="450" /></a></p>
<p>Monoslideshow is the ultra customizable Flash image viewer for your site. This new version has been completely rewritten and has a ton of new features and professional photo transitions. You can find the all new interactive demo right here:Â <a href="http://www.monoslideshow.com/demo">http://www.monoslideshow.com/demo</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.monokai.nl/blog/2009/06/30/monoslideshow-20-is-out/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flash SEO: graceful degradation to add meaning and structure</title>
		<link>http://www.monokai.nl/blog/2008/10/20/flash-seo-graceful-degradation-to-add-meaning-and-structure/</link>
		<comments>http://www.monokai.nl/blog/2008/10/20/flash-seo-graceful-degradation-to-add-meaning-and-structure/#comments</comments>
		<pubDate>Mon, 20 Oct 2008 08:40:00 +0000</pubDate>
		<dc:creator>Wimer Hazenberg</dc:creator>
				<category><![CDATA[Flash developing]]></category>

		<guid isPermaLink="false">http://www.monokai.nl/blog/?p=19</guid>
		<description><![CDATA[Flash sites are traditionally less searchable by Google than plain HTML sites. Now that Google supports the indexing of Flash files, you might think that&#8217;s that. You just make your shiny site in Flash and never have to worry about being searchable. Still, something is missing: meaning and structure. Both of them are present in [...]]]></description>
			<content:encoded><![CDATA[<p>Flash sites are traditionally less searchable by Google than plain HTML sites. Now that Google supports the indexing of Flash files, you might think that&#8217;s that. You just make your shiny site in Flash and never have to worry about being searchable. Still, something is missing: meaning and structure. Both of them are present in regular HTML sites, but not in Flash. So, how exactly can we make Flash sites just as searchable as HTML sites?</p>
<p><span id="more-19"></span></p>
<h2>Structural information</h2>
<p>How does Google actually index Flash files? Inside a Flash .swf file, Google reads its text fields and follows its links, sure, but can Google add structural info to all this? Flash files normally contain text, but also layout instructions, effects, and other visuals. In other words, Flash files contain a mix of content and styling. This sounds like the old days, when you were used to wrap your &lt;html&gt; text in &lt;font&gt; tags.</p>
<p>With plain XHTML and CSS though, content and styling are separated. This has a couple of benefits, which we all know by now. Google can easily read the &#8220;raw source&#8221; of a web site, and the visitor sees a visually pleasing result of that same source. The CSS transforms the raw source of the XHTML, as it were, and is declared in a separate CSS file. What&#8217;s nice about this, is that Google doesn&#8217;t have to plough through lots of visual declarations like &lt;font&gt; tags or &lt;color&gt; tags, which don&#8217;t add any meaning to the content. What remains for Google are structural tags, like &lt;p&gt;&#8217;s for paragraphs, or &lt;h1&gt;&#8217;s for headers. Headers and paragraphs add meaning and structure to a site, and are relevant for your content to rank high on Google. For example, Google knows that if your header contains the word &#8220;cookies&#8221; and your paragraph contains the word &#8220;sugar&#8221;, that section would be about cookies, and sugar would be of less importance (it could be an ingredient). If both words were reversed, the section would say something about sugar, and cookies would be of less importance (cookies could be an example of things to make with sugar). If a Flash file contains these same words, Google doesn&#8217;t know which is more relevant, and thus isn&#8217;t able to add meaning or structure to your site.</p>
<p>Hold this in mind.</p>
<h2>Embedding Flash</h2>
<p>We now look at how Flash .swf files are embedded in HTML files. The recommended technique to load Flash files in a browser is to use a script, like&nbsp;<a href="http://code.google.com/p/swfobject/" target="_blank">SWFObject</a> for example. What it does is that it injects your Flash file in a specified &lt;div&gt; tag in your HTML source code. For example, if you have this &lt;div&gt; with id &#8220;flashContent&#8221; in your source:</p>
<pre class="code"><code>&lt;div id="flashContent"&gt;
&lt;p&gt;Please download Flash&lt;/p&gt;
&lt;/div&gt;
</code></pre>
<p>&#8230;this command will replace that with the flash file &#8220;yourFlashFile.swf&#8221;:</p>
<pre class="code"><code>&lt;script type="text/javascript"&gt;
swfobject.embedSWF("yourFlashFile.swf", "flashContent");
&lt;/script&gt;
</code></pre>
<p>This is a nice technique because it gracefully degrades. If no Flash Player is installed at the visitors computer, the message &#8220;Please download Flash&#8221; is displayed in the &lt;div&gt;. Otherwise, the message is replaced by the Flash content.</p>
<p>So, this is the recommended technique to embed Flash files. But what about searchability? Imagine that your Flash file contains lots of text, or maybe reads it content from an XML file. In theory, you could copy-paste the text from your Flash file into the &lt;div&gt; of your HTML file, and Google would have access to it. But this presents two problems. One, you have your content twice. That is twice the bytes, and it just doesn&#8217;t sound elegant. And two, you have to recreate the tags around your content, to add structure to the text. This is cumbersome.</p>
<h2>Use Flash like you use CSS</h2>
<p>So, what do we do? <strong>We turn things around</strong>. First we add content, then we style. Just like CSS on top of XHTML, we put Flash on top of XHTML. The concept is to see Flash as the little brother of CSS. Or actually, the more powerful one.</p>
<p>First, type your content in any editor, preferably without markup. Then copy-paste your text into a HTML file. Wrap &lt;h1&gt; header tags around your headers and wrap your paragraphs in &lt;p&gt; tags, etc. When done, you have your content structured in a HTML file, ready for Google to parse and index.</p>
<p>Now create your Flash file. And, instead of typing text in you text fields, you have to fire up your actionscript skills to populate your text fields with the content from your XHTML file. The key is to write a little XML loader, that loads the contents from your HTML page. Then use the built in E4X commands of Flash to select the content nodes of your XHTML page. Finally, you have to populate your text fields with the data from the XML nodes. Example:</p>
<pre class="code"><code>import flash.events.Event;
import flash.net.URLLoader;
import flash.net.URLRequest;

function load() {}
	XML.ignoreWhitespace = false;
	XML.prettyPrinting = false;
	var loader:URLLoader = new URLLoader();
	loader.addEventListener(Event.COMPLETE, onLoadComplete);
	loader.load(new URLRequest("index.html"));
}

function onLoadComplete(event:Event):void {
	var xml:XML = new XML(event.target.loader.data);
	trace(xml.body..h1.text()) // outputs all h1 tags;
}
</code></pre>
<p>Also, dispatchevent.org has some starting points:</p>
<p><a href="http://dispatchevent.org/roger/as3-e4x-rundown/">Actionscript 3 E4X rundown</a><br />
<a href="http://dispatchevent.org/roger/using-e4x-with-xhtml-watch-your-namespaces/">Using E4X with XHTML? Watch your namespaces!</a></p>
<p>Now you have your Flash file, completely separate from the actual content. The content is styled by Flash. Just like CSS does to XHTML content. Benefits: your content is easily updatable without having to enter the Flash IDE, and Google is happily indexing your content. As an added bonus, users without Flash still see the content of your site.&nbsp;You can even style your bare content with CSS, to be Ã¼bercompatible.&nbsp;So, in the end, it&#8217;s all about content, meaning and structure (and, of course, a little design sauce on top of that).</p>
<h2>Wrap up</h2>
<p>Advantages of this technique:</p>
<ul>
<li>Fully search engine optimized</li>
<li>Meaning and structure restored</li>
<li>Content is read once</li>
<li>Content is easily editable</li>
<li>Visitors without Flash and / or Javascript sill see content</li>
</ul>
<p>At our studio Booreiland, we created a site using this technique for Unga Toys, an Amsterdam based toy development studio:</p>
<p><a href="http://www.ungatoys.com"><img class="alignnone size-full wp-image-25" title="unga" src="http://www.monokai.nl/blog/wp-content/unga.jpg" alt="" width="450" height="300" /></a></p>
<p><a href="http://www.ungatoys.com">www.ungatoys.com</a></p>
<p>Also, we made our own site this way:</p>
<p><a href="http://www.booreiland.nl/"><img class="alignnone size-full wp-image-26" title="booreiland" src="http://www.monokai.nl/blog/wp-content/booreiland.jpg" alt="" width="450" height="300" /></a></p>
<p><a href="http://www.booreiland.nl">www.booreiland.nl</a></p>
<p>Go ahead, try to disable Flash or Javascript or view the source of the sites above. It&#8217;s an extremely robust technique. We&#8217;ll be using it as a&nbsp;standard for our <a title="Booreiland Quality Mark" href="http://www.booreiland.nl/quality">quality mark</a> from now on.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.monokai.nl/blog/2008/10/20/flash-seo-graceful-degradation-to-add-meaning-and-structure/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>FiTC Amsterdam 2008</title>
		<link>http://www.monokai.nl/blog/2008/02/26/fitc-amsterdam-2008/</link>
		<comments>http://www.monokai.nl/blog/2008/02/26/fitc-amsterdam-2008/#comments</comments>
		<pubDate>Tue, 26 Feb 2008 20:38:28 +0000</pubDate>
		<dc:creator>Wimer Hazenberg</dc:creator>
				<category><![CDATA[Flash developing]]></category>

		<guid isPermaLink="false">http://www.monokai.nl/blog/2008/02/26/fitc-amsterdam-2008/</guid>
		<description><![CDATA[Just came back from Flash In The Can 2008 in Amsterdam, a conference about all things Flash. This was the first FiTC held in Europe, and as all my Flash heroes from around the world were there, and as it&#8217;s literally a 10 minutes bike drive from my home to the conference, I had to [...]]]></description>
			<content:encoded><![CDATA[<p>Just came back from Flash In The Can 2008 in Amsterdam, a conference about all things Flash. This was the first FiTC held in Europe, and as all my Flash heroes from around the world were there, and as it&#8217;s literally a 10 minutes bike drive from my home to the conference, I had to go. The lectures were generally very inspiring and my hands itch to start coding the whole night. Let&#8217;s sum up my thoughts about the presentations I attended.</p>
<p><span id="more-16"></span><strong>Monday:</strong></p>
<p><em>Adobe Keynote</em>: Newsflash, Adobe released Air just 3 hours before. Some stuff about Flash9. Can&#8217;t blame them, but it was a bit of a promo-talk really though.</p>
<p><em><a href="http://aralbalkan.com/">Aral Balkan</a> &#8211; Beyond The Buttons</em>: I chose to attend this presentation as it shouldn&#8217;t only be about Flash, but more about the fun of creating things. Aral pointed out that Flash is merely a tool to realize your ideas. Flash shouldn&#8217;t limit your ideas. Turned out to be a fun and inspiring presentation, and Aral seems a very cheerful guy. I like how he thought out of the box.</p>
<p><em><a href="http://www.rblank.com/">R Blank</a> &#8211; Under the Hood, the Nuts and Bolts of Flash Video</em>: A bit of a dry presentation about Flash Video and how to load this into Flash projects. Codecs, file formats, streaming and the Flash Video component. He gave a clear overview of the things you have to have in mind when embedding video. So I did learn a few things, but it wasn&#8217;t that much fun.</p>
<p><em><a href="http://www.moock.org">Colin Moock</a> &#8211; Actionscript 4</em>: Quite hardcore and in-depth info about new coding shortcuts and new features of AS4. Not that shocking, but a few changes were nice to hear. At least, function overloading will be available in AS4. Colin seemed to me like a very serious guy, but throughout his presentation caught the eye of some of his friends and then smiled and said hello to them. I saw him smiling during the breaks as well, so I&#8217;m glad he generally doesn&#8217;t frown as much as during the talk.</p>
<p><em><a href="http://www.sebleedelisle.com/">Seb Lee-Delisle</a> &#8211; Kaboom! Flash Pyrotechnics:</em> Cheerful English guy talking about particle effects. Had much fun along the way. Showed some nice and simple tricks that inspired me to do it myself and build upon that. Will do <img src='http://www.monokai.nl/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><em><a href="http://www.red5server.com/">Chris Allen</a> &#8211; Building Red5 Applications</em>: Chose this to learn something about remote multi-user interaction, as I though this might come in handy some time. Maybe it was the subject itself, but I did think it was a bit boring. Also, Eclipse/Red5 crashed a few times, which was a bit annoying to constantly watch.</p>
<p><em><a href="http://www.joshuadavis.com/">Joshua Davis</a> &#8211; New Works</em>: To be honest, I didn&#8217;t think that much about Joshua (slick guy with his overly slick graphics). But I wanted to see for myself, as I&#8217;ve never seen the guy in person and didn&#8217;t really know his works. Turned out to be a very nice and inspiring presentation. And I actually liked his work and his process of creating it. He uses generative art, or programs to randomize and calculate the art automatically for him. Inspiring and something I wanted to do for a long time as well. Have some more ideas of how I should be doing that now.</p>
<p><strong>Tuesday:</strong></p>
<p><em><a href="http://www.newmovieclip.com/">Koen De Weggheleire</a>: Play with Pixels, Bitmap Manipulation with Flash</em>: This nice dude started the day with Matrix Math and convolution filters. Great to have these concepts refreshed, as I wasn&#8217;t really aware Flash could do all this. Got a few ideas from this presentation as well.</p>
<p><em><a href="http://www.levitated.net/">Jared Tarbell</a> &#8211; The Circle</em>: I was actually planning to see Branden Hall with his presentation about coding smarter, as to learn some new tricks, but at the last moment decided to go to Jared&#8217;s. And I was glad to. Jared is known for his generative art, like Joshua. So, I was expecting some coding examples on how to generate his art. That wasn&#8217;t what he did at all. Instead, he showed some examples of circles all around us and finally showcased some of his works. Other than Erik Natzke&#8217;s and Joshua Davis&#8217; complex art, his work almost has Zen-like qualities, while not necessarily based on less complex programs. Beautiful ways of mixing math, design and creativity. And very inspired by it.</p>
<p><em><a href="http://void.andre-michelle.com/">AndrÃ© Michelle</a> &#8211; Making Real Music Within Flash</em>: This crazy and laid back German dude was struggling to get his presentation running. But he showcased something that I thought was nearly impossible in Flash: Realtime audio generation, filtering, vocoding and synthesizing. I mean, a 303, 909 plus a load of effects in Flash? Insane. And it seemed the guy could code these things in a few days. Very inspiring to see how AndrÃ© pushes the boundaries of Flash to create things Flash isn&#8217;t even meant for.</p>
<p><em><a href="http://www.bigspaceship.com/">Joshua Hirsch</a> &#8211; Big Spaceship</em>: A little talk about the goings of running a design agency of 50 people. Nice to see how they take on projects and manage them. Big Spaceship is divided into a few production units, with each unit having its own project with its own developers and designers. Developers get to freestyle a lot in dead time between projects. No freelancers, as they don&#8217;t get as much feeling and responsibility with a project as their own crew does. They refuse to work on projects bigger than they can handle. Furthermore, some showcases of their work.</p>
<p><em><a href="http://www.unitzeroone.com/blog/">Ralph Hauwert</a> &#8211; Flash 2D and 3D effects</em>: I expected to see some hardcore code, but instead he showed how to be creative within the set boundaries of Flash. Ralph showed how, back in the days, the demo scene pushed their C64&#8217;s to compute things the C64 wasn&#8217;t meant to do. 3D rotation, raytracing, displacement maps were done 20 years ago, with computers having much less CPU than today. His point was that Flash can actually do a lot. And if it can&#8217;t do something, there are creative ways to eventually do it too. He also showcased RePhlex, a modular system of triggering Flash events that can be of any type. It will be open source, and will be released in an early state soon. Ralph made the impression of an insanely bright guy, knowing not only how to code, but to really push things beyond limits and to see the bigger picture.</p>
<p><em><a href="http://www.thirdeyedesign.co.uk/">Hoss Gilford</a> &#8211; The Rest of the Iceberg</em>: Presentation about the agency Marque (Formerly Third Eye). Didn&#8217;t think too much of it really. He made some jokes, but the presented works weren&#8217;t that good. Maybe the standard was set too high with the preceding presentations, or I had a little too much visual input overload, I don&#8217;t know.</p>
<p><em><a href="http://jot.eriknatzke.com/">Erik Natzke</a>: Beyond The Knowledge</em>: The Art of Playing: Erik creates art using generative programs. Much like Joshua and Jared. He showed some complex systems and they were fun to watch. Maybe it was because of him talking rather monotonously, but although his work was very intelligently programmed and very complex, it didn&#8217;t strike a chord with me, unlike Jared&#8217;s. But inspiring it was and I&#8217;ve got a lot to learn to match up with his skills <img src='http://www.monokai.nl/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.monokai.nl/blog/2008/02/26/fitc-amsterdam-2008/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Monoslideshow</title>
		<link>http://www.monokai.nl/blog/2006/09/19/monoslideshow/</link>
		<comments>http://www.monokai.nl/blog/2006/09/19/monoslideshow/#comments</comments>
		<pubDate>Tue, 19 Sep 2006 11:15:30 +0000</pubDate>
		<dc:creator>Wimer Hazenberg</dc:creator>
				<category><![CDATA[Flash developing]]></category>

		<guid isPermaLink="false">http://www.monokai.nl/blog/2006/09/19/monoslideshow/</guid>
		<description><![CDATA[I&#8217;ve just finished Monoslideshow, the new ultra customizable Flash image viewer for web designers and developers. It took some time, but finally it&#8217;s online: www.monoslideshow.com
Monoslideshow uses an .XML file to read out preferences about how it looks and behaves. A screenshot of Monoslideshow in its default looks:

You can check the customizability of Monoslideshow yourself by [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just finished Monoslideshow, the new ultra customizable Flash image viewer for web designers and developers. It took some time, but finally it&#8217;s online: <a title="Monoslideshow homepage" href="http://www.monoslideshow.com">www.monoslideshow.com</a></p>
<p>Monoslideshow uses an .XML file to read out preferences about how it looks and behaves. A screenshot of Monoslideshow in its default looks:</p>
<p><img alt="Screenshot Monoslideshow" title="Screenshot Monoslideshow" src="/blog/wp-content/images/screenshotMonoslideshow.jpg" /></p>
<p>You can check the customizability of Monoslideshow yourself by visiting the <a title="Monoslideshow live demo page" href="http://www.monoslideshow.com/demo/">live demo page</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.monokai.nl/blog/2006/09/19/monoslideshow/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Actionscript Obfuscator</title>
		<link>http://www.monokai.nl/blog/2006/08/02/actionscript-obfuscator/</link>
		<comments>http://www.monokai.nl/blog/2006/08/02/actionscript-obfuscator/#comments</comments>
		<pubDate>Wed, 02 Aug 2006 21:51:52 +0000</pubDate>
		<dc:creator>Wimer Hazenberg</dc:creator>
				<category><![CDATA[Flash developing]]></category>

		<guid isPermaLink="false">http://www.monokai.nl/blog/2006/08/02/actionscript-obfuscator/</guid>
		<description><![CDATA[I couldn&#8217;t find a decent free obfuscator to use on macOSX, so I made my own. The obfuscator is written in JAVA (so it&#8217;s platform independent), and it uses Flasm at its core.

The concept of obfuscation
Obfuscation is a process of altering code so that it no longer resembles the original state, but still works in [...]]]></description>
			<content:encoded><![CDATA[<p>I couldn&#8217;t find a decent free obfuscator to use on macOSX, so I made my own. The obfuscator is written in JAVA (so it&#8217;s platform independent), and it uses <a href="http://flasm.sourceforge.net/">Flasm</a> at its core.</p>
<p><span id="more-6"></span></p>
<h3>The concept of obfuscation</h3>
<p>Obfuscation is a process of altering code so that it no longer resembles the original state, but still works in the same way nonetheless. In this case, obfuscation means altering variable names in the source code of your Flash project, so that they no longer resemble their old names. This makes it harder for people to read your source code, in case of reverse-engineering.</p>
<h3>Installation of the programs</h3>
<ul>
<li>Download <a href="http://flasm.sourceforge.net/">Flasm</a> and place the program somewhere convenient.</li>
<li>Download <a href="http://www.monokai.nl/blog/wp-content/asdev/obfuscate.zip">obfuscate.zip</a></li>
</ul>
<p>(Please note that I didn&#8217;t test this program thoroughly. I only know it worked for my projects disassembled using Flasm 1.61.)</p>
<h3>Basic syntax of the program:</h3>
<p>Below you&#8217;ll find the output of the program when you start it without parameters, i.e. <code>java -jar obfuscate.jar</code></p>
<pre class="code">
	<code>
Actionscript Obfuscator v0.5 beta - Copyright (C) 2006 Wimer Hazenberg - www.monokai.nl
Takes a Flasm file and obfuscates all variables in it, except for those specified in "actionscript.txt" (and optionally, the exclusion file).

syntax to list the variables:
obfuscate -listvars input.flm - lists all variables in file
obfuscate -listsortedvars input.flm - lists all variables in file alphabetically

syntax to obfuscate:
obfuscate -type [wordlist.txt] input.flm output.flm [exclusion.txt] [-savemapping mapping.txt]

-type can be on of the following, replacing variable names with:
    -binary       : increasing binary values
    -decimal      : increasing decimal values
    -randomwords  : randomly created words
    -wordlist file: random words selected from a file

Example: obfuscate -wordlist words.txt original.flm obfuscated.flm excluded.txt -savemapping mapping.txt</code>
</pre>
<p>There are four ways to scramble your variables:</p>
<ul>
<li><code>binary</code> &#8211; replaces all variables with increasing binary numbers, i.e. &#8220;m0&#8243;, &#8220;m10&#8243;, &#8220;m10&#8243;.</li>
<li><code>decimal</code> &#8211; replaces all variables with increasing decimal numbers, i.e. &#8220;m0&#8243;, &#8220;m1&#8243;, &#8220;m2&#8243;.</li>
<li><code>randomwords</code> &#8211; replaces all variables with randomly created words, i.e. &#8220;varul&#8221;, &#8220;tipea&#8221;, &#8220;pratsbo&#8221;.</li>
<li><code>wordlist</code> &#8211; replaces all variables with random words selected out of a file. To use this option, you must specify a file containing (a lot of) words. I found some nice word-lists over here: <a href="ftp://ftp.ox.ac.uk/pub/wordlists/">ftp://ftp.ox.ac.uk/pub/wordlists/</a>.</li>
</ul>
<h3>Typical workflow</h3>
<p>Because the JAVA obfuscator relies on files created by Flasm, you&#8217;ll first have to disassemble your .SWF file to a .FLM file. You&#8217;d then use this .FLM file to feed into the obfuscator to produce the new obfuscated .FLM file. After obfuscation is completed, you&#8217;ll have to assemble the new .FLM file again to a .SWF file. This could also be done using FLASM. See below for a typical workflow:</p>
<pre class="code">
	<code>
flasm -d original.swf > original.flm
java -jar obfuscate.jar -wordlist words.txt original.flm obfuscated.flm excluded.txt
flasm -a obfuscated.flm
	</code>
</pre>
<p>The obfuscator isn&#8217;t a very smart program. It greedily replaces all variables it finds along the way. To let the obfuscator behave a bit less radically, it uses a list of reserved Actionscript words contained in <code>actionscript.txt</code>. Additionally, you could specify more variable names which will be excluded from obfuscation in a customized extra file. For example, it&#8217;s maybe a good idea to list the variables contained in the .FLM file first. You could then gradually remove variable names from your exclusion file, testing if your .SWF file still works. To list the variables:</p>
<pre class="code">
	<code>
flasm -d original.swf > original.flm
java -jar obfuscate.jar -listsortedvars original.flm > excluded.txt
	</code>
</pre>
<p>To obfuscate using the newly created <code>excluded.txt</code>:</p>
<pre class="code">
	<code>
java -jar obfuscate.jar -randomwords original.flm obfuscated.flm excluded.txt
flasm -a obfuscated.flm
	</code>
</pre>
<p>Repeat this process, modifying <code>excluded.txt</code> at each step.</p>
<h3>Mapping</h3>
<p>If you&#8217;d have to know what your original variable names were obfuscated into, you could save the mapping into a file. See below to create a file containing a mapping of all the original variables into the new ones:</p>
<pre class="code">
	<code>
java -jar obfuscate.jar -binary original.flm obfuscated.flm -savemapping mapping.txt
	</code>
</pre>
<p>So what exactly will your new code look like? You could check this with <a href="http://www.nowrap.de/flare.html">Flare</a>, a free Actionscript decompiler. To use it, simply type:</p>
<pre class="code">
	<code>
flare obfuscated.swf
	</code>
</pre>
<p>This will result in a file <code>obfuscated.flr</code> being created with all the actionscript in it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.monokai.nl/blog/2006/08/02/actionscript-obfuscator/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Using Textmate, MTASC and XTrace to build Flash projects in Mac OSX</title>
		<link>http://www.monokai.nl/blog/2006/07/14/using-textmate-mtasc-and-xtrace-to-build-flash-projects-in-mac-osx/</link>
		<comments>http://www.monokai.nl/blog/2006/07/14/using-textmate-mtasc-and-xtrace-to-build-flash-projects-in-mac-osx/#comments</comments>
		<pubDate>Fri, 14 Jul 2006 19:23:32 +0000</pubDate>
		<dc:creator>Wimer Hazenberg</dc:creator>
				<category><![CDATA[Flash developing]]></category>

		<guid isPermaLink="false">http://www.monokai.nl/blog/2006/07/14/using-textmate-mtasc-and-xtrace-to-build-flash-projects-in-mac-osx/</guid>
		<description><![CDATA[In this post I will describe my workflow for developing Flash projects without the use of the Adobe Flash IDE. This workflow isn&#8217;t suitable for every project. It&#8217;s mainly of use for those projects which only contain pure Actionscript code and make no use of components, objects in the library or non-scripted motion tweens. After [...]]]></description>
			<content:encoded><![CDATA[<p>In this post I will describe my workflow for developing Flash projects without the use of the Adobe Flash IDE. This workflow isn&#8217;t suitable for every project. It&#8217;s mainly of use for those projects which only contain pure Actionscript code and make no use of components, objects in the library or non-scripted motion tweens. After following the instructions, you will be able to do the following:</p>
<ul>
<li>Compile Actionscript .AS-files to a .SWF-file from within Textmate.</li>
<li>Preview .SWF-file from within Textmate.</li>
<li>Display error messages from within Textmate. You can click on these messages to quickly jump to the source of the error.</li>
<li>Display &#8220;trace&#8221; commands in a seperate window which automatically fades away after 30 seconds.</li>
</ul>
<p><span id="more-3"></span><br />
For all this to work, you&#8217;ll need this:</p>
<ul>
<li><a href="http://www.macromates.com">Textmate</a> &#8211; Text editor.</li>
<li><a href="http://www.mtasc.org/">MTASC</a> &#8211; ActionScript 2 Open Source free compiler.</li>
<li><a href="http://www.osflash.org/xtrace">XTrace</a> &#8211; Displays &#8220;trace&#8221; commands to debug your project.</li>
</ul>
<h3>Installation of the programs</h3>
<p>First you have to install Textmate and MTASC. The installation of Textmate is straightforward. I&#8217;ll leave it up to you. The installation of MTASC is easy as well. Just unzip the file you&#8217;ve downloaded from the site mentioned above and copy the files into a folder of your choice. I chose &#8220;/Developer/Mtasc&#8221;.</p>
<p>XTrace is downloadable as a .ZIP-file. It contains an application file &#8220;Xtrace.app&#8221; and the Actionscript class &#8220;debug.as&#8221; in the folder &#8220;ASTest/com/mab/util&#8221;. I copied the application to my general application folder, and the directory &#8220;com&#8221; to &#8220;/Developer/Mtasc/&#8221;.</p>
<h3>Scripting the compiling process</h3>
<p>The following code needs to be saved in a text file called &#8220;build.sh&#8221;. You can copy-paste the text below into a file, or you can <a href="http://www.monokai.nl/blog/wp-content/asdev/build.sh">download build.sh</a>.</p>
<pre class="code">
	<code>
#! /bin/sh

FLASHPLAYER=SAFlashPlayer
MTASC=/Developer/Mtasc/mtasc
CLASSES=/Developer/Mtasc/std8/
SOURCE=mainProgram.as
OUTPUT=mainProgram.swf
HEADER=550:400:40:ffffff
VERSION=7
TRACE=-trace\ com.mab.util.debug.trace
TMPFILE=/tmp/mainProgram.err

if [[ $1 == &quot;-t&quot; ]]; then
	$MTASC -cp &quot;$CLASSES&quot; -swf $OUTPUT -version $VERSION -header $HEADER -wimp $TRACE -main $SOURCE 2&gt;&amp;1 | grep characters | grep -v &quot;Warning unsupported #include&quot; | perl -pi -e &quot;s/^(.+?):(.+?): characters (\d+?)-\d+? : (.*)\$/&lt;a href=&apos;txmt:\\/\\/open?url=file:\\/\\/${TM_PROJECT_DIRECTORY//\//\\/}\\/\$1&amp;line=\$2&amp;column=\$3&apos; onClick=&apos;closeWin()&apos;&gt;${TM_PROJECT_DIRECTORY//\//\/}\/\$1:\$2: \$4&lt;\/a&gt;/g&quot;

else
	$MTASC -cp &quot;$CLASSES&quot; -swf $OUTPUT -version $VERSION -header $HEADER -wimp $TRACE -main $SOURCE
fi
	</code>
</pre>
<h4>Explanation</h4>
<p>The file &#8220;build.sh&#8221; has to be placed in the root of your project folder. You can alter the following variables for your project:</p>
<ul>
<li><code>FLASHPLAYER</code> &#8211; Application name of the flash player.</li>
<li><code>MTASC</code> &#8211; Link to MTASC.</li>
<li><code>CLASSES</code> &#8211; Link to the Actionscript classes you want to include in your build.</li>
<li><code>SOURCE</code> &#8211; Relative link to the main actionscript source file.</li>
<li><code>OUTPUT</code> &#8211; Relative link to the output of the compiled .SWF file.</li>
<li><code>HEADER</code> &#8211; Header describing the dimensions and frame rate of your .SWF file.</li>
<li><code>VERSION</code> &#8211; Compile the .SWF-file as the defined version.</li>
<li><code>TRACE</code> &#8211; Define a replacement function of the original <code>trace</code> calls. I used XTrace&#8217;s function here.</li>
<li><code>TMPFILE</code> &#8211; Absolute link to the temporary file containing error messages.</li>
</ul>
<p>As for the rest of the code: if build.sh is called without arguments, the source is compiled using Mtasc. If build.sh is called with argument &#8220;-t&#8221;, your project is compiled for use in Textmate. Basically, what this (very hard to read) command does, is filtering out all the warnings of unsupported #include&#8217;s, and wrap all error messages in standard HTML anchors, to quickly jump from Textmate&#8217;s error window to the location of the error in your files. This part of the script was copied from <a href="http://www.unfitforprint.com/articles/2006/01/02/howto-develop-flash-on-mac-osx-with-rake-mtasc-swfmill-and-textmate">a post of Ben Jackson</a>.</p>
<h3>Preview .SWF-file from Textmate</h3>
<p>To execute the compiled .SWF-file from Textmate, the script below has to be implemented as a Textmate command. I Used the following options:</p>
<ul>
<li>Save: &#8220;All Files in Project&#8221;</li>
<li>Command(s): copy-paste from below or <a href="http://www.monokai.nl/blog/wp-content/asdev/runScript.sh">download runScript.sh</a></li>
<li>Input: &#8220;None&#8221;</li>
<li>Output: &#8220;Show as HTML&#8221;</li>
<li>Activation: &#8220;Key Equivalent&#8221;: &#8220;COMMAND-ENTER&#8221;</li>
</ul>
<pre class="code">
	<code>
FLASHPLAYER=&quot;`cat $TM_PROJECT_DIRECTORY/build.sh | grep -m1 FLASHPLAYER= | sed &apos;s/FLASHPLAYER=//&apos;`&quot;

TMPFILE=&quot;`cat $TM_PROJECT_DIRECTORY/build.sh | grep -m1 TMPFILE= | sed &apos;s/TMPFILE=//&apos;`&quot;
OUTPUT=&quot;$TM_PROJECT_DIRECTORY/`cat $TM_PROJECT_DIRECTORY/build.sh | grep -m1 OUTPUT= | sed &apos;s/OUTPUT=//&apos;`&quot;

touch $TMPFILE

cd $TM_PROJECT_DIRECTORY
$TM_PROJECT_DIRECTORY/build.sh -t &gt; $TMPFILE

echo &quot;
	&lt;style type=&apos;text/css&apos;&gt;

		body {margin: 10px; font-family: Courier New; font-size: 12px;}
		a {color: #666666; text-decoration: none;}
		a:hover {color: #f00;}
	&lt;/style&gt;
	&lt;script type=&apos;text/javascript&apos;&gt;
		function closeWin() {
			self.close();
		}
	&lt;/script&gt;
&quot;

if test -s $TMPFILE; then
	echo &quot;&lt;body&gt;`cat $TMPFILE`&lt;/body&gt;&quot;

else
	echo &quot;&lt;body onload=&apos;closeWin()&apos;&gt;&lt;/body&gt;&quot;
	osascript -e &quot;tell application \&quot;$FLASHPLAYER\&quot; to quit&quot;
	open -a $FLASHPLAYER $OUTPUT
fi
	</code>
</pre>
<h4>Explanation</h4>
<p>This script first reads some variables from &#8220;build.sh&#8221; and it creates an empty temporary error file. Then it tries to compile your project. If compiling succeeds, it tells Textmate to close the output window and refresh the Flashplayer window. Else, it displays each error message in the Textmate output window. You can click on these messages to quickly jump to the line in your program containing the error.</p>
<h3>Typical workflow</h3>
<p>When starting a project, you&#8217;d typically copy &#8220;build.sh&#8221; to your project folder. Then you&#8217;d adjust the variables to suit your needs. Launch XTrace.app, and start coding away in Textmate. While an .AS-file in your project folder is selected, you&#8217;d hit &#8220;COMMAND-ENTER&#8221; to preview the .SWF-file.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.monokai.nl/blog/2006/07/14/using-textmate-mtasc-and-xtrace-to-build-flash-projects-in-mac-osx/feed/</wfw:commentRss>
		<slash:comments>49</slash:comments>
		</item>
	</channel>
</rss>
