A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: AS3 parsing JSON

  1. #1
    Member
    Join Date
    Apr 2011
    Posts
    42

    AS3 parsing JSON

    Hey all,

    I'm currently trying to use AS3 to check a JSON file found at : http://furydivine.net/api/hunt-dice/active

    I want to check if players are online and if they are playing on xbox I want to use this to trigger an AS3 event ...

    So far I have this in an empty AS3 file ...

    Code:
    import com.adobe.serialization.json.JSON;
    
    var myRequest:URLRequest = new URLRequest("http://furydivine.net/api/hunt-dice/active/");
    var myLoader = new URLLoader();
    myLoader.addEventListener(Event.COMPLETE, onload);
    myLoader.load(myRequest);
    
    function onload(evt:Event):void
    {
    var myData:Object = JSON.decode(myLoader.data);
    
    trace(myData.player[0].playerName);
    }

  2. #2
    Senior Member
    Join Date
    Apr 2002
    Posts
    2,849
    And the problem you're having is...? Is the file not loading, or...?

  3. #3
    Member
    Join Date
    Apr 2011
    Posts
    42

    Post

    Hey sorry yes I'm getting and error about not finding the link

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center