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
greenback
Posts: 517
Registered: ‎10-17-2010
My Device: BlackBerry Z10, DAC

AIR equivalent of ajax HTTP POST/GET?

I'm developing an application using AIR and as3. Trying to POST values from as3 qnx text fields to my server via something equivalent to HTTP post. Basically this is going to be part of my functionality where users can gather data and save it to their account online.

 

What library/class can I use for posting text content from my form? The data being sent should be encoded as json or key value pairs.

 

Any sample code would help. :Helpsmilie:

 

 

Please use plain text.
Developer
Innovatology
Posts: 1,280
Registered: ‎03-03-2011
My Device: Playbook, Z10, Q10, Z30 with Files & Folders and Orbit of course
My Carrier: Vodafone

Re: AIR equivalent of ajax HTTP POST/GET?

URLLoader:

 

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/URLLoader.html

Files & Folders, the unified file & cloud manager for PlayBook and BB10 with SkyDrive, SugarSync, Box, Dropbox, Google Drive, Google Docs. Free 3-day trial! - Jon Webb - Innovatology - Utrecht, Netherlands
Please use plain text.
Developer
greenback
Posts: 517
Registered: ‎10-17-2010
My Device: BlackBerry Z10, DAC

Re: AIR equivalent of ajax HTTP POST/GET?

Thank you that worked. I also found these resources helpful for anyone interested:

 

  1. Stackoverflow:
     http://stackoverflow.com/questions/1686139/as3-basic-parsing-json-question
  2. Adobe(Using Native JSON)
     http://help.adobe.com/en_US/as3/dev/WS324d8efcab3b0d1e2408f9e3131fddffcfc-8000.html
  3. Parsing JSON in as3
    http://stackoverflow.com/questions/1713479/as3-json-parsing
  4. Including AS3CoreLib(com.adobe.serialization.json:smileywink:
  5. https://github.com/mikechambers/as3corelib 

Thanks! 

Please use plain text.
Developer
pyth
Posts: 503
Registered: ‎01-19-2011
My Device: My Trusty Red Plane
My Carrier: Outer Space

Re: AIR equivalent of ajax HTTP POST/GET?

don't forget to look out for security issues (security sandbox, crossdomain.xml and such). I just spent a few hours fixing that because I programmed on the weekend, deployed yesterday and saw it wasn't working today (private project, no company project, so it only matters for me :smileyvery-happy:)

 

Adobe Flash Builder for example deactivates all security sandbox settings per default for all folders/files inside your project folders. FlashDevelop does it the other way around, only allowing that for you bin-debug folder (i think).

-----------------------------------------------------------------------
I'm a bird from outer space. But I'm not flappy o.o
Please use plain text.