tags:

views:

9

answers:

1

I have C:\flash\FlashApplication1\FlashApplication1\FlashApplication1.as

package {

    import flash.display.*;

    public class FlashApplication1 extends MovieClip {

        public function FlashApplication1() {
            super();
        }
    }
}

and C:\flash\FlashApplication1\FlashApplication1\bin\Debug\FlashApplication1.jsfl

var uri = 'file:///C:/flash/FlashApplication1/FlashApplication1/FlashApplication1.as';
var swf = uri.substr(0, uri.length - 4) + '.swf';
var target = 'file:///C:/flash/FlashApplication1/FlashApplication1/bin/Debug/FlashApplication1.swf';
var doc = fl.openDocument(uri);
fl.compilerErrors.clear();
doc.publish();
if (FLfile.exists(swf)) {
   if (FLfile.exists(target)) {
      FLfile.remove(target);
   }
   FLfile.copy(swf, target);
   FLfile.remove(swf);
}
fl.compilerErrors.save('file:///C:/flash/FlashApplication1/FlashApplication1/bin/Debug/FlashApplication1.err');
FLfile.write('file:///C:/flash/FlashApplication1/FlashApplication1/bin/Debug/FlashApplication1.amethyst', 'done');

When running jfsl in flash command run it says it cannot find file:///C:/flash/FlashApplication1/FlashApplication1/FlashApplication1.as on line 7 (var doc = fl.openDocument(uri);) whereas it does exist at that location. Do you see why and how to fix this ?

I have looked at official doc on openDocument http://help.adobe.com/en_US/Flash/10.0_ExtendingFlash/WS5b3ccc516d4fbf351e63e3d118a9024f3f-7b97.html

it shows a weird path syntax:

var doc = fl.openDocument("file:///c|/Document.fla");

I tried to use file:///c| instead of file:///c: but it didn't work either.

A: 

openDocument is used to open FLA files. To open an AS file use openScript instead.

http://help.adobe.com/en_US/Flash/10.0_ExtendingFlash/WS5b3ccc516d4fbf351e63e3d118a9024f3f-7b95.html

Sam
I tried with OpenScript but still get the same error message ...