2011-08-15 46 views
0

我已經嘗試了整個週末來完成這項工作。 我想要做的是讓閃光從作爲文件的外部拉動作。ActionScript 2 - 請幫助外部AS文件

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); 
} 

}; 

任何幫助將不勝感激。

在此先感謝

回答

1

您是否試圖在運行時加載外部AS文件?這是不可能的 - 你必須將AS文件編譯成SWF文件,然後加載SWF文件。然後,父SWF可以調用子(加載的)SWF中的函數。

如果您在編譯時嘗試從外部文件加載AS,那就不同了 - 有兩種不同的方法:您可以「導入」或「包含」代碼。

http://www.jeffryhouser.com/index.cfm/2007/10/2/ActionScript-3-Imports-vs-Includes

+0

+1爲一個很好的,乾淨的參考鏈接! –