title: Moving from Adobe Flash to FlashDevelop
body: <p>I'm developing a website which will need to communicate with an AIR application, I develop with javascript and don't know much about actionscript. I'm at the early stages of this and I'm using a trial of Adobe Flash to create some swf files which can communicate with javascript, the code from the Action window is as follows (most of it is bastardised from web examples):</p>
  
  <pre><code>import flash.external.ExternalInterface;
  
  var myText:String = "Example String";
  
  ExternalInterface.addCallback("sendOutput", sendStaticTextFromAS3);
  function sendStaticTextFromAS3():void {
      ExternalInterface.call("receiveTextFromAS3", myText);
  }
  </code></pre>
  
  <p>All this is doing is receiving a call from javascript and sending back a string and calling the function which will deal with it (it will become more complex).</p>
  
  <p>My problem is that Flash is going to expire soon, and to future proof the project without having to spend a lot on flash I want to move into FlashDevelop. As I don't need any objects on the stage all I need is to edit actionscript, so FlashDevelop is all I need. I create a new AS3 Project in FlashDevelop and I get given this code:</p>
  
  <pre><code>package 
  {
      import flash.display.Sprite;
      import flash.events.Event;
  
      /**
       * ...
       * @author Will Thomas
       */
      public class Main extends Sprite 
      {
  
          public function Main():void 
          {
              if (stage) init();
              else addEventListener(Event.ADDED_TO_STAGE, init);
          }
  
          private function init(e:Event = null):void 
          {
              removeEventListener(Event.ADDED_TO_STAGE, init);
              // entry point
          }
  
      }
  
  }
  </code></pre>
  
  <p>I'm guessing Adobe Flash adds this automatically when compiling the swf so I have no idea where my code is supposed to go, except to add the import flash.external.ExternalInterface; at the top?</p>
  
  <p>Any help would be much appreciated, hopefully it's a simple copy and paste thing.</p>
  
  <p>Thanks all.</p>