Error: Error #2101: Строка, переданная в URLVariables.decode(), должна быть строкой запроса закодированного URL-адреса и содержать пары имя/значение.
at Error$/throwError()
at flash.net::URLVariables/decode()
at flash.net::URLVariables()
at flash.net::URLLoader/onComplete()
stop();// Assign a variable name for our URLVariables objectvar variables:URLVariables = new URLVariables();// Build the varSend variable// Be sure you place the proper location reference to your PHP config file herevar varSend:URLRequest = new URLRequest("test.php");varSend.method = URLRequestMethod.POST;varSend.data = variables;// Build the varLoader variablevar varLoader:URLLoader = new URLLoader;varLoader.dataFormat = URLLoaderDataFormat.VARIABLES;varLoader.addEventListener(Event.COMPLETE, completeHandler);variables.myRequest = "bringit";// Send the data to the php filevarLoader.load(varSend);// When the data comes back from PHP we access it here function completeHandler(event:Event):void{ var idVar = event.target.data.id_var; var userNameVar = event.target.data.uname_var; var passVar = event.target.data.upass_var; var resultStatus = event.target.data.my_result; if (resultStatus == "no_session"){ gotoAndStop("no_session"); } else if (resultStatus == "no_exist"){ gotoAndStop("no_exist"); } else if (resultStatus == "all_good"){ userid_txt.text = idVar; username_txt.text = userNameVar; password_txt.text = passVar; gotoAndStop(5); }}
var str:String = new String(); str += "do=smth"; var vars = new URLVariables(str); var request:URLRequest = new URLRequest(); request.url = "http://xa.xa/xa.php"; request.method = URLRequestMethod.POST; request.data = vars; var loader:URLLoader = new URLLoader(); loader.dataFormat = "variables"; loader.addEventListener(Event.COMPLETE, SomeFunc1); loader.addEventListener(Event.CANCEL, SomeFunc2); loader.load(request);
/* ----- -------------------------------------- ----- *//* ----- THE ACTIONSCRIPT 3.0 USED IN THE VIDEO ----- *//* ----- -------------------------------------- ----- */ stop();// Assign a variable name for our URLVariables objectvar variables:URLVariables = new URLVariables();// Build the varSend variable// Be sure you place the proper location reference to your PHP config file herevar varSend:URLRequest = new URLRequest("getsessionvars.php");varSend.method = URLRequestMethod.POST;varSend.data = variables;// Build the varLoader variablevar varLoader:URLLoader = new URLLoader;varLoader.dataFormat = "variables";varLoader.addEventListener(Event.COMPLETE, completeHandler);variables.myRequest = "bringit";// Send the data to the php filevarLoader.load(varSend);// When the data comes back from PHP we access it here function completeHandler(event:Event):void{ var idVar = event.target.data.id_var; var userNameVar = event.target.data.uname_var; var passVar = event.target.data.upass_var; var resultStatus = event.target.data.my_result; if (resultStatus == "no_session"){ gotoAndStop("no_session"); } else if (resultStatus == "no_exist"){ gotoAndStop("no_exist"); } else if (resultStatus == "all_good"){ userid_txt.text = idVar; username_txt.text = userNameVar; password_txt.text = passVar; gotoAndStop(5); }}
Error: Error #2101: Строка, переданная в URLVariables.decode(), должна быть строкой запроса закодированного URL-адреса и содержать пары имя/значение. at Error$/throwError() at flash.net::URLVariables/decode() at flash.net::URLVariables() at flash.net::URLLoader/onComplete()
XELAD URLLoaderDataFormat.VARIABLES и "variables" это одно и тоже. MrDead, у вас ругается что данные от PHP не по формату приходят. Вы пробовали смотреть что PHP скрипт возвращает?
IndieGD
Я на офиц форуме находил тему, где было указано, что это не одно и тоже.
А порывшись в инете нашел по поводу 2101:
The error says it can't parse the string returned by your PHP script. That means it's not the format
abc=10&cake=boop or has some character that trips it up.
PHP плох