我整个周末都试过这项工作。 我正在尝试做的是让flash从外部文件中提取动作脚本。
stop();
Stage.showMenu = false;
submit_ta.password = true;
myData = new LoadVars();
myData.onLoad = function() {
bypass = this.myVariable;
tempbypass = this.myTempVariable;
};
myData.load("auth_code.php");
submitBtn.onRelease = function() {
if (submit_ta.text == bypass) {
getURL("intro.html", "_self");
trace("rickyandkareine");
} else if (submit_ta.text == tempbypass) {
getURL("intro.html", "_self");
} else {
gotoAndStop(2);
}
};
非常感谢任何帮助。
提前致谢
答案 0 :(得分:1)
您是否尝试在运行时加载外部AS文件?这是不可能的 - 您必须将AS文件编译为SWF,然后加载SWF。然后父SWF可以调用子(加载)SWF中的函数。
如果您尝试在编译时从外部文件加载AS,那就不同了 - 有两种不同的方法:您可以“导入”或“包含”代码。
http://www.jeffryhouser.com/index.cfm/2007/10/2/ActionScript-3-Imports-vs-Includes