2012-08-28 39 views
5

我正在寻找使用Flash Player中的“创建投影机”选项从.swf文件创建.exe文件的自动化任务。我正在尝试使用一个ant构建文件来实现它。有人能指引我走向正确的方向吗?尝试搜索,但没有找到什么是Flash播放器可用的命令行参数,以及如何将.swf转换为.exe。“创建投影机”的Flash Player命令行参数

注意:需要使用Flash Player作为运行时,没有第三方播放器/解决方案。

+0

我不认为有创建投影机的命令行选项。它必须通过Flash Professional完成。我建议您考虑创建一个使用Captive Runtime功能创建exe的Adobe AIR应用程序。你应该可以通过命令行或ANT构建来完成。 – JeffryHouser

+0

@ www.Flextras.com您不需要Flash Professional创建投影机文件。它是Flash Player中的一个菜单选项,它允许您创建本机应用程序。我正在寻找一个Flash播放器的命令行参数,它可以将一个.swf文件作为命令行参数并输出一个.exe文件(如果是windows)或一个.app文件(如果是OSX)。 –

+0

我不知道Adobe仍然发布了独立播放器。尽管如此;我不相信这可以在命令行完成。我将重新提出使用Adobe AIR w/Captive Runtime的建议。 – JeffryHouser

回答

-2
 
Note: The Askee did like the answer:

SWF's as SWF's for EXE's.? I would say that is native to Adobe Flash, plus there has always been ANT 'Build Commands' -- as well as -- ITASCA in use for these processes (now deprecated). The main positive outcome for your situation is that I already had code that I used for something similar, so I added it to github - Take a look, it is very straightforward with comments and instructions: Note, the Application Manifest files along with custom **bat** files allow the /exe files to be generated from your action-script within **Main.as and application.xmL https://github.com/leonardo-m-mendevil/esexes.git **

function setPPS(F1, ActionVersion) 
{ 

     if (fl.fileExists(F1) 
     { 
       var _x, _f, _t, _d; 

       fl.openDocument(F1); 
       var file_n = F1.split("/").pop(); 
       var path_f = F1.split(file_n)[0].join("/"); 
        file_n = file_n.split(".")[0]; 
       var pt = path_f + "/_Profile_._x"; 
       fl.getDocumentDOM().exportPublishProfile(pt); 
       _x = FLfile.read(pt); 
       _f = _x.indexOf("<defaultNames>"); 
       _t = _x.indexOf("</defaultNames>"); 
       _d = _x.substring(_f, _t); 
       _x = _x.split(_d).join("<defaultNames>0"); 
       _f = _x.indexOf("<flashDefaultName>"); 
       _t = _x.indexOf("</flashDefaultName>"); 
       _d = _x.substring(_f, _t); 
       _x = _x.split(_d).join("<flashDefaultName>0"); 
       _f = _x.indexOf("<flashfile_n>"); 
       _t = _x.indexOf("</flashfile_n>"); 
       _d = _x.substring(_f, _t); 

       var p3i = "../"; 
       if (file_n.indexOf("/") > -1){ 
        var splitPath = file_n.split("/"); 
         splitPath.length--; 
        var i = splitPath.length; 
        while (i--) { p3i += "../"; } 
       } 
       _x = _x.split(_d).join("<flashfile_n>" + p3i + "deploy/" + file_n + ".swf"); 
       var types = {}; 
        types.projectorWinfile_n = "exe"; 
        for (var n in types) { 
         _f = _x.indexOf("<" + n + ">"); 
         _t = _x.indexOf("</" + n + ">"); 
         _d = _x.substring(_f, _t); 
         _x = _x.split(_d).join("<" + n + ">" + file_n + "." + types[n]); 
        } 

        _f = _x.indexOf("<ActionScriptVersion>"); 
        _t = _x.indexOf("</ActionScriptVersion>"); 
        _d = _x.substring(_f, _t); 
        _x = _x.split(_d).join("<ActionScriptVersion>" + ActionVersion); 
        _f = _x.indexOf("<PackageExportFrame>"); 
        _t = _x.indexOf("</PackageExportFrame>"); 
        _d = _x.substring(_f, _t); 
        _x = _x.split(_d).join("<PackageExportFrame>1"); 

        if (ActionVersion == 2) { 
         _f = _x.indexOf("<PackagePaths>"); 
         _t = _x.indexOf("</PackagePaths>"); 
        } else { 
         _f = _x.indexOf("<AS3PackagePaths>"); 
         _t = _x.indexOf("</AS3PackagePaths>"); 
        } 
        _d = _x.substring(_f, _t); 
        var cpt = "./"; 
        if (file_n.indexOf("/") > -1){ 
         cpt = ""; 
         var t4 = file_n.split("/"); 
          t4.length--; 
         var i = t4.length; 
         while (i--){ 
          cpt += "../"; 
         } 
        } 
        switch(ActionVersion){ 
         case 2:       
          _x = _x.split(_d).join("<PackagePaths>" + cpt + "classes"); 
         break; 
         case 3: 
          _x = _x.split(_d).join("<AS3PackagePaths>" + cpt + "classes"); 
        } 
        function writeAllDOM(xstrg,pt){ 
         FLfile.write(pt, xstrg); 
         fl.getDocumentDOM().importPublishProfile(pt); 
         fl.saveDocument(fl.getDocumentDOM(), cpt); 
         fl.getDocumentDOM().publish(); 
        } 

        FLfile.remove(fPath); 
       } 
} 
+0

-1;因为我不明白你在推荐什么。我不明白你的开场白。我不确定您会说Adobe Flash是原生的。我不确定ITASCA的缩写意思,也不确定你所说的是否被弃用。我不确定你的github代码应该完成什么;但我在该链接中看到的只是一个读我文件和一个许可证文件。您可以考虑重新编写这个答案,使其更具描述性。 – JeffryHouser

+0

作为贬低你的人;我想指定我不是原始的askee。不幸的是,我不明白你的修改后的答案比你原来的更好,所以我不愿意删除我的downvote。 – JeffryHouser

+1

你能否更新你的github链接,我没有在那里看到任何文件。另外,请你提一下如何运行它的步骤? –

0

我不知道有什么办法做到这一点,但万一有帮助,我想婆注意FlashDevelop能够挂接到Adobe Flash Pro中进行发布,但必须在Flash Pro中打开FLA。