PDA

View Full Version : URLLoader and Variables HELP!!!!



versus69
May 9th, 2007, 12:04 AM
Hey i am trying to get this working and i know i can use string parsers to get what i need but that will become too messy for what i want. This is my following AS3 code:


var request:URLRequest = new URLRequest("http://mywebsite.yadayada/flash_getproducts.aspx?Id=11");
var loader:URLLoader = new URLLoader();
loader.dataFormat = URLLoaderDataFormat.VARIABLES;
loader.addEventListener (Event.COMPLETE, completeHandler);
try {
loader.load (request);
} catch (error:Error) {
trace("Unable to load requested document.");
}

function completeHandler(event:Event):void
{
var loader:URLLoader = URLLoader(event.target);

trace (loader.data);
}

Now as soon as i run my movie i get the following error message and it never even makes it to completeHandler event:

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$iinit()
at flash.net::URLLoader/flash.net:URLLoader::onComplete()

I need help for this urgently

Dazzer
May 9th, 2007, 04:55 AM
I don't get it. Why are you fiddling around with the dataform thingie?

Just try loading without that line?

senocular
May 9th, 2007, 11:52 AM
http://www.adobe.com/go/kb401103

LeonardoZimbres
September 16th, 2007, 07:36 PM
http://www.adobe.com/go/kb401103

Thats all because the ampersand?