Index: SWF9External.java
===================================================================
--- SWF9External.java	(revision 9325)
+++ SWF9External.java	(working copy)
@@ -120,12 +120,23 @@
     // cleanup on error, and on success too.
 
     File f = null;
+    // Raju: Need to be able to configure the tmp folder for the AS3 code
+    // That way I can use a FlexBuilder project to debug the generated AS3 code
+    String customFolder = System.getProperty("as3tmpfolder");
     try {
-      String tmpdirstr = System.getProperty("java.io.tmpdir");
-      String swf9tmpdirstr = tmpdirstr + File.separator + WORK_DIR_PARENT;
-      (new File(swf9tmpdirstr)).mkdirs();
-        
-      f = File.createTempFile(WORK_DIR_PREFIX, "", new File(swf9tmpdirstr));
+      String swf9tmpdirstr = null;
+      // check if the custom folder exists
+      if (customFolder != null) {
+        System.out.println("Using custom folder " + customFolder + " for temporary AS3 files");
+        swf9tmpdirstr = customFolder + File.separator + "src";
+        f = new File(swf9tmpdirstr);
+        f.mkdirs();
+      } else {
+      	String tmpdirstr = System.getProperty("java.io.tmpdir");
+      	swf9tmpdirstr = tmpdirstr + File.separator + WORK_DIR_PARENT;
+        (new File(swf9tmpdirstr)).mkdirs();
+        f = File.createTempFile(WORK_DIR_PREFIX, "", new File(swf9tmpdirstr));
+      }
       if (!f.delete())
         throw new CompilerError("getCompilationWorkDir: temp file does not exist");
       if (!f.mkdir())
