Welcome!

Welcome to the Official BlackBerry Support Community Forums. This is your resource to discuss support topics with your peers, and learn from each other. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Adobe AIR Development

Reply
Developer
jtegen
Posts: 6,145
Registered: ‎10-27-2010
My Carrier: AT&T

URLLoader fail on PB but OK as AIR

Has anyone had problems getting a valid response from a website using URLLoader when in PB, but the same code works fine in the AIR version?  Been nocking my head on this one all day.

 

var req:URLRequest = new URLRequest();
req.method = "GET";
req.url = my_uri; // like http://www.myhost.com?param1=square&param2=circle
				
var loader: URLLoader = new URLLoader();
loader.addEventListener( Event.COMPLETE, httpRequestTokenResult );
loader.addEventListener( IOErrorEvent.IO_ERROR, httpRequestTokenFault );
loader.addEventListener( SecurityErrorEvent.SECURITY_ERROR, httpRequestTokenFault );
loader.load( req );

 

Please use plain text.
Developer
peter9477
Posts: 5,615
Registered: ‎12-08-2010
My Carrier: none

Re: URLLoader fail on PB but OK as AIR

I have no problems with that code here, and I get a "complete" event a fraction of a second after executing it.

 

I guess check the obvious: DNS, that the page really exists, maybe try without the query string (parameters) first, try another site.  Failing, that, maybe post more detail about what invalid response you are getting...


Peter Hansen -- (PlayBook and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Please use plain text.
Developer
jtegen
Posts: 6,145
Registered: ‎10-27-2010
My Carrier: AT&T

Re: URLLoader fail on PB but OK as AIR

I'll dig deeper.  It's apart of OAuth code.  Thanks.

Please use plain text.