开发者

Error #2101: The String passed to URLVariables.decode() must be a URL-encoded

开发者 https://www.devze.com 2023-02-20 22:45 出处:网络
I have a problem in my code that I have no ideia how to fix. I have a AS file that needs to get variables out of a php form, and I keep getting this error:

I have a problem in my code that I have no ideia how to fix.

I have a AS file that needs to get variables out of a php form, and I keep getting this error:

Error #开发者_如何学运维2101: The String passed to URLVariables.decode() must be a URL-encoded query string containing name/value pairs.

Ill transcript the snippet of text that I believe isn't working correctly.

var myTextLoader:URLLoader = new URLLoader();
myTextLoader.dataFormat=URLLoaderDataFormat.VARIABLES;

myTextLoader.addEventListener(Event.COMPLETE, onLoaded);

function onLoaded(e:Event):void {
    trace(e.target.data.ID);
}

myTextLoader.load(new URLRequest("http://www.converter-vhs-para-dvd-video.info/GestaoCCBS/GetInfo.php"));

(If you need the full code, please tell me and I'll edit)

If you open the URL on the browser you'll see that its a simple string, connnected to a Database (php/mySQL) and is returning a set of variables in this format " ID=1&Nome=Marco&Tipo=Revendedor", etc, so I believe that part is in working order. I already tried not using variables and the connection works (just tracing e.target.data), so Im a bit confused now.

And yes, I am a newby AS3 wannabe programmer, so please have patience with me :)

Thank you.


For me, sometimes Flash won't read the first variable in the file. Try putting a dummy variable first and then your ID etc.

I've had to do that for a few projects.

You can also try loading it as TEXT.


My best guess if that you need to urlencode the keys and values in the data from the php script.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号