I need to access a database using HTTP Get and in the URL have underscores and parameters starting with $ signs:
"https://mydataservice/__query&$format=json"
I tried every thing but Flash builder keep giving me an error in the url= line
So I'm now using URLRequest instead and I have to do all the json myself. In Android I can create a class reference to the elements I want to retrieve from the json string. How do I do this in Flash Builder 4.6 mobile? The json string has 20 columns but I only need two.
Here is how far I got and my next problem is how to bind it to a list.
package dataclass
{
[Bindable]
public class DataTable extends Object
{
public function DataTable()
{
super();
}
public var d:String;{
public var result:Array;{
public var Name:String = new String();
public var Phone:String = new String();
}
}
}
}
protected function downloadFile():void {
var request:URLRequest = new URLRequest ("https://mydataservice/__query&$format=json");
var loader:URLLoader = new URLLoader();
loader.dataFormat = URLLoaderDataFormat.TEXT;
loader.load(request);
loader.addEventListener(Event.COMPLETE, oncomplete);
}
protected function oncomplete(e:Event):void{
var loader2:URLLoader = e.target as URLLoader;
try {
if (loader2 != null){
var jsonParsed : Object = JSON.parse(loader2.data);
var dataTable:DataTable = new DataTable;
}
else{
trace("an error has occured!");
}
}
finally{
}
}
Thanks, Kim