2017-08-24 55 views
-4

這是我的錯誤actionscript 3「一個術語未定義,並且沒有任何屬性。」

TypeError: Error #1010: A term is undefined and has no properties. 
    at p21_fla::MainTimeline/baba()[p21_fla.MainTimeline::frame1:24] 

這是導致錯誤的部分:

variables.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loaderIOErrorHandler); 

這是我的全部代碼

var variables:URLVariables = new URLVariables(); 
variables.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loaderIOErrorHandler); 
var varSend:URLRequest = new URLRequest("https://gteckids.000webhostapp.com/gteckids/login.php"); 
varSend.method = URLRequestMethod.POST; 
varSend.data = variables; 

function loaderIOErrorHandler(e:Event){ 
trace("Error loading image thumbnail"); 
} 

var varLoader:URLLoader = new URLLoader; 
varLoader.dataFormat = URLLoaderDataFormat.VARIABLES; 
varLoader.addEventListener(Event.COMPLETE, completeHandler) 

variables.Parent_Username = uname_txt.text; 
    variables.ParentPassword = pass_txt.text; 
    variables.sendRequest = "parse";  
    varLoader.load(varSend); 

function completeHandler(event:Event):void 
{ 


var phpVar1 = event.target.data.var1; 

if(phpVar1!="No"){ 
    btn_ok.visible = true ; 
    lis.visible = true; 
parent_id.text = phpVar1; 


} 


else{ 
    btn_okw.visible = true ; 
    lis1.visible = true; 
} 
} 
+1

請勿將代碼作爲圖像發佈。在這裏粘貼完整的代碼。 – poke

回答

2

這是正確的,URLVariables對象的實例不會有這樣的成員,請檢查以下規格:Adobe Documentation: URLVariables。 IOErrorEvent監聽器添加到您的裝載機如下:

... 
varLoader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loaderIOErrorHandler); 
... 

並請,從來沒有發表您的代碼截圖。

+1

抱歉,這是我第一次在這裏問問題XD –

相關問題