<p>Is there any way to have a binary compiled from an ActionScript 3 project print stuff to <em>stdout</em> when executed?</p>

<p>From what I've gathered, people have been going around this limitation by writing hacks that rely on local socket connections and AIR apps that write to files in the local filesystem, but that's pretty much it -- it's obviously not possible with the Flash Player and AIR runtimes from Adobe.</p>

<p>Is there any project (e.g. based on the Tamarin code) that is attempting to implement something that would provide this kind of functionality?</p>

[{'answer_id': 38936, 'author': 'Theo', 'author_id': 1109, 'author_profile': 'https://Stackoverflow.com/users/1109', 'pm_score': 2, 'selected': False, 'text': '<p>As you say, there\'s no Adobe-created way to do this, but you might have better luck with <a href="http://www.multidmedia.com/" rel="nofollow noreferrer">Zinc</a>, it is similar to AIR but provides real OS integration of Flash-based applications. Look though the <a href="http://www.multidmedia.com/support/livedocs/" rel="nofollow noreferrer">API docs</a>, there should be something there.</p>\n'}, {'answer_id': 67606, 'author': 'mikechambers', 'author_id': 10232, 'author_profile': 'https://Stackoverflow.com/users/10232', 'pm_score': 1, 'selected': False, 'text': '<p>If you are using a debug Flash Player, you can have the Flash Player log trace messages to a file on your system.</p>\n\n<p>If you want real time messages, then you could tail the file.</p>\n\n<p>More info:</p>\n\n<p><a href="http://blog.flexexamples.com/2007/08/26/debugging-flex-applications-with-mmcfg-and-flashlogtxt/" rel="nofollow noreferrer">http://blog.flexexamples.com/2007/08/26/debugging-flex-applications-with-mmcfg-and-flashlogtxt/</a></p>\n\n<p>mike chambers</p>\n\n<p>mesh@adobe.com</p>\n'}, {'answer_id': 324348, 'author': 'hasseg', 'author_id': 4111, 'author_profile': 'https://Stackoverflow.com/users/4111', 'pm_score': 1, 'selected': False, 'text': '<p><a href="http://code.google.com/p/redtamarin/" rel="nofollow noreferrer">Redtamarin</a> seems to be able to do this (even though it\'s still in its infancy):</p>\n\n<p>Contents of <code>test.as</code>:</p>\n\n<pre><code>import avmplus.System;\nimport redtamarin.version;\n\ntrace( "hello world" );\ntrace( "avmplus v" + System.getAvmplusVersion() );\ntrace( "redtamarin v" + redtamarin.version );\n</code></pre>\n\n<p>On the command line:</p>\n\n<pre><code>$ ./buildEXE.sh test.as \n\ntest.abc, 243 bytes written\ntest.exe, 2191963 bytes written\n\ntest.abc, 243 bytes written\ntest.exe, 2178811 bytes written\n\n$ ./test\nhello world\navmplus v1.0 cyclone (redshell)\nredtamarin v0.1.0.92\n</code></pre>\n'}, {'answer_id': 528831, 'author': 'David Lichteblau', 'author_id': 23370, 'author_profile': 'https://Stackoverflow.com/users/23370', 'pm_score': 4, 'selected': True, 'text': '<p>With AIR on Linux, it is easy to write to stdout, since the process can see its own file descriptors as files in /dev.</p>\n\n<p>For stdout, open <code>/dev/fd/1</code> or <code>/dev/stdout</code> as a <code>FileStream</code>, then write to that.</p>\n\n<p>Example:</p>\n\n<pre><code>var stdout : FileStream = new FileStream();\nstdout.open(new File("/dev/fd/1"), FileMode.WRITE);\nstdout.writeUTFBytes("test\\n");\nstdout.close();\n</code></pre>\n\n<p><strong>Note:</strong> See <a href="https://stackoverflow.com/questions/5552277/when-to-use-writeutf-and-writeutfbytes-in-bytearray-of-as3">this answer</a> for the difference between <code>writeUTF()</code> and <code>writeUTFBytes()</code> - the latter will avoid garbled output on stdout.</p>\n'}]
['https://Stackoverflow.com/questions/38651', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4111/']