php - 引用错误 : Error #1069:Property not found on String and there is no default value

标签 php string actionscript-3 flash url

我正在使用 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 将数据加载为文本,因此 email 不存在于原始 String 中。尝试设置:

phpLoader.dataFormat = URLLoaderDataFormat.VARIABLES;

关于php - 引用错误 : Error #1069:Property not found on String and there is no default value,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15045215/

相关文章:

php - $this->{$key} 在 PHP 中是什么意思?

php - 使用共享主机并且无法访问网络根目录之外时,如何保护我的数据库凭据?

php - 删除括号之间的文本 PHP

java - 比较字符串时出现问题

css - Flex 3 - 样式未完全应用于 TabNavigator 中动态创建的选项卡

actionscript-3 - Adobe Air - 分析

flash - ActionScript 3 : get display object at pixel

在 DataTables $columns 数组中使用 date_diff() 函数时出现 PHP 错误

python - 将字符串的所有字母加 1

python - 如何从列表中的多个字符串中打印出 1 个字符串