/ Published in: ActionScript 3
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
public function read( className:String, objectId:String ):void { var authorization:String = null; var request:URLRequest = null; var header:URLRequestHeader = null; authorization = Base64.encode( APPLICATION_ID + ":" + MASTER_KEY ); header = new URLRequestHeader( "Authorization", "Basic " + authorization ); request = new URLRequest( "https://api.parse.com/1/classes/" + className + "/" + objectId ); request.method = URLRequestMethod.GET; request.contentType = "application/json"; request.requestHeaders.push( header ); if( loader == null ) { loader = new URLLoader(); } loader.addEventListener( Event.COMPLETE, doReadComplete ); loader.load( request ); }