PDA

View Full Version : [AS3] asp variables via URLLoader.data



plaidharper
May 11th, 2009, 06:09 PM
Having trouble get the URLLoader class to work.
Unsure but I must be missing something basic.
Just trying to send name/value pairs from asp to flash.

AS3 Code:


var loader:URLLoader = new URLLoader();
loader.dataFormat = URLLoaderDataFormat.VARIABLES;
loader.addEventListener(Event.COMPLETE, varsLoaded);
var requester:URLRequest = new URLRequest("test.asp");
requester.method = URLRequestMethod.POST;
loader.load(requester);

function varsLoaded (event:Event):void {
trace(loader.data is URLVariables); // true
var loader2:URLLoader = URLLoader(event.target);
trace(loader2.data); //currently returning entire contents of asp file
trace(loader2.data["var0"]); //currently returning undefined
trace(loader2.data["var1"]); //currently returning a section of the asp code
}
ASP CODE:


<%
stringQuery="var0=1000000000000000&var1=0"
Response.Write(stringQuery)
%>
Trace Respone:
true
%0D%0A%3C%0A%0D%0A%0D%0AstringQuery=%22var0%3D1000 000000000000&var1=0%22%0D%0AResponse%2EWrite%28stringQuery%29%0 D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D% 0A
undefined
0"

Response.Write(stringQuery)


of course if I goto test.asp on the web it outputs: var0=1000000000000000&var1=0

unsure why the URLLoader class is not identifying my name/pairs properly
any help would be greatly appreciated

plaidharper
May 11th, 2009, 06:14 PM
also, not really up on my asp, so maybe it is an encode issue on that end???

plaidharper
May 12th, 2009, 08:28 AM
bump

plaidharper
May 13th, 2009, 11:02 AM
any ideas on another forum in which I could ask this question?
flash based or asp based?