为什么flash jfsl命令找不到文件而它存在?

时间:2010-09-24 18:38:03

标签: flash

我有C:\ flash \ FlashApplication1 \ FlashApplication1 \ FlashApplication1.as

package {

    import flash.display.*;

    public class FlashApplication1 extends MovieClip {

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

和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');

在flash命令运行时运行jfsl时,它说它无法在第7行找到file:/// C:/flash/FlashApplication1/FlashApplication1/FlashApplication1.as(var doc = fl.openDocument(uri);)而它确实存在于该位置。你知道为什么以及如何解决这个问题吗?

我查看了openDocument上的官方文档 http://help.adobe.com/en_US/Flash/10.0_ExtendingFlash/WS5b3ccc516d4fbf351e63e3d118a9024f3f-7b97.html

它显示了一种奇怪的路径语法:

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

我尝试使用file:/// c |而不是file:/// c:但它也没有用。

1 个答案:

答案 0 :(得分:0)

openDocument用于打开FLA个文件。要打开AS文件,请改用openScript

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