加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > PHP教程 > 正文

php – ReferenceError:错误#1069:在String上找不到属性,没有

发布时间:2020-12-13 17:44:17 所属栏目:PHP教程 来源:网络整理
导读:我正在使用URLRequest在flash中加载外部php文件.但不幸的是我得到了这个错误 – ReferenceError: Error #1069:Property email not found on String and there is no default value. at Main/variablesGot() at flash.events::EventDispatcher/dispatchEventF
我正在使用URLRequest在flash中加载外部php文件.但不幸的是我得到了这个错误 –

ReferenceError: Error #1069:Property email not found on String and there is no default value.
    at Main/variablesGot()
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at flash.net::URLLoader/onComplete()

这是相关的as3代码

phpLoader.addEventListener(Event.COMPLETE,variablesGot);    
private function variablesGot(ev:Event):void

    {
        trace(ev.target.data.toString());  //THIS OUTPUTS CORRECTLY
        //OUTPUT for this trace is as follows
        //athleteName=ankur&email=email@yahoo.com&password=newpass&personalBest=9.58&shirtNumber=10         

        trace(ev.target.data.email.toString()); //LINE WITH ERROR
    }

这是我正在加载的php文件中的相关php代码

print "athleteName=".$_SESSION[athleteName];
print "&email=".$_SESSION[email];
print "&password=".$_SESSION[password];
print "&personalBest=".$_SESSION[personalBest];
print "&shirtNumber=".$_SESSION[shirtNumber];
print "&country=".$_SESSION[country];

我认为错误可能是由于我在php中打印的方式?但我不确定.

解决方法

默认情况下,URLLoader将数据作为文本加载,因此原始字符串上不存在电子邮件.尝试设置:

phpLoader.dataFormat = URLLoaderDataFormat.VARIABLES;

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读