首页 > 代码库 > JSFL 获取当前脚本路径,执行其他脚本

JSFL 获取当前脚本路径,执行其他脚本

Application.jsfl为程序入口,导入其他jsfl

【Common.jsfl】function trace(){     fl.trace(Array.prototype.join.call(arguments, " "));}
【Application.jsfl】var JSFL_PATH = fl.scriptURI.substr(0,fl.scriptURI.lastIndexOf("/")+1);var included = {};function include(file) {     if (included[file]) { return; }     included[file] = true;     fl.runScript(JSFL_PATH + file + ".jsfl");}include("Common");trace("Common lib included");