<?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>publicreative lab &#187; flash</title>
	<atom:link href="http://lab.publicreative.com/tag/flash/feed/" rel="self" type="application/rss+xml" />
	<link>http://lab.publicreative.com</link>
	<description></description>
	<lastBuildDate>Tue, 27 Jul 2010 15:59:54 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Node AMF</title>
		<link>http://lab.publicreative.com/2010/07/node-amf/</link>
		<comments>http://lab.publicreative.com/2010/07/node-amf/#comments</comments>
		<pubDate>Mon, 26 Jul 2010 17:48:32 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[amf]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://lab.publicreative.com/?p=210</guid>
		<description><![CDATA[We&#8217;ve been having some fun with NodeJS at Public recently, and I&#8217;ve been looking for excuses to get more involved with it. We do a lot of Flash work, and make a lot of games, so Flash remoting is something we do regularly. We prefer to use AMF over XML, so I looked around for [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve been having some fun with <a href="http://nodejs.org/" target="_blank">NodeJS</a> at Public recently, and I&#8217;ve been looking for excuses to get more involved with it. We do a lot of Flash work, and make a lot of games, so Flash remoting is something we do regularly. We prefer to use <a href="http://en.wikipedia.org/wiki/Action_Message_Format" target="_blank">AMF</a> over XML, so I looked around for a NodeJS module to see if we could work with AMF within Node. I figured Node might be a viable platform for creating simple multi-player back ends, or other real-time environments like chat rooms.</p>
<p>I failed to find an AMF library for Node, and I&#8217;m not hugely surprised; Flash is rather out of favour with today&#8217;s JavaScript gurus. Secretly pleased that I couldn&#8217;t find anything, I set about writing my own. It is also the first time I&#8217;ve put an open source project on Github.</p>
<p><a href="http://github.com/timwhitlock/node-amf/" target="_blank">See <strong>node-amf </strong>on Github</a><span id="more-210"></span></p>
<p>The current state of node-amf is that it&#8217;s <strong>not ready for production</strong>. I am experiencing errors in the pack and unpack functions which are taken from the excellent <a href="http://phpjs.org/" target="_blank">php.js</a> project. I hope to hear from the authors to rectify this.</p>
<p>[<strong>UPDATE</strong>] Now using <a href="http://jsfromhell.com/classes/binary-parser" target="_blank">this BinaryParser class</a> instead of the pack/unpack functions.</p>
<p>The examples in the Git repository are for a simple HTTP gateway &#8211; This is the standard way you&#8217;d use AMF to talk to PHP, for example. The next step is to see if it&#8217;s possible to work with persistent sockets carrying AMF packets. That could be pretty cool.</p>
]]></content:encoded>
			<wfw:commentRss>http://lab.publicreative.com/2010/07/node-amf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AMF command line utility</title>
		<link>http://lab.publicreative.com/2009/03/amf-command-line-utility/</link>
		<comments>http://lab.publicreative.com/2009/03/amf-command-line-utility/#comments</comments>
		<pubDate>Mon, 23 Mar 2009 14:23:07 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[amf]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[zend]]></category>

		<guid isPermaLink="false">http://lab.publicreative.com/?p=91</guid>
		<description><![CDATA[We do a lot of projects with AMF at Public, and historically we&#8217;ve used amfphp on our back end. On a current project however we are using Zend framework. The Zend_AMF module is the successor of the original amfphp project, but it is missing one really useful thing &#8211; it doesn&#8217;t have a service browser [...]]]></description>
			<content:encoded><![CDATA[<p>We do a lot of projects with <a href="http://en.wikipedia.org/wiki/Action_Message_Format" target="_blank">AMF</a> at Public, and historically we&#8217;ve used <a href="http://www.amfphp.org/">amfphp</a> on our back end. On a current project however we are using <a href="http://framework.zend.com/">Zend framework</a>. The <a href="http://framework.zend.com/manual/en/zend.amf.html">Zend_AMF</a> module is the successor of the original amfphp project, but it is missing one really useful thing &#8211; it doesn&#8217;t have a service browser like amfphp does. I appreciate that there is fairly good reason for this, but it is a super handy tool we&#8217;ve come quite used to having available.</p>
<p><strong>So what&#8217;s the problem?</strong></p>
<p>If your PHP developers  have to start work before your Flash developers, you may find yourself with a back end, but no front end, so how do you test everything works? Moreover, how do you develop the back end at all if you can&#8217;t send and receive requests from your AMF gateway?</p>
<p>I wrote a simple command line tool for testing AMF calls, so I thought I&#8217;d share it with you here:<br />
<a href="http://lab.publicreative.com/wp-content/uploads/2009/03/amf.tgz"><strong>Download the amf command line program</strong></a>, requires PHP 5.2 with the json extension enabled.</p>
<p>It&#8217;s a fairly crude tool, and cannot support class mapping, but it&#8217;s currently helping us out very nicely. If you like it, or would like to see any improvements, please post a comment.</p>
<p><span id="more-91"></span><strong>Usage</strong>:</p>
<p>Download and make sure you can execute the program</p>
<pre>&gt; wget http://lab.publicreative.com/wp-content/uploads/2009/03/amf.tgz
&gt; tar -xvzf amf.tgz
&gt; chmod u+x amf</pre>
<p>For each service you want to test, create a file containing three lines.<br />
1. The URL of your AMF service gateway<br />
2. The method you want to call, &lt;service&gt;.&lt;method&gt;<br />
3. The arguments to post to the service as a JSON array. This may go onto multiple lines</p>
<p>Here&#8217;s the bundled example in <em>example_test.txt</em></p>
<pre>http://mydomain.com/my/amf/gateway
MyServiceClass.MyMethod
[
  "Arguments in JSON format",
  "always as an array",
  { "objects": "are also legal" }
]</pre>
<p>To execute this test, pipe the file into the amf program as stdin, e.g.<code><br />
&gt; cat example_test.txt | ./amf</code></p>
<p>You should see the deserialized arguments you are about to post, then a hex dump of the request packet, and then hopefully the response, followed by the deserialized response data.</p>
]]></content:encoded>
			<wfw:commentRss>http://lab.publicreative.com/2009/03/amf-command-line-utility/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

