Posted By

eddequincey on 02/24/10


Tagged

json delicious as3


Versions (?)

Who likes this?

5 people have marked this snippet as a favorite

alvincrespo
TrentSkunk
amrmuhammad
tspitzr
mitien


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


 / Published in: ActionScript 3
 

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.

  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
Posted By: alvincrespo on February 24, 2010

Thanks for this, I havent had time to implement my own version and this is a great starter!

You need to login to post a comment.