AS3,Flash - 错误

时间:2012-09-30 16:02:01

标签: actionscript-3 flash

之后我让我的AS3向我的PHP发送变量我收到以下错误:

Error: Error #2101: The String passed to URLVariables.decode() must be a URL-encoded query     string containing name/value pairs.
    at Error$/throwError()
    at flash.net::URLVariables/decode()
    at flash.net::URLVariables()
    at flash.net::URLLoader/onComplete()
Cannot display source code at this location.

有什么想法对付这个吗? 只有直接从flash文件运行它才会发生这种情况?

这是因为我在我的机器上使用localhost来执行此操作吗?

1 个答案:

答案 0 :(得分:0)

这通常意味着从PHP传递回你的onComplete处理函数的信息没有按名称/值对格式化。

e.g。名称=标记

如果您打算返回PHP传递名称/值对,则应将URLLoader设置为:

yourLoaderName.dataFormat = URLLoaderDataFormat.VARIABLES;

或者如果响应不是名称/值对:

yourLoaderName.dataFormat = URLLoaderDataFormat.TEXT;