Posted By

ImJustRestless on 09/08/11


Tagged

parse json as3


Versions (?)

AS3 JSON String Parsing


 / Published in: ActionScript 3
 

  1. import com.adobe.serialization.json.JSON;
  2.  
  3. var loader:URLLoader = new URLLoader();
  4. var request:URLRequest = new URLRequest();
  5. request.url = "http://parksunleashed.com/ds/mediatimer";
  6. loader.load(request);
  7. loader.addEventListener(Event.COMPLETE, decodeJSON);
  8.  
  9. function decodeJSON(event:Event):void {
  10. var loader:URLLoader = URLLoader(event.target) ;
  11. var str:String = loader.data;
  12. trace(loader.data)
  13. //traces out: {"CurrentTime":15520000,"PrizingPeriods":["11:59 AM","05:59 PM","11:59 PM"]}
  14.  
  15. }

Report this snippet  

You need to login to post a comment.