title: Using code in both Actionscript3 and Javascript
body: <p>Here's an interesting architectural query. I have a piece of code that needs to run on the server (under Node.js) and on the client (in a Flash 10 app written with Actionscript 3). The code is mostly fairly intricate object manipulation, it doesn't make any API calls, and works fine in both contexts. </p>
  
  <p>So far the project is just a demo, so I've been happy to copy and paste the code into both places. But it might be quite interesting to move forward with this.</p>
  
  <p>So how would you do it?</p>
  
  <ul>
  <li><p>I assume there is no easy way to get the Flash SDK (has to build without an IDE) to read and do something useful with a .js file.</p></li>
  <li><p>My only thought is that I could write a code-generator that takes the .js file and places it in an ActionScript wrapper.</p></li>
  </ul>
  
  <p>Are there any obvious approaches that I've missed? </p>
  
  <hr>
  
  <p>Just to pre-empt an obvious answer, I know about cross-platform languages like Haxe.</p>