"创建投影仪"的Flash Player命令行参数

Che*_*dev 5 apache-flex flash adobe actionscript-3

我希望使用Flash播放器中的"创建投影仪"选项自动执行从.swf文件创建.exe的任务.我试图使用ant构建文件来实现它.有人能指出我正确的方向.尝试搜索但没有找到flash播放器可用的命令行参数以及如何将.swf转换为.exe.

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

小智 -2

注意:被询问者确实喜欢这个答案:

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 **

  • @原件:SACKS,S
  • @notes:兼容 AS2 和 AS3,
  • @notes:基于脚手架框架
  • @github: https: //github.com/stevensacks/Gaia-Framework/wiki/_history
  • @notation:使用 JSFL:原文:更改发布配置文件设置:v2:SACKS:2008 年 3 月 26 日 //
  • @作者:埃迪·马丁内斯
  • @update:生成 .exe/投影仪
  • @使用:.as3 || .swf 文件加载器 || .jsfl
  • @修订:2013 年 7 月
  • @info:这是一个轻微的改变
  • @info:源自Gaia的JSFL脚手架的改动[Gaia的脚手架JSFL]
  • @framework: https: //github.com/stevensacks/Gaia-Framework/wiki/_history

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);
                }
}
Run Code Online (Sandbox Code Playgroud)