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.

inside custom component

Adobe AIR Development

Reply
Developer
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

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 );

 

Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
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 -- (BB10 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!
Developer
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: URLLoader fail on PB but OK as AIR

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