【问题标题】:actionscript 3 "A term is undefined and has no properties."actionscript 3“术语未定义且没有属性。”
【发布时间】:2017-08-24 08:32:39
【问题描述】:

这是我的错误

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

【问题讨论】:

  • 请勿将代码作为图片发布。在此处粘贴完整代码。

标签: actionscript-3 flash


【解决方案1】:

没错,URLVariables 的实例没有这样的成员,请查看以下规范:Adobe Documentation: URLVariables。 将 IOErrorEvent 侦听器添加到您的加载程序,如下所示:

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

请不要将您的代码作为屏幕截图发布。

【讨论】:

  • 抱歉这是我第一次在这里提问XD
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2017-03-19
  • 1970-01-01
  • 1970-01-01
  • 2022-07-12
  • 2016-11-21
  • 2014-05-10
  • 1970-01-01
相关资源
最近更新 更多