2017-08-24 1 views
-4

Ceci est mon erreuractionscript 3 "Un terme n'est pas défini et n'a aucune propriété."

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

Ceci est la partie qui provoque une erreur:

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

Ceci est mon code complet

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

Ne postez pas de code en tant qu'image. Collez le code complet ici. – poke

Répondre

2

C'est vrai, une instance de URLVariables ne avoir un tel membre, vérifiez les spécifications suivantes: Adobe Documentation: URLVariables. Ajouter auditeur IOErrorEvent à votre chargeur comme suit:

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

Et s'il vous plaît, afficher jamais votre code comme une capture d'écran.

+1

désolé, c'est la première fois que je pose une question ici XD –