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
Regular Contributor
Posts: 58
Registered: ‎12-26-2010
My Device: Torch 9800
My Carrier: Rogers

Filling forum boxes in flash

Hi all,

 

I am building an application to connect to my website and have a quick question on how to go about doing this.

 

I want to fill a login/ password box from within flash, and also create a user form. I presume that it would be the same instructions for each set.

 

Thanks for your help in advance and happy coding!

 

Tayshun

Developer
Posts: 2,462
Registered: ‎11-04-2010
My Device: Bold 9700

Re: Filling forum boxes in flash

hey,

 

do you mean these forms wil be in your application or an external website somewhere?

J. Rab (Blog) (Twitter)
--
1. If you liked my post or found it useful please click on the thumbs up and provide a Like!
2. If my post solved your problem please click on the Accept as Solution button. Much appreciated!

Approved Apps: OnTrack | ssShots | Hangman
Regular Contributor
Posts: 58
Registered: ‎12-26-2010
My Device: Torch 9800
My Carrier: Rogers

Re: Filling forum boxes in flash

They are on an external website, and I want to fill them from my app .

Developer
Posts: 2,462
Registered: ‎11-04-2010
My Device: Bold 9700

Re: Filling forum boxes in flash

ah ok. now is the site going to be loaded on the external web browser or the QNXStageWebView component? if its going to be the external one (the one that they recently made available) then i dont think its possible via an AIR app. it'd require your app having access to another application. But if you do the QNXStageWebView way, then you might be able to but im not entirely sure. This method might be able to help you out:

 

executeJavaScript()

 

http://www.blackberry.com/developers/docs/airapi/1.0.0/qnx/media/QNXStageWebView.html#executeJavaScr...

 

hope that helps. good luck!

J. Rab (Blog) (Twitter)
--
1. If you liked my post or found it useful please click on the thumbs up and provide a Like!
2. If my post solved your problem please click on the Accept as Solution button. Much appreciated!

Approved Apps: OnTrack | ssShots | Hangman
Regular Contributor
Posts: 58
Registered: ‎12-26-2010
My Device: Torch 9800
My Carrier: Rogers

Re: Filling forum boxes in flash

Sorry, the forms will be in my application. I will have text boxes to fill, and I want the user to click send, the boxes on my site get filled, and it returns a success! image

Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: Filling forum boxes in flash

So you aren't really filling in "boxes" or anything... the HTML is never rendered on the tablet, right?  Instead, you're just doing a POST operation with the values pulled from the fields you show in your app.

 

This is somewhat like "screen scraping" HTML pages, only in your case you may not even need to read the HTML in the first place.  The core of what you need would just be doing a POST request with a URLRequest object.


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!
New Developer
Posts: 199
Registered: ‎12-29-2010
My Device: Not Specified

Re: Filling forum boxes in flash

You'll need to use a combination of URLRequest (set to be a POST as peter said) and URLLoader to actually initiate the request.

 

You could, alternatively, use any XMLRPC, JSON, or AMF service you expose for your application.

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

Re: Filling forum boxes in flash

Here is a sample:

 

var url    : String = 'http://www.myhost.com/myscript.php?method=init';
var params : URLVariables = new URLVariables();

params.uid       = this.follow_uid;
				
var req : URLRequest = new URLRequest();
req.method = 'POST';
req.data = params;
req.url = url;
				
var loader :URLLoader = new URLLoader();
loader.addEventListener( Event.COMPLETE, LoadServerInfoComplete );
loader.addEventListener( IOErrorEvent.IO_ERROR, LoadServerInfoFailed );
loader.load( req );

 

////////////////////////////////////////////////////////////////////////
private function LoadServerInfoComplete( event : Event ) : void
{
  var loader :URLLoader = event.target as URLLoader;
  trace( 'LoadServerInfoComplete ' + loader.data );
}

 

////////////////////////////////////////////////////////////////////////
private function LoadServerInfoFailed( event : Event ) : void
{
	trace( 'LoadServerInfoFailed' );
}