Get a delicious JSON feed via ActionScript 3 (and as3corelib)


/ Published in: ActionScript 3
Save to your folder(s)

Need to download the ActionScript 3.0 library http://code.google.com/p/as3corelib/ and extract the "com" folder into the same folder as your .fla file.


Copy this code and paste it in your HTML
  1. import com.adobe.serialization.json.JSON;
  2.  
  3. var loader:URLLoader = new URLLoader();
  4. var request:URLRequest = new URLRequest();
  5.  
  6. request.url = "http://feeds.delicious.com/v2/json";
  7. loader.load(request);
  8. loader.addEventListener(Event.COMPLETE, decodeJSON);
  9.  
  10. function decodeJSON(event:Event):void {
  11. var loader:URLLoader = URLLoader(event.target) ;
  12. var Bookmarks:Array = JSON.decode(loader.data) ;
  13.  
  14. for (var key:Object in Bookmarks) {
  15. trace(Bookmarks[key].u);
  16. trace(Bookmarks[key].d);
  17. trace(Bookmarks[key].t);
  18. }
  19. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.