<?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>[mck] &#187; AS3</title>
	<atom:link href="http://www.matthijskamstra.nl/blog/index.php/category/flash/as3/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.matthijskamstra.nl/blog</link>
	<description>a polymath zapper</description>
	<lastBuildDate>Tue, 07 Sep 2010 19:05:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Create SWC library from FDT</title>
		<link>http://www.matthijskamstra.nl/blog/index.php/2010/07/14/create-swc-library-from-fdt/</link>
		<comments>http://www.matthijskamstra.nl/blog/index.php/2010/07/14/create-swc-library-from-fdt/#comments</comments>
		<pubDate>Wed, 14 Jul 2010 08:00:35 +0000</pubDate>
		<dc:creator>Matthijs Kamstra</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[FDT]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[SWC]]></category>

		<guid isPermaLink="false">http://www.matthijskamstra.nl/blog/?p=1448</guid>
		<description><![CDATA[I use Greensock Tweening Platform a lot, it awesome. Download it (here for example) and you have everything you need. Now I start working with SWC files and they are so compact: I love it. But how do you get a library in a SWC? Google has an answer but it&#8217;s very complex. The best [...]]]></description>
			<content:encoded><![CDATA[<p>I use <a href="http://www.greensock.com/">Greensock</a> Tweening Platform a lot, it awesome. Download it (<a href="http://www.greensock.com/tweenmax/">here</a> for example) and you have everything you need.</p>
<p>Now I start working with SWC files and they are so compact: I love it.<br />
But how do you get a library in a SWC? <a href="http://www.google.com/search?q=create+a+swc+with+fdt" target="_blank">Google</a> has an answer but it&#8217;s very complex.</p>
<p>The best answer is from <a href="http://twitter.com/BrunoFonzi/">Bruno Fonzi</a> on
<p><a href='http://twitter.com/BrunoFonzi/statuses/17885849155'>Twitter / Bruno Fonzi: How to create SWC librarie &#8230;</a>.</p>
<p>How to create SWC libraries from FDT:<br />
Right click Project > Run as > FDT Library<br />
or<br />
Menu > Run Configurations > Create new FDT Library</p>
<p>So start with a <strong>New Flash Project</strong> (the name you will use for this project will be the name of the SWC: in my case &#8220;Greensock_Tweening_Platform&#8221;) and copy the <strong>com</strong> folder from the Greensock ZIP into the src (of source) folder.<br />
<img src="http://www.matthijskamstra.nl/blog/wp-content/uploads/greensock_folder.png" alt="" title="Greensock folder" width="291" height="69" class="alignnone size-full wp-image-1454" /><br />
If you follow the instructions and create a SWC you will get an error about: UIComponent and Vector (depends on your Project properties).</p>
<p>So to fix this: follow the 2 red x&#8217;s<br />
<img src="http://www.matthijskamstra.nl/blog/wp-content/uploads/greensock_folder_with_com.png" alt="" title="Greensock folder with red x" width="299" height="377" class="alignnone size-full wp-image-1453" /></p>
<p>com > greensock > loading > display > FlexContentDisplay<br />
I don&#8217;t use this one, so delete.</p>
<p>The next depends on the project properties (I used SDK: Flex 3.3 and Player Version 9 and there are no Vectors in Player version 9)<br />
com > greensock > plugins > EndVectorPlugin<br />
I can&#8217;t use this one, so delete this on too.</p>
<p>Create the SWC again and your done: you have one file with the Greensock Tweening Platform in it.</p>

	<h4 class='swf-title'>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.matthijskamstra.nl/blog/index.php/2008/03/19/xml-reader-flash-panel-todo-and-requests/" title="XML Reader Flash panel &#8211; Todo and Requests (March 19, 2008)">XML Reader Flash panel &#8211; Todo and Requests</a> (2)</li>
	<li><a href="http://www.matthijskamstra.nl/blog/index.php/2007/05/21/xml-reader-flash-panel/" title="XML Reader Flash panel (May 21, 2007)">XML Reader Flash panel</a> (3)</li>
	<li><a href="http://www.matthijskamstra.nl/blog/index.php/2006/07/09/why-do-i-need-metadata/" title="Why do I need MetaData? (July 9, 2006)">Why do I need MetaData?</a> (0)</li>
	<li><a href="http://www.matthijskamstra.nl/blog/index.php/2009/09/03/what-a-flash-actionscript-developer-needs-to-know/" title="What a Flash / ActionScript Developer needs to know (September 3, 2009)">What a Flash / ActionScript Developer needs to know</a> (0)</li>
	<li><a href="http://www.matthijskamstra.nl/blog/index.php/2007/10/31/urban-papercraft-papercritters/" title="Urban papercraft: Papercritters (October 31, 2007)">Urban papercraft: Papercritters</a> (3)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.matthijskamstra.nl/blog/index.php/2010/07/14/create-swc-library-from-fdt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FDT and ANT &#8211; part 1</title>
		<link>http://www.matthijskamstra.nl/blog/index.php/2010/07/07/fdt-and-ant-part-1/</link>
		<comments>http://www.matthijskamstra.nl/blog/index.php/2010/07/07/fdt-and-ant-part-1/#comments</comments>
		<pubDate>Wed, 07 Jul 2010 09:57:30 +0000</pubDate>
		<dc:creator>Matthijs Kamstra</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[FDT]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[ANT-Build-template]]></category>
		<category><![CDATA[ANT-file]]></category>
		<category><![CDATA[ANT-snippets]]></category>
		<category><![CDATA[ANT-View]]></category>
		<category><![CDATA[flashdevelop]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://www.matthijskamstra.nl/blog/?p=1441</guid>
		<description><![CDATA[Just started to work with FDT and wrote about my &#8220;troubles&#8221; (post#1 and post#2) with my transition from FlashDevelop. (have to be very carefull what I say: &#8220;they&#8221; are watching me: here and here ) And it seems to be a very natural (geeky) thing to learn about ANT. And where do you go to [...]]]></description>
			<content:encoded><![CDATA[<p>Just started to work with <a href="http://www.fdt.powerflasher.com/">FDT</a> and wrote about my &#8220;troubles&#8221; (<a href="http://www.matthijskamstra.nl/blog/index.php/2010/06/16/moving-from-flashdevelop-to-fdt/">post#1</a> and <a href="http://www.matthijskamstra.nl/blog/index.php/2010/06/29/missing-in-fdt-after-working-with-flashdevelop/">post#2</a>) with my transition from <a href="http://www.flashdevelop.org/wikidocs/index.php?title=Main_Page">FlashDevelop</a>.<br />
<em>(have to be very carefull what I say: &#8220;they&#8221; are watching me: <a href="http://www.matthijskamstra.nl/blog/index.php/2010/06/29/missing-in-fdt-after-working-with-flashdevelop/#comment-11773">here</a> and <a href="http://twitter.com/BrunoFonzi/statuses/17355312899">here</a> <img src='http://www.matthijskamstra.nl/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  )<br />
</em><br />
And it seems to be a very natural (geeky) thing to learn about <a href="http://ant.apache.org/" target="_blank">ANT</a>.</p>
<p>And where do you go to learn about ANT and SWF/Flash/FDT? (<a href="http://www.google.com/search?q=fdt+ant" target="_blank">Google</a>?)<br />
After some tinkering all I got was: <code><strong>failed to create task or type fdt.launch.application</strong></code></p>
<p>This post was very useful: <a href="http://blog.alanklement.com/2009/08/10/fdt-and-ant-a-users-guide-part-i/">FDT and ANT | A User’s Guide – Part I</a> by Alan Klement.<br />
Watch the videos (I&#8217;m not very fond of tutorial videos but in this case; they get the job done).<br />
What I love about the &#8220;<a href="http://blog.alanklement.com/files/videos/ant_part_one.mov">Video I: Getting Started</a>&#8221; is the fact that it builds up from scratch. So watch this video when you want to know about ant-files/xml, how to open the ANT-View, how to open/execute an ANT-file.</p>
<p>The second video (<a href="http://blog.alanklement.com/files/videos/ant_part_two.mov">Video II: Compiling a SWF</a>) was what I really was looking for: how to export a SWF. Very nice because it starts from scratch.<br />
And it gave me the answer I was looking for: why didn&#8217;t my ANT-file didn&#8217;t work (it about 3/4 of the video):<br />
<code><br />
BUILD FAILED<br />
[blabla]\source\a\example\build\build.xml:17: Problem: <strong>failed to create task or type fdt.launch.application</strong><br />
Cause: The name is undefined.<br />
Action: Check the spelling.<br />
Action: Check that any custom tasks/types have been declared.<br />
Action: Check that any
<presetdef>/<macrodef> declarations have taken place.<br />
</code></p>
<p><strong>Solution is very simple</strong>, but if you don&#8217;t know, you will hate FDT and really it&#8217;s not it fault:<br />
Goto the green &#8220;play&#8221; button with the brown bag, in the toolbar (one picture says more than a thousand words:)<br />
<img src="http://www.matthijskamstra.nl/blog/wp-content/uploads/external_tools_configurations_hoover.png" alt="" title="external_tools_configurations_hoover" width="229" height="142" class="alignnone size-full wp-image-1444" /></p>
<p>Select the ANT-file you want to change (I have only one <img src='http://www.matthijskamstra.nl/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> ), goto to tab &#8220;<strong>JRE</strong>&#8221; and change the <strong>Runtime JRE</strong> to <strong>Run in the same JRE as the workspace</strong> and your done:<br />
<a href="http://www.matthijskamstra.nl/blog/wp-content/uploads/external_tools_configurations.png" target="_blank"><img src="http://www.matthijskamstra.nl/blog/wp-content/uploads/external_tools_configurations.png" alt="" title="external_tools_configurations" width="500" class="alignnone size-full wp-image-1445" /></a></p>
<p>Very useful are the ANT-snippets and ANT-Build-template!<br />
<a href="http://blog.alanklement.com/files/zip/ant_templates.zip">Download</a> (created by Alan Klement) and &#8220;install&#8221; the ANT-template (how-to on <a href="http://blog.alanklement.com/2009/08/10/fdt-and-ant-a-users-guide-part-i/">this page</a> but here the short version)</p>
<blockquote><p>
To add XML files templates go: <strong>Preferences > XML > XML Files > Editor > Templates</strong> and click import.</p>
<p>To add Ant snippets go: <strong>Preferences > Ant > Editor > Templates</strong> and click import.</p></blockquote>
<p>I haven&#8217;t seen the second part of this tutorial: <a href="http://blog.alanklement.com/2009/08/19/fdt-ant-part-two/">FDT and ANT | A User’s Guide – Part II</a> but I will.<br />
It seems to be focused on the use of the templates and snippets.</p>
<p>source:<br />
<a href="http://blog.alanklement.com/2009/08/10/fdt-and-ant-a-users-guide-part-i/">FDT and ANT | A User’s Guide – Part I</a><br />
<a href="http://blog.alanklement.com/2009/08/19/fdt-ant-part-two/">FDT and ANT | A User’s Guide – Part II</a></p>

	<h4 class='swf-title'>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.matthijskamstra.nl/blog/index.php/2006/07/09/why-do-i-need-metadata/" title="Why do I need MetaData? (July 9, 2006)">Why do I need MetaData?</a> (0)</li>
	<li><a href="http://www.matthijskamstra.nl/blog/index.php/2010/03/31/what-about-svg-files/" title="What about SVG files? (March 31, 2010)">What about SVG files?</a> (0)</li>
	<li><a href="http://www.matthijskamstra.nl/blog/index.php/2009/09/03/what-a-flash-actionscript-developer-needs-to-know/" title="What a Flash / ActionScript Developer needs to know (September 3, 2009)">What a Flash / ActionScript Developer needs to know</a> (0)</li>
	<li><a href="http://www.matthijskamstra.nl/blog/index.php/2007/10/31/urban-papercraft-papercritters/" title="Urban papercraft: Papercritters (October 31, 2007)">Urban papercraft: Papercritters</a> (3)</li>
	<li><a href="http://www.matthijskamstra.nl/blog/index.php/2007/07/11/uncomment-trace-jsfl/" title="Uncomment trace JSFL (July 11, 2007)">Uncomment trace JSFL</a> (0)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.matthijskamstra.nl/blog/index.php/2010/07/07/fdt-and-ant-part-1/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
<enclosure url="http://blog.alanklement.com/files/videos/ant_part_one.mov" length="15458577" type="video/quicktime" />
<enclosure url="http://blog.alanklement.com/files/videos/ant_part_two.mov" length="17294254" type="video/quicktime" />
		</item>
		<item>
		<title>Moving from FlashDevelop to FDT</title>
		<link>http://www.matthijskamstra.nl/blog/index.php/2010/06/16/moving-from-flashdevelop-to-fdt/</link>
		<comments>http://www.matthijskamstra.nl/blog/index.php/2010/06/16/moving-from-flashdevelop-to-fdt/#comments</comments>
		<pubDate>Wed, 16 Jun 2010 10:27:46 +0000</pubDate>
		<dc:creator>Matthijs Kamstra</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[FDT]]></category>
		<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[flashdevelop]]></category>
		<category><![CDATA[Templates]]></category>

		<guid isPermaLink="false">http://www.matthijskamstra.nl/blog/?p=1417</guid>
		<description><![CDATA[Yes, its time, I need to&#8230; So how to make the transition from FlashDevelop to FDT as easy as possible? Let FDT react like FlashDevelop And I don&#8217;t even have to break a sweat: the amazing Steven Sacks (creator of Gaia) wrote an article about it: read here. The only two thing that I&#8217;m using [...]]]></description>
			<content:encoded><![CDATA[<p>Yes, its time, I need to&#8230;<br />
So how to make the transition from FlashDevelop to FDT as easy as possible?</p>
<h3>Let FDT react like FlashDevelop</h3>
<p>And I don&#8217;t even have to break a sweat: the amazing <a href="http://www.stevensacks.net/">Steven Sacks</a> (creator of Gaia) wrote an article about it: <a href="http://www.stevensacks.net/2010/04/30/setting-up-fdt-to-look-and-behave-like-flashdevelop/">read here</a>.<br />
The only two thing that I&#8217;m using are:<br />
Open <strong>Window > Preferences</strong> </p>
<p>Under <strong>FDT > Editor > Code Assist</strong> copy and paste this into Auto activation triggers for AS, and set the delay to 0ms (zero).</p>
<div class="showcode">
<pre>
abcdefghijklmnopqrstuvwxyz_. :</pre>
</div>
<p>and</p>
<p>Under <strong>Problems > AS3 Problems</strong>:<br />
<strong>Unresolvable</strong> > <strong>Unresolvable variable reference in E4X</strong> and <strong>Unresolvable member reference in dynamic object</strong> should both be set to Disabled (from Warning to Disabled).</p>
<p>The shortcuts I just left them as they where: I&#8217;m working in another program so I should use the shortcut given by that program.</p>
<div class="update"><strong>Update #1:</strong> hmmm I noticed that I can&#8217;t live without CTRL+ENTER&#8230;. explanation here: <a href="http://cote.cc/blog/using-ctrl-enter-to-compile-actionscript-code-in-fdt">Using CTRL-ENTER to compile ActionScript code in FDT</a>. So now I have CTRL+ENTER and debug run:  CTRL+SHIFT+ENTER  <img src='http://www.matthijskamstra.nl/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  </p>
<p>short explanation (so I can do this quickly if something happens to FDT):</p>
<p>Under <strong>Preferences > Run/Debug > Launching</strong> at the bottom at <strong>Launch Operation</strong>: Select &#8220;<strong>Always launch the previously launched application</strong>&#8221;</p>
<p>then </p>
<p>Under <strong>Preferences > General > Keys</strong> find (or type in &#8220;type filter text&#8221; &#8211; searchbox: &#8220;last&#8221;) a command called &#8220;<strong>Run Last Launched</strong>&#8221; and click Copy Command. Assign (binding) the shortcut CTRL-ENTER to the copied command and change &#8220;when&#8221; to <strong>Editing ActionScipt Source</strong> (no spelling mistake: it really says that).<br />
Do the same thing for the &#8220;<strong>Debug Last Launched</strong>&#8221; command and assign the shortcut : CTRL-SHIFT-ENTER and change the when to <strong>Editing ActionScipt Source</strong>.</p>
<p>I&#8217;m not sure if the stuff I wrote here is only for FDT4 but the way it was explained on the site previous mentioned didn&#8217;t work in FDT4
</p></div>
<h3>Some templates/snippets that are very useful</h3>
<p>I used <a href="http://www.double-quotes.com/fd/dq.htm">this plugin</a> for my trace in FlashDevelop, so how to do this in FDT?</p>
<div class="update"><strong>Update #2:</strong> I shouldn&#8217;t forget to mention CTRL+0 (read the <a href="http://www.fdt.powerflasher.com/developer-tools/fdt-3/getting-started/shortcuts/">shortcut list for FDT</a>) which is the shortcut for &#8220;Quick Trace&#8221;. This one I use to trace variable for example and the trace template below for functions.</div>
<div class="update"><strong>Update #4:</strong> This is really a reminder for myself, but if you need it you know where you can find it in FDT4.<br />
Some minor adjustments like: </p>
<p><strong>Preferences > FDT > Build Path </strong> change <strong>Source folders</strong> to &#8220;source&#8221; (I like source above src) and <strong>Output folder</strong> to &#8220;deploy&#8221; (I like deploy above bin)</p>
<p><strong>Preferences > FDT > Code Style > Code Templates (Misc)</strong> to &#8220;<strong>Override System UserName &#8211; ${user}</strong>&#8221;</p>
<p><strong>Preferences > FDT > Editor</strong> goto &#8220;Folding&#8221; and uncheck &#8220;Folding enabled&#8221; (I like to see everything, comment also)</p>
<p><strong>Preferences > FDT > Tools > Flash/Flash Help</strong> to add paths to Flash (in my case: &#8220;H:\Program Files\Adobe\Adobe Flash CS4\Flash.exe&#8221;) and the Flash help files (in my case: &#8220;H:\Program Files\Adobe\Adobe Flash CS4\en\First Run\HelpPanel\Help&#8221;)</p>
<p><strong>Preferences > General > Web Browser</strong> change to &#8220;Use external Web browser&#8221; to my favourite browser: Firefox (no Google Chrome there yet)
</div>
<p>You have to create a code-template/code-snippet:<br />
go to <strong>Preferences > FDT > Editor > Templates</strong></p>
<p>This is a template that resembles the trace I used in FlashDevelop<br />
<strong>Trace:</strong></p>
<div class="showcode">
<pre>trace ( "+ ${enclosing_type}.${enclosing_method}() - args: " + [ ${enclosing_method_arguments} ] );</pre>
</div>
<p>and I found some other useful templates</p>
<p><strong>Public method:</strong></p>
<div class="showcode">
<pre>public function ${methodName}():${type} {
    trace(">> ${enclosing_type}.${methodName}() args: "+[]);
    ${cursor}
};</pre>
</div>
<p>for some strange reason there is no shortcut for asdoc <img src='http://www.matthijskamstra.nl/blog/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p><strong>ASDoc:</strong></p>
<div class="showcode">
<pre>/**
 * ${cursor}
 * @example
 * @param		${enclosing_method_arguments}
 * @return
 */
 */</pre>
</div>
<div class="update"><strong>Update #3:</strong> (sadly if there are no param in the function &#8220;${enclosing_method_arguments}&#8221; will be printed..)</div>
<p>a switch a use a lot with FlashDevelop:</p>
<p><strong>Switch:</strong></p>
<div class="showcode">
<pre>switch (${value}) {
	case ${result}:
		trace ("${result}" +${result} );
		${cursor}
		break;
    default:
        trace("case '"+${value}+"':\r\ttrace ('--- "+${value}+"');\r\tbreak;" );
}
</pre>
</div>
<p>and the template for a singleton</p>
<p><strong>Singleton:</strong> (from <a href="http://www.gskinner.com/blog/archives/2006/07/as3_singletons.html">gskinner</a>)</p>
<div class="showcode">
<pre>package ${enclosing_package} {

	/**
	* @author ${user}
	*/
	public class ${enclosing_type} {

		private static var _instance:${enclosing_type};
		private static var _allowInstantiation:Boolean;

		public static function getInstance():${enclosing_type} {
			if (_instance == null) {
				_allowInstantiation = true;
				_instance = new ${enclosing_type}();
				_allowInstantiation = false;
			}
			return _instance;
		}

		public function ${enclosing_type}():void {
			if (!_allowInstantiation) {
				throw new Error("Error: Instantiation failed: Use ${enclosing_type}.getInstance() instead of new.");
			}
		}

		${cursor}

	} // end class

} // end package</pre>
</div>
<p>enough for now, here some other posts about the subject</p>
<p><strong>Source:</strong><br />
<a href="http://blog.hydrotik.com/2007/11/19/fdt-30-code-templates/">http://blog.hydrotik.com/2007/11/19/fdt-30-code-templates/</a><br />
<a href="http://www.breaktrycatch.com/useful-fdt-templates/">http://www.breaktrycatch.com/useful-fdt-templates/</a><br />
<a href="http://www.stevensacks.net/2010/04/30/setting-up-fdt-to-look-and-behave-like-flashdevelop/">http://www.stevensacks.net/2010/04/30/setting-up-fdt-to-look-and-behave-like-flashdevelop/</a><br />
<a href="http://www.gskinner.com/blog/archives/2006/07/as3_singletons.html">http://www.gskinner.com/blog/archives/2006/07/as3_singletons.html</a><br />
<a href="http://blog.flashmech.net/2008/08/review-fdt-vs-flashdevelop/">http://blog.flashmech.net/2008/08/review-fdt-vs-flashdevelop/</a><br />
<a href="https://fosswiki.liip.ch/display/FLASH/Code+Snippets+for+FDT+and+Flex">https://fosswiki.liip.ch/display/FLASH/Code+Snippets+for+FDT+and+Flex</a><br />
<a href="http://cote.cc/blog/using-ctrl-enter-to-compile-actionscript-code-in-fdt">http://cote.cc/blog/using-ctrl-enter-to-compile-actionscript-code-in-fdt</a><br />
<a href="http://www.fdt.powerflasher.com/developer-tools/fdt-3/getting-started/shortcuts/">http://www.fdt.powerflasher.com/developer-tools/fdt-3/getting-started/shortcuts/</a><br />
<a href="http://blog.flashmech.net/2008/10/fdt-tip-boost-your-code-assist/">http://blog.flashmech.net/2008/10/fdt-tip-boost-your-code-assist/</a></p>

	<h4 class='swf-title'>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.matthijskamstra.nl/blog/index.php/2008/03/19/xml-reader-flash-panel-todo-and-requests/" title="XML Reader Flash panel &#8211; Todo and Requests (March 19, 2008)">XML Reader Flash panel &#8211; Todo and Requests</a> (2)</li>
	<li><a href="http://www.matthijskamstra.nl/blog/index.php/2007/05/21/xml-reader-flash-panel/" title="XML Reader Flash panel (May 21, 2007)">XML Reader Flash panel</a> (3)</li>
	<li><a href="http://www.matthijskamstra.nl/blog/index.php/2006/07/09/why-do-i-need-metadata/" title="Why do I need MetaData? (July 9, 2006)">Why do I need MetaData?</a> (0)</li>
	<li><a href="http://www.matthijskamstra.nl/blog/index.php/2007/12/11/urban-papercraft-shin-tanaka-part-4-sneakers/" title="Urban papercraft: Shin Tanaka (part 4) &#8211; Sneakers (December 11, 2007)">Urban papercraft: Shin Tanaka (part 4) &#8211; Sneakers</a> (9)</li>
	<li><a href="http://www.matthijskamstra.nl/blog/index.php/2007/10/31/urban-papercraft-papercritters/" title="Urban papercraft: Papercritters (October 31, 2007)">Urban papercraft: Papercritters</a> (3)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.matthijskamstra.nl/blog/index.php/2010/06/16/moving-from-flashdevelop-to-fdt/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Twitter RSS reader &#8211; part 2</title>
		<link>http://www.matthijskamstra.nl/blog/index.php/2010/01/06/twitter-rss-reader-part-2/</link>
		<comments>http://www.matthijskamstra.nl/blog/index.php/2010/01/06/twitter-rss-reader-part-2/#comments</comments>
		<pubDate>Wed, 06 Jan 2010 08:00:48 +0000</pubDate>
		<dc:creator>Matthijs Kamstra</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[proxy]]></category>
		<category><![CDATA[proxy.php]]></category>

		<guid isPermaLink="false">http://www.matthijskamstra.nl/blog/?p=1218</guid>
		<description><![CDATA[This is a &#8220;must-read&#8221; update for twitter rss reader in flash as3. read here the complete (dutch) error message Stupid, stupid, stupid, I already knew this: Flash cross-domain security. Which simple says that it&#8217;s not allowed to &#8220;get&#8221; anything from another website unless the server has a crossdomain.xml. The nasty part is that, while you [...]]]></description>
			<content:encoded><![CDATA[<div class='highlight'>This is a &#8220;must-read&#8221; update for <a href="http://www.matthijskamstra.nl/blog/index.php/2009/12/30/twitter-rss-reader-in-flash-as3/">twitter rss reader in flash as3</a>.</div>
<p><img src="http://www.matthijskamstra.nl/blog/wp-content/uploads/error_flash_debugplayer.jpg" alt="" title="flash debugplayer error" width="488" height="223" class="alignnone size-full wp-image-1221" /><br />
<em><a href="#dutch_error">read here</a> the complete (dutch) error message</em></p>
<p>Stupid, stupid, stupid, I already knew this: <strong><a href="http://www.macromedia.com/devnet/flash/articles/fplayer_security_03.html">Flash cross-domain security</a></strong>.<br />
Which simple says that it&#8217;s not allowed to &#8220;get&#8221; anything from another website unless the server has a <a href="http://www.adobe.com/devnet/articles/crossdomain_policy_file_spec.html"><code>crossdomain.xml</code></a>.<br />
The nasty part is that, while you are testing in Flash IDE nothing goes wrong. So I only bumped into this when I put it on my server&#8230;</p>
<p>So what to do?</p>
<ol>
<li>Ask Twitter to change there <code>crossdomain.xml</code> and add my domain&#8230;&#8230; (is this really an option?)</li>
<li>Find something around the crossdomain security from Flash</li>
</ol>
<p>Luckily solution two is the easiest one: use a proxy to get the data we want.<br />
Because PHP doesn&#8217;t have the same restrictions as Flash has we will be using a proxy.php. </p>
<p>This is how it works: Flash wants a <code>crossdomain.xml</code> if you &#8220;get&#8221; data from another server, but if you &#8220;get&#8221; data from the same server there is no problem. So we will be asking the <code>proxy.php</code> to &#8220;get&#8221; the xml/rss and serve it to Flash.</p>
<p>So instead of loading the data directly from Twitter<br />
<code>http://twitter.com/statuses/user_timeline/27657030.rss</code><br />
We will be using the proxy instead<br />
<code>http://yoursite.com/xml_proxy.php?url=http://twitter.com/statuses/user_timeline/27657030.rss</code></p>
<p>I didn&#8217;t write the proxy myself:<br />
The proxy that I used can be found here: <a href="http://xmlrpcflash.mattism.com/proxy_info.php">http://xmlrpcflash.mattism.com/proxy_info.php</a> (it has some extra explanation about the subject )<br />
This proxy can be use for all sorts of xml, and any server.</p>
<p>As always I&#8217;m reinventing the wheel: this group needed a specific solution but is nice to read more about it:<br />
<a href="http://woveninteractive.net/2009/02/twitter-in-flash-getting-past-the-securityerrorevent/">http://woveninteractive.net/2009/02/twitter-in-flash-getting-past-the-securityerrorevent/</a><br />
They wrote something similar, but a proxy more specific suited for twitter and the use of <a href="http://code.google.com/p/twitterscript/source/checkout">twitterscript</a>.</p>
<div class="update"><strong>Update #1:</strong> I found another proxy.php (I really don&#8217;t think you need another, but choices are nice <img src='http://www.matthijskamstra.nl/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  ).<br />
<a href="http://www.abdulqabiz.com/blog/archives/2007/05/31/php-proxy-script-for-cross-domain-requests/">PHP Proxy Script for cross-domain requests</a>
</div>
<div id="dutch_error">
Sorry for the dutch error&#8230; I have a dutch version of XP (not my choice)<br />
<code><br />
Error #2044: Niet-afgehandelde securityError:. text=Error #2048: Schending van beveiligingssandbox: http://emceekay.nl/paper/flash/twttr.swf kan geen gegevens laden van http://twitter.com/statuses/user_timeline/27657030.rss.<br />
	at nl.emceekay.twttr::TwttrBase/getFeed()<br />
	at nl.emceekay.twttr::TwttrMain()<br />
</code>
</div>

	<h4 class='swf-title'>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.matthijskamstra.nl/blog/index.php/2008/03/19/xml-reader-flash-panel-todo-and-requests/" title="XML Reader Flash panel &#8211; Todo and Requests (March 19, 2008)">XML Reader Flash panel &#8211; Todo and Requests</a> (2)</li>
	<li><a href="http://www.matthijskamstra.nl/blog/index.php/2007/05/21/xml-reader-flash-panel/" title="XML Reader Flash panel (May 21, 2007)">XML Reader Flash panel</a> (3)</li>
	<li><a href="http://www.matthijskamstra.nl/blog/index.php/2006/07/09/why-do-i-need-metadata/" title="Why do I need MetaData? (July 9, 2006)">Why do I need MetaData?</a> (0)</li>
	<li><a href="http://www.matthijskamstra.nl/blog/index.php/2009/09/03/what-a-flash-actionscript-developer-needs-to-know/" title="What a Flash / ActionScript Developer needs to know (September 3, 2009)">What a Flash / ActionScript Developer needs to know</a> (0)</li>
	<li><a href="http://www.matthijskamstra.nl/blog/index.php/2007/10/31/urban-papercraft-papercritters/" title="Urban papercraft: Papercritters (October 31, 2007)">Urban papercraft: Papercritters</a> (3)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.matthijskamstra.nl/blog/index.php/2010/01/06/twitter-rss-reader-part-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Twitter rss reader in Flash as3</title>
		<link>http://www.matthijskamstra.nl/blog/index.php/2009/12/30/twitter-rss-reader-in-flash-as3/</link>
		<comments>http://www.matthijskamstra.nl/blog/index.php/2009/12/30/twitter-rss-reader-in-flash-as3/#comments</comments>
		<pubDate>Wed, 30 Dec 2009 08:00:16 +0000</pubDate>
		<dc:creator>Matthijs Kamstra</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Urban papercraft]]></category>
		<category><![CDATA[Papercraft]]></category>
		<category><![CDATA[PaperToy]]></category>
		<category><![CDATA[PaperToys]]></category>
		<category><![CDATA[Urban]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://www.matthijskamstra.nl/blog/?p=1196</guid>
		<description><![CDATA[Update #1: must read this post, otherwise this code will fail when you place it on your server! I recently started my own company (eMCeeKay.nl) and I need to make a website for it&#8230;. Not really a problem besides that I don&#8217;t have any time to create a design. So I was thinking about a [...]]]></description>
			<content:encoded><![CDATA[<div class="update"><strong>Update #1:</strong> <a href="http://www.matthijskamstra.nl/blog/index.php/2010/01/06/twitter-rss-reader-part-2/">must read this post</a>, otherwise this code will fail when you place it on your server!</div>
<p>I recently started my own company (<a href="http://www.eMCeeKay.nl">eMCeeKay.nl</a>) and I need to make a website for it&#8230;. Not really a problem besides that I don&#8217;t have any time to create a design.</p>
<p>So I was thinking about a easy way to update this website without spending extra time on that.</p>
<p>Because the main focus of the company is papertoys (urban papertoys), I need design or papertoy related info in my my new website ().</p>
<p>And I came with two ways to update it without extra effort: <a href="http://www.twitter.com/matthijskamstra">twitter</a> (I tweet about a lot of stuff but primarily about papertoys) and this the content on this blog (category: <a href="http://www.matthijskamstra.nl/blog/index.php/category/design/urban-papercraft/">urban-papercraft</a>).</p>
<p>I started with the Twitter part.<br />
There are two Twitter AS3 libraries that &#8220;speak&#8221; to the Twitter API: <a href="http://code.google.com/p/twitterscript/">twitterscript/</a> and <a href="http://code.google.com/p/tweetr/">tweetr/</a>.<br />
But after reading the source I concluded that it was a little bit to much: I don&#8217;t want to tweet from emceekay.nl or do searches, so that was not the way to go.</p>
<p>A little google search gave me the solution: <a href="http://www.theflashlogs.org/flash/displaying-twitter-feeds-in-flash-with-rss/">http://www.theflashlogs.org/flash/displaying-twitter-feeds-in-flash-with-rss/</a>, simple using the standard rss from Twitter (in my case: <a href="http://twitter.com/statuses/user_timeline/27657030.rss" title="Matthijs Kamstra - Twitter - rss" rel="alternate" type="application/rss+xml">Matthijs Kamstra &#8211; Twitter &#8211; rss</a>).</p>
<p>The code on theflashlogs.org is pritty simple, and very easy to use.<br />
So my code is a little addition to that, I need some stuff done to the rss feed:</p>
<ul>
<li>remove &#8220;MatthijsKamstra:&#8221; form the title</li>
<li>convert <strong>@paperkraft</strong> to a link</li>
<li>convert <strong>#Mecha6</strong> to a link</li>
<li>convert <strong>http://</strong> to a link</li>
</ul>
<p>Here is my code:</p>
<pre class="brush: as3; light: false; wrap-lines: false;">
package nl.emceekay.twttr
{
	import flash.display.MovieClip;
	import flash.events.Event;
	import flash.net.URLLoader;
	import flash.net.URLRequest;
	import flash.text.TextField;
	/**
	 * // nl.emceekay.twttr.TwttrExample
	 * ...
	 * @author Matthijs Kamstra aka [mck]
	 */
	public class TwttrExample extends MovieClip
	{
		//default: http://twitter.com/matthijskamstra
		private var url:String = &quot;http://twitter.com/statuses/user_timeline/27657030.rss&quot;; 

		private var _txt:TextField;

		public function TwttrExample()
		{
			stage.scaleMode = &quot;noScale&quot;;
			stage.align = &quot;TL&quot;;

			// generate textfield
			_txt = new TextField()
			_txt.x = 10;
			_txt.y = 10;
           		 _txt.width = stage.stageWidth - 20;
           		_txt.height =  stage.stageHeight - 20;
			_txt.wordWrap = true;
			_txt.multiline = true;
			_txt.autoSize = &quot;left&quot;;
			addChild(_txt);

			// start
			getFeed(url);
		}

		//////////////////////////////////////// loading rss / show rss ////////////////////////////////////////

		private function getFeed (inURL:String) : void
		{
			_txt.htmlText = &quot;getting tweets&quot;;

			var loader:URLLoader = new URLLoader();
			loader.addEventListener(Event.COMPLETE, onFeedHandler);
			loader.load(new URLRequest(inURL));
		}

		private function onFeedHandler (e:Event):void
		{
			_txt.htmlText = &quot;&quot;;
			var _feed:XML = new XML(e.target.data);
			var _item:XMLList = _feed.channel.item;
			for each (var feedItem:XML in _item){
				var _title		:String = feedItem.title;
				var _pubDate	:String = feedItem.pubDate;
				var _link		:String = feedItem.link;

				_title = convertTweet(_title);

				_txt.htmlText += _title + &quot;&lt;br&gt;&lt;i&gt;&quot; + _pubDate + &quot;&lt;/i&gt;&lt;br&gt;&lt;br&gt;&quot;;
			}
		}

		//////////////////////////////////////// twitter specific ////////////////////////////////////////

		// one place to convert the tweet
		private function convertTweet (inString:String):String
		{
			var _str:String = inString;
			_str = twttrStripName(_str);
			_str = twttrConvertHTTP(_str);
			_str = twttrConvertMention(_str);
			_str = twttrConvertHashtag(_str);
			_str = twttrConvertSmileys(_str);
			return _str;
		}

		// remove the writers name from the tweet
		private function twttrStripName (inString:String):String
		{
			var _str:String = inString;
			var _charNumber:Number = _str.indexOf(&quot;:&quot;);
			return _str.substr(_charNumber + 2);
		}

		// convert http-strings to links
		private function twttrConvertHTTP(inString:String):String
		{
			var _str:String = inString;
			var _array:Array = _str.split(&quot; &quot;);
			for (var i:int = 0; i &lt; _array.length; i++)
			{
				var _str2:String = twttrStripChar(_array[i]);
				if (_array[i].indexOf(&quot;http&quot;) != -1)
				{
					_array[i] = &quot;&lt;u&gt;&lt;a href='&quot; + _str2 + &quot;' target='_blank'&gt;&quot; +_array[i] + &quot;&lt;/a&gt;&lt;/u&gt;&quot;;
				}
			}
			return _array.join(&quot; &quot;);
		}

		// convert mentions (@) to links
		private function twttrConvertMention(inString:String):String
		{
			var _str:String = inString;
			var _array:Array = _str.split(&quot; &quot;);
			for (var i:int = 0; i &lt; _array.length; i++)
			{
				var _str2:String = twttrStripChar(_array[i]);
				if (_array[i].substr(0, 1) == &quot;@&quot;)
				{
					_array[i] = &quot;&lt;u&gt;&lt;a href='http://www.twitter.com/&quot; + _str2.split(&quot;@&quot;)[1] + &quot;' target='_blank'&gt;&quot; +_array[i] + &quot;&lt;/a&gt;&lt;/u&gt;&quot;;
				}
			}
			return _array.join(&quot; &quot;);
		}

		// convert hashtags (#) to links
		private function twttrConvertHashtag(inString:String):String
		{
			var _str:String = inString;
			var _array:Array = _str.split(&quot; &quot;);
			for (var i:int = 0; i &lt; _array.length; i++)
			{
				var _str2:String = twttrStripChar(_array[i]);
				if (_array[i].substr(0, 1) == &quot;#&quot;)
				{
					_array[i] = &quot;&lt;u&gt;&lt;a href='http://twitter.com/search?q=%23&quot; + _str2.split(&quot;#&quot;)[1] + &quot;' target='_blank'&gt;&quot; +_array[i] + &quot;&lt;/a&gt;&lt;/u&gt;&quot;;
				}
			}
			return _array.join(&quot; &quot;);
		}		

		// TODO: [mck] convert <img src='http://www.matthijskamstra.nl/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  to a smiley image
		private function twttrConvertSmileys(inString:String):String
		{
			var _str:String = inString;
			return _str;
		}

		// remove &quot;strange&quot; characters from the end of the string
		private function twttrStripChar(inString:String):String
		{
			var _str:String = inString;
			var _charArray:Array = [',', ';', ':', ' ', '-', '_'];
			for (var i:int = 0; i &lt; _charArray.length; i++)
			{
				if (_str.charAt(_str.length - 1) == _charArray[i]) {
					_str = _str.substr(0, _str.length - 1);
				}
			}
			return _str;
		}

	} // end class

} // end package
</pre>
<p>Currently I have only this proof of concept, but soon I will post the example on <a href="http://www.emceekay.nl">emceekay.nl</a>&#8230;</p>
<p>Because this is part one of what I want to do, and don&#8217;t want to search for every link again, I&#8217;m posting also the WordPress link here (it&#8217;s just because I&#8217;m lazy).</p>
<p>So here the feeds I will be using:</p>
<ul>
<li><a href="http://twitter.com/statuses/user_timeline/27657030.rss" title="Matthijs Kamstra - Twitter - rss" rel="alternate" type="application/rss+xml">Matthijs Kamstra &#8211; Twitter &#8211; rss</a></li>
<li><a href="http://www.matthijskamstra.nl/blog/wp-rss2.php?cat=11" title="[mck] Urban papercraft RSS feed" rel="alternate" type="application/rss+xml">All Urban papercraft posts</a></li>
</ul>

	<h4 class='swf-title'>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.matthijskamstra.nl/blog/index.php/2006/07/09/why-do-i-need-metadata/" title="Why do I need MetaData? (July 9, 2006)">Why do I need MetaData?</a> (0)</li>
	<li><a href="http://www.matthijskamstra.nl/blog/index.php/2009/09/03/what-a-flash-actionscript-developer-needs-to-know/" title="What a Flash / ActionScript Developer needs to know (September 3, 2009)">What a Flash / ActionScript Developer needs to know</a> (0)</li>
	<li><a href="http://www.matthijskamstra.nl/blog/index.php/2009/09/10/urban-paper-tokyo-show/" title="Urban Paper Tokyo Show (September 10, 2009)">Urban Paper Tokyo Show</a> (0)</li>
	<li><a href="http://www.matthijskamstra.nl/blog/index.php/2008/07/16/upgrading-wordpress-26/" title="Upgrading WordPress 2.6 (July 16, 2008)">Upgrading WordPress 2.6</a> (0)</li>
	<li><a href="http://www.matthijskamstra.nl/blog/index.php/2007/07/11/uncomment-trace-jsfl/" title="Uncomment trace JSFL (July 11, 2007)">Uncomment trace JSFL</a> (0)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.matthijskamstra.nl/blog/index.php/2009/12/30/twitter-rss-reader-in-flash-as3/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>What a Flash / ActionScript Developer needs to know</title>
		<link>http://www.matthijskamstra.nl/blog/index.php/2009/09/03/what-a-flash-actionscript-developer-needs-to-know/</link>
		<comments>http://www.matthijskamstra.nl/blog/index.php/2009/09/03/what-a-flash-actionscript-developer-needs-to-know/#comments</comments>
		<pubDate>Thu, 03 Sep 2009 09:10:36 +0000</pubDate>
		<dc:creator>Matthijs Kamstra</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[flash developer]]></category>

		<guid isPermaLink="false">http://www.matthijskamstra.nl/blog/?p=1130</guid>
		<description><![CDATA[Yesterday I saw this post in my RSS feeds, and I just want to remember this (and make sure that I&#8217;m really a senior ) So here is a list of stuff you need to know when you say you are a senior Flash/ActionScript developer: http://pv3d.org/2009/08/28/10-things-every-senior-flash-developer-should-know/ I don&#8217;t like to regurgitate so I only show [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday I saw this post in my RSS feeds, and I just want to remember this (and make sure that I&#8217;m really a senior <img src='http://www.matthijskamstra.nl/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  )</p>
<p>So here is a list of stuff you need to know when you say you are a senior Flash/ActionScript developer:<br />
<a href="http://pv3d.org/2009/08/28/10-things-every-senior-flash-developer-should-know/">http://pv3d.org/2009/08/28/10-things-every-senior-flash-developer-should-know/</a></p>
<p>I don&#8217;t like to regurgitate so I only show you the top 10, for examples visit the list by <a href="http://pv3d.org/2009/08/28/10-things-every-senior-flash-developer-should-know/">John Lindquist</a></p>
<ol>
<li>The Elastic Racetrack</li>
<li>FlexSDK, mxmlc, compc, and all that jazz</li>
<li>Player Events, Custom Events, Event Bubbling</li>
<li>Statements, Keywords, and Directives</li>
<li>ASDoc</li>
<li>Managing visual assets (images, fonts, CSS, etc)</li>
<li>Arrays, Collections, Dictionaries, Mapping</li>
<li>Programmatic motion (tweening, easing)</li>
<li>OOP and Coding Against Frameworks</li>
<li>Version control</li>
</ol>
<p>And after reading this I remembered gskinner had a similar list:<br />
<a href="http://www.gskinner.com/blog/archives/2009/07/flash_actionscr.html">http://www.gskinner.com/blog/archives/2009/07/flash_actionscr.html</a></p>
<p>This is a bigger list and a lot of comments, so you need to visit the list and read it and all its comments</p>
<p>Another post about the subject: &#8220;Things Every Flash Developer Should Know&#8221; &#8211;> <a href="http://gskinner.com/talks/things/">http://gskinner.com/talks/things/</a></p>

	<h4 class='swf-title'>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.matthijskamstra.nl/blog/index.php/2008/03/19/xml-reader-flash-panel-todo-and-requests/" title="XML Reader Flash panel &#8211; Todo and Requests (March 19, 2008)">XML Reader Flash panel &#8211; Todo and Requests</a> (2)</li>
	<li><a href="http://www.matthijskamstra.nl/blog/index.php/2007/05/21/xml-reader-flash-panel/" title="XML Reader Flash panel (May 21, 2007)">XML Reader Flash panel</a> (3)</li>
	<li><a href="http://www.matthijskamstra.nl/blog/index.php/2006/07/09/why-do-i-need-metadata/" title="Why do I need MetaData? (July 9, 2006)">Why do I need MetaData?</a> (0)</li>
	<li><a href="http://www.matthijskamstra.nl/blog/index.php/2007/10/31/urban-papercraft-papercritters/" title="Urban papercraft: Papercritters (October 31, 2007)">Urban papercraft: Papercritters</a> (3)</li>
	<li><a href="http://www.matthijskamstra.nl/blog/index.php/2007/07/11/uncomment-trace-jsfl/" title="Uncomment trace JSFL (July 11, 2007)">Uncomment trace JSFL</a> (0)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.matthijskamstra.nl/blog/index.php/2009/09/03/what-a-flash-actionscript-developer-needs-to-know/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My first AIR app: SWF2GIF-banner &#8211; part 1</title>
		<link>http://www.matthijskamstra.nl/blog/index.php/2009/08/12/my-first-air-app-swf2gif-banner-part-1/</link>
		<comments>http://www.matthijskamstra.nl/blog/index.php/2009/08/12/my-first-air-app-swf2gif-banner-part-1/#comments</comments>
		<pubDate>Wed, 12 Aug 2009 08:00:53 +0000</pubDate>
		<dc:creator>Matthijs Kamstra</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[animated gif]]></category>
		<category><![CDATA[flashdevelop]]></category>
		<category><![CDATA[sdk]]></category>
		<category><![CDATA[SWF]]></category>

		<guid isPermaLink="false">http://www.matthijskamstra.nl/blog/?p=1040</guid>
		<description><![CDATA[Sometimes, and I&#8217;m not very fond of them, I need to make banners&#8230;.. The animation part is not so bad, but making the different sizes&#8230;. that can be a drag. And after you made the SWF banners, you also need to make the animation in GIF. This is how I use to do it: make [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes, and I&#8217;m not very fond of them, I need to make banners&#8230;..<br />
The animation part is not so bad, but making the different sizes&#8230;. that can be a drag.<br />
And after you made the SWF banners, you also need to make the animation in GIF.</p>
<p>This is how I use to do it: </p>
<ol>
<li>make the SWF banner</li>
<li>embed it in a html page with a background color that is not in the banner itself (a border around the SWF banner helps)</li>
<li>make snapshots of the animation</li>
<li>open photoshop >> (I used a action for this part&#8230;.)</li>
<li>place all the images in one document</li>
<li>cut the browser from the screenshot</li>
<li>select the background-color reverse the selection and cut</li>
<li>make a animation from all the layers (end photoshop action)</li>
<li>save</li>
</ol>
<p>I have never made an AIR application but I think that it should be possible to make a SWF2GIF converter in AIR.</p>
<p>Stuff what I need to find out:</p>
<ul>
<li>browse for a file</li>
<li>load that file into air</li>
<li>take snapshots of the animation</li>
<li>controle the frame rate of the animation</li>
<li>make a animated gif </li>
<li>save everything</li>
<li>etc.</li>
</ul>
<p><strong>Lets start with some basic:</strong><br />
I&#8217;m still working on CS3, and it seems that AIR default is installed with CS4<br />
Installing the Adobe AIR update for Flash CS3</p>
<p>English: <a href="http://help.adobe.com/en_US/AIR/1.5/devappsflash/WS5b3ccc516d4fbf351e63e3d118666ade46-7fc3.html" class="broken_link">http://help.adobe.com/en_US/AIR/1.5/devappsflash/WS5b3ccc516d4fbf351e63e3d118666ade46-7fc3.html</a><br />
Dutch: <a href="http://help.adobe.com/nl_NL/AIR/1.5/devappsflash/WS5b3ccc516d4fbf351e63e3d118666ade46-7fc3.html">http://help.adobe.com/nl_NL/AIR/1.5/devappsflash/WS5b3ccc516d4fbf351e63e3d118666ade46-7fc3.html</a></p>
<p>You can also use FlashDevelop 3.0.1, AIR is also installed with that program and in combination with Flex sdk you don&#8217;t even need Flash.</p>
<p>Because I&#8217;m not finished with it (I will only work on it when I have to build banners) I will post now and then some parts of the code.</p>
<p>For some reason I couldn&#8217;t find the code to load SWF into AIR using &#8220;browse&#8221;.</p>
<pre class="brush: as3; light: false; wrap-lines: true;">
private function openSwfFile(e:MouseEvent = null):void
{
	var imagesFilter:FileFilter = new FileFilter(&quot;Flash SWF&quot;, &quot;*.swf&quot;);
	myFile = new File();
	myFile.addEventListener(Event.SELECT, selectHandler);
	myFile.browseForOpen(&quot;Open&quot;, [imagesFilter]);
}

private function selectHandler(event:Event):void
{
	myFile.removeEventListener(Event.SELECT, selectHandler);
	loadSWF(myFile.url);
}

private function loadSWF(inName:String):void
{
	trace( &quot;Main.loadSWF &gt; inName : &quot; + inName );
	mLoader = new Loader();
	mLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoaderComplete);
	mLoader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, onErrorComplete);
	mLoader.load(new URLRequest(inName));
}
private function onLoaderComplete(e:Event):void { startOnEnterFrameHandler(); }
private function onErrorComplete(e:IOErrorEvent):void { trace( &quot;Main.onErrorComplete &gt; e : &quot; + e ); }

private function startOnEnterFrameHandler():void
{
	_movie.addChild(mLoader);
	// _movie.addEventListener(Event.ENTER_FRAME , onEnterFrameHandler);
}
</pre>
<p>just use a button to activate.</p>
<p>I know the code is not complete&#8230; and that some classes have strange names&#8230; it&#8217;s work in progress.</p>

	<h4 class='swf-title'>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.matthijskamstra.nl/blog/index.php/2008/03/19/xml-reader-flash-panel-todo-and-requests/" title="XML Reader Flash panel &#8211; Todo and Requests (March 19, 2008)">XML Reader Flash panel &#8211; Todo and Requests</a> (2)</li>
	<li><a href="http://www.matthijskamstra.nl/blog/index.php/2007/05/21/xml-reader-flash-panel/" title="XML Reader Flash panel (May 21, 2007)">XML Reader Flash panel</a> (3)</li>
	<li><a href="http://www.matthijskamstra.nl/blog/index.php/2006/07/09/why-do-i-need-metadata/" title="Why do I need MetaData? (July 9, 2006)">Why do I need MetaData?</a> (0)</li>
	<li><a href="http://www.matthijskamstra.nl/blog/index.php/2009/09/03/what-a-flash-actionscript-developer-needs-to-know/" title="What a Flash / ActionScript Developer needs to know (September 3, 2009)">What a Flash / ActionScript Developer needs to know</a> (0)</li>
	<li><a href="http://www.matthijskamstra.nl/blog/index.php/2007/10/31/urban-papercraft-papercritters/" title="Urban papercraft: Papercritters (October 31, 2007)">Urban papercraft: Papercritters</a> (3)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.matthijskamstra.nl/blog/index.php/2009/08/12/my-first-air-app-swf2gif-banner-part-1/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Six screens Flash animation</title>
		<link>http://www.matthijskamstra.nl/blog/index.php/2009/07/29/six-screens-flash-animation/</link>
		<comments>http://www.matthijskamstra.nl/blog/index.php/2009/07/29/six-screens-flash-animation/#comments</comments>
		<pubDate>Wed, 29 Jul 2009 08:00:21 +0000</pubDate>
		<dc:creator>Matthijs Kamstra</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flash experiments]]></category>
		<category><![CDATA[adobe flash]]></category>
		<category><![CDATA[flash animation]]></category>
		<category><![CDATA[flash application]]></category>
		<category><![CDATA[fullscreen]]></category>
		<category><![CDATA[kiosk]]></category>
		<category><![CDATA[monitors]]></category>
		<category><![CDATA[multimedia installations]]></category>
		<category><![CDATA[screens]]></category>

		<guid isPermaLink="false">http://www.matthijskamstra.nl/blog/?p=1058</guid>
		<description><![CDATA[I currently working on a project where a Flash Application is played on six (6!) screens. The screens are 1366&#215;768 which must be (a least mine) the biggest Flash animation (8196px wide and 768pixels high) The problem with Flash is that it will not go full-screen on more then on screen. With some hacking you [...]]]></description>
			<content:encoded><![CDATA[<p>I currently working on a project where a Flash Application is played on six (6!) screens.<br />
The screens are 1366&#215;768 which must be (a least mine) the biggest Flash animation (8196px wide and 768pixels high)<br />
The problem with Flash is that it will not go full-screen on more then on screen. With some <a href="http://www.gavinr.com/2009/04/18/dual-monitors-full-screen-flash/">hacking</a> you can get it to open full-screen on your secondary monitor but not 2 monitors.</p>
<p>I hoped to find the solution in AIR, but that has a 2880px limit (<a href="http://bugs.adobe.com/jira/browse/SDK-14431">read here</a>)</p>
<p>After some googling I found <a href="http://gizmoware.net/flashdancer/">Flash Dancer by Gizmoware</a>.</p>
<p><img src="http://gizmoware.net/flashdancer/screencap1.jpg" alt="Flash Dancer by Gizmoware" /></p>
<p>And who can explain it better then the <strong>Flash Dancer</strong> creator himself:</p>
<blockquote><p>Flash Dancer gives Adobe Flash multi-monitor support. Want to play your Flash file fullscreen on monitor 2? Now you can. Want it to span fullscreen over 4 monitors? No problem with Flash Dancer. This is extremely useful in kiosk type applications, large scale multimedia installations, restaurants displaying menus on remote monitors, etc. Its been confirmed to work on a 6 monitor setup without a burp.</p></blockquote>
<p><em>(I&#8217;m the one that has confirmed that it works on Vista and on 6 monitors <img src='http://www.matthijskamstra.nl/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  )</em></p>
<p>So what can I tell more:</p>
<pre class="brush: as3; highlight: [4]; light: false; wrap-lines: true;">
// Specifies that the size of the application be fixed, so that it remains unchanged even as the size of the player window changes.
stage.scaleMode 	= StageScaleMode.NO_SCALE;
stage.align 		= StageAlign.TOP_LEFT;
stage.quality 	= StageQuality.LOW; // important: the image will be cut off when you use HIGH
</pre>
<p>And of course you need to tile a pattern, but I&#8217;ll leave that up to you.</p>

	<h4 class='swf-title'>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.matthijskamstra.nl/blog/index.php/2008/03/19/xml-reader-flash-panel-todo-and-requests/" title="XML Reader Flash panel &#8211; Todo and Requests (March 19, 2008)">XML Reader Flash panel &#8211; Todo and Requests</a> (2)</li>
	<li><a href="http://www.matthijskamstra.nl/blog/index.php/2007/05/21/xml-reader-flash-panel/" title="XML Reader Flash panel (May 21, 2007)">XML Reader Flash panel</a> (3)</li>
	<li><a href="http://www.matthijskamstra.nl/blog/index.php/2006/07/09/why-do-i-need-metadata/" title="Why do I need MetaData? (July 9, 2006)">Why do I need MetaData?</a> (0)</li>
	<li><a href="http://www.matthijskamstra.nl/blog/index.php/2009/09/03/what-a-flash-actionscript-developer-needs-to-know/" title="What a Flash / ActionScript Developer needs to know (September 3, 2009)">What a Flash / ActionScript Developer needs to know</a> (0)</li>
	<li><a href="http://www.matthijskamstra.nl/blog/index.php/2007/10/31/urban-papercraft-papercritters/" title="Urban papercraft: Papercritters (October 31, 2007)">Urban papercraft: Papercritters</a> (3)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.matthijskamstra.nl/blog/index.php/2009/07/29/six-screens-flash-animation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FlashDevelop 3.0.0 released</title>
		<link>http://www.matthijskamstra.nl/blog/index.php/2009/06/17/flashdevelop-3-0-0-released/</link>
		<comments>http://www.matthijskamstra.nl/blog/index.php/2009/06/17/flashdevelop-3-0-0-released/#comments</comments>
		<pubDate>Wed, 17 Jun 2009 20:23:05 +0000</pubDate>
		<dc:creator>Matthijs Kamstra</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Open source / Freeware]]></category>
		<category><![CDATA[Tools of the trade]]></category>
		<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[actionscript 2]]></category>
		<category><![CDATA[actionscript 3]]></category>
		<category><![CDATA[AS2]]></category>
		<category><![CDATA[flashdevelop]]></category>
		<category><![CDATA[FlashDeveloper]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[SE|PY]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.matthijskamstra.nl/blog/?p=1035</guid>
		<description><![CDATA[My favorite open source project ever, FlashDevelop has released: FlashDevelop 3.0.0 RTM (English, 4MB) . I started with coding in the Flash IDE, when I realized that there are better programs to code in I started working with SE&#124;PY (ActionScript 2 only). I really loved that program, but it never made it to ActionScript 3 [...]]]></description>
			<content:encoded><![CDATA[<p>My favorite open source project ever, <a href='http://www.flashdevelop.org/wikidocs/index.php?title=Main_Page'>FlashDevelop</a> has released: FlashDevelop 3.0.0 RTM (English, 4MB) .</p>
<p>I started with coding in the Flash IDE, when I realized that there are better programs to code in I started working with SE|PY (ActionScript 2 only). I really loved that program, but it never made it to ActionScript 3 and so I tried FlashDevelop. I have never regretted it, it a beautiful piece of work and I can&#8217;t work without it.<br />
So if your pockets aren&#8217;t deep, and want to become a better AS2/AS3 programmer. you should try this program. </p>
<p>The only sad thing is that it&#8217;s Windows only.</p>
<p><img src="http://flashdevelop.org/wikidocs/images/tour/0a-interface.png" width="500px" alt="" /></p>

	<h4 class='swf-title'>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.matthijskamstra.nl/blog/index.php/2007/01/28/wordpress-sociable-plugin/" title="WordPress Sociable plugin (January 28, 2007)">WordPress Sociable plugin</a> (1)</li>
	<li><a href="http://www.matthijskamstra.nl/blog/index.php/2006/07/09/why-do-i-need-metadata/" title="Why do I need MetaData? (July 9, 2006)">Why do I need MetaData?</a> (0)</li>
	<li><a href="http://www.matthijskamstra.nl/blog/index.php/2007/10/31/urban-papercraft-papercritters/" title="Urban papercraft: Papercritters (October 31, 2007)">Urban papercraft: Papercritters</a> (3)</li>
	<li><a href="http://www.matthijskamstra.nl/blog/index.php/2007/07/11/uncomment-trace-jsfl/" title="Uncomment trace JSFL (July 11, 2007)">Uncomment trace JSFL</a> (0)</li>
	<li><a href="http://www.matthijskamstra.nl/blog/index.php/2006/05/20/slideshow-v10/" title="SlideShow v1.0 (May 20, 2006)">SlideShow v1.0</a> (1)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.matthijskamstra.nl/blog/index.php/2009/06/17/flashdevelop-3-0-0-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Updated Syntaxhighlighter</title>
		<link>http://www.matthijskamstra.nl/blog/index.php/2009/05/06/updated-syntaxhighlighter/</link>
		<comments>http://www.matthijskamstra.nl/blog/index.php/2009/05/06/updated-syntaxhighlighter/#comments</comments>
		<pubDate>Wed, 06 May 2009 08:00:21 +0000</pubDate>
		<dc:creator>Matthijs Kamstra</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[Open source / Freeware]]></category>
		<category><![CDATA[WordPress Plugin]]></category>
		<category><![CDATA[AS2]]></category>
		<category><![CDATA[syntax highlighter]]></category>
		<category><![CDATA[upgrading]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.matthijskamstra.nl/blog/?p=946</guid>
		<description><![CDATA[Update #1: hmmmm, stupid but I write these post sometimes weeks ahead&#8230;. and this one caught up on me&#8230; The new version of SyntaxHighlighter Evolved has ActionScript support.. Update #2: I could remove everything below, but I&#8217;m keeping this here, perhaps someone can use it&#8230;. and it took some time to write, so I really [...]]]></description>
			<content:encoded><![CDATA[<div class="update"><strong>Update #1:</strong> hmmmm, stupid but I write these post sometimes weeks ahead&#8230;. and this one caught up on me&#8230; The new version of SyntaxHighlighter Evolved has ActionScript support.. <img src='http://www.matthijskamstra.nl/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </div>
<div class="update"><strong>Update #2:</strong> I could remove everything below, but I&#8217;m keeping this here, perhaps someone can use it&#8230;. and it took some time to write, so I really can&#8217;t kill my darlings.</p>
<p>A little change I made to the new updated plugin:<br />
find the plugin-folder &#8220;syntaxhighlighter&#8221; and add the next line to &#8220;syntaxhighlighter.php&#8221;</p>
<pre class="brush: as3; highlight: [1,3];">
'as' 			=&gt; 'as3',
'as3'           =&gt; 'as3',
'actionscript'  =&gt; 'as3',
'actionscript3' =&gt; 'as3',
</pre>
<p><strong>and</strong> find in the plugin-folder &#8220;syntaxhighlighter&#8221;, the folder &#8220;scripts&#8221; and change the next line to &#8220;shBrushAS3.js&#8221;</p>
<pre class="brush: as3;">
// SyntaxHighlighter.brushes.AS3.aliases	= ['actionscript3', 'as3']; // old line and the bottom of the .js file
SyntaxHighlighter.brushes.AS3.aliases	= ['actionscript3','actionscript', 'as3', 'as']; // new line
</pre>
<p>the new syntaxhighlighter only uses &#8220;<code>as3</code>&#8221; and &#8220;<code>actionscript3</code>&#8220;, and I just changed all my post to &#8220;<code>as</code>&#8221;
</div>
<div class="update"><strong>Update #3:</strong> and update the css, that made the code not wrap&#8230;.<br />
I removed &#8220;white-space: pre;&#8221; form &#8220;code&#8221; and now it wraps:</p>
<pre class="brush: css;">
code  { font-family: &quot;Courier New&quot;, Courier, monospace; font-size: 1.2em; /*white-space: pre;*/ color: Gray; }
</pre>
</div>
<p>Today I updated my <a href="http://alexgorbatchev.com/wiki/SyntaxHighlighter">SyntaxHighlighter JavaScript package by Alex Gorbatchev</a> and it was not easy&#8230;</p>
<p>I have a syntax highlighter installed on my blog to show my ActionScript source code in a nice way.<br />
But the first time I installed it, I choose a WordPress plugin which isn&#8217;t add to <a href="http://wordpress.org/extend/plugins/">WordPress Plugin Directory</a>and doesn&#8217;t appear to be update.<br />
And if I remember correctly, it didn&#8217;t work as it should and I had to add ActionScript. Read my previous decision <a href="http://www.matthijskamstra.nl/blog/index.php/2008/06/04/actionscript-syntax-highlighting/">here</a>.<br />
So I had to upgrade to <a href="http://wordpress.org/extend/plugins/syntaxhighlighter/">SyntaxHighlighter Evolved</a> which of course came with some upgrading issues created by my previous install.</p>
<p>First problem: write ActionScript.<br />
ActionScript is not default included in the Syntaxhighter, and you will be advised to use <code>[ javascript ]</code> tag, which is a good advice since AS is almost javascript. It would make your live easier if you choose this option.<br />
But as in my last installment of syntaxhighlighter I want to use Actionscript highlighting.<br />
So there we go:<br />
To do that you need an Actionscript brush. I found two of them: <a href="http://www.cptloadtest.com/CategoryView,category,Flash.aspx">cptloadtest.com</a> has one but it looks like its more for AS2,<br />
and <a href="http://yourpalmark.com/2009/02/17/as3-syntax-highlighting-with-syntaxhighlighter-20/">yourpalmark.com</a> which is also the one I choose, because I used his version also with my previous installment and it&#8217;s for AS3.</p>
<p>This is what you need to do: install SyntaxHighlighter and if you choose to use <code>[ javascript ]</code><br />
your done. I was not done yet, so lets continue&#8230; Download <a href="http://yourpalmark.com/2009/02/17/as3-syntax-highlighting-with-syntaxhighlighter-20/">the shBrushAS3.zip</a>, extract and place the <code>shBrushAS3.js</code> in the correct folder on the server (in my case <code>.../wp-content/plugins/syntaxhighlighter/syntaxhighlighter/scripts</code>). Now you need to change some code in the WordPress plugin:<br />
You can do this in WordPress itself if you have writing permission set, or you can edit the php file on your desktop&#8230;<br />
you need to add the highlighted code </p>
<pre class="brush: as3; highlight: [3]; light: true;">
// Register brush scripts
wp_register_script( 'syntaxhighlighter-core', plugins_url('syntaxhighlighter/syntaxhighlighter/scripts/shCore.js'), array(), $this-&gt;agshver );
wp_register_script( 'syntaxhighlighter-brush-actionscript3', plugins_url('syntaxhighlighter/syntaxhighlighter/scripts/shBrushAS3.js'), array('syntaxhighlighter-core'), $this-&gt;agshver);
</pre>
<p>and </p>
<pre class="brush: as3; highlight: [3,4,5,6];">
// Create list of brush aliases and map them to their real brushes
$this-&gt;brushes = apply_filters( 'syntaxhighlighter_brushes', array(
	'as'       =&gt; 'actionscript3',
	'as2'       =&gt; 'actionscript3',
	'as3'       =&gt; 'actionscript3',
	'actionscript'       =&gt; 'actionscript3',
	'bash'       =&gt; 'bash',
</pre>
<p>and now you are ready to go.</p>
<p>I had to change some other stuff (<code>[ source:as ]...[ /source ]</code> into <code>[ as ]...[ /as ]</code> ) and it seems that my css is not playing nice with syntaxhighlighter. hmmmm this is more work then I thought it would be.</p>
<p>I had to deactivate one plugin: <a href="http://priyadi.net/archives/2005/09/27/wordpress-plugin-code-autoescape/">autoescape</a> , it didn&#8217;t play nice with SyntaxHightlighter. I didn&#8217;t use it anymore, and the combination generated gibberish.</p>

	<h4 class='swf-title'>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.matthijskamstra.nl/blog/index.php/2008/03/19/xml-reader-flash-panel-todo-and-requests/" title="XML Reader Flash panel &#8211; Todo and Requests (March 19, 2008)">XML Reader Flash panel &#8211; Todo and Requests</a> (2)</li>
	<li><a href="http://www.matthijskamstra.nl/blog/index.php/2007/05/21/xml-reader-flash-panel/" title="XML Reader Flash panel (May 21, 2007)">XML Reader Flash panel</a> (3)</li>
	<li><a href="http://www.matthijskamstra.nl/blog/index.php/2007/01/28/wordpress-sociable-plugin/" title="WordPress Sociable plugin (January 28, 2007)">WordPress Sociable plugin</a> (1)</li>
	<li><a href="http://www.matthijskamstra.nl/blog/index.php/2010/01/06/twitter-rss-reader-part-2/" title="Twitter RSS reader &#8211; part 2 (January 6, 2010)">Twitter RSS reader &#8211; part 2</a> (1)</li>
	<li><a href="http://www.matthijskamstra.nl/blog/index.php/2008/08/06/shape-2-array-jsfl/" title="Shape 2 Array jsfl (August 6, 2008)">Shape 2 Array jsfl</a> (1)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.matthijskamstra.nl/blog/index.php/2009/05/06/updated-syntaxhighlighter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
