[PLUGIN] Load JSON

0 favourites
From the Asset Store
Progress\Loading Bar. Now Load you game like a Professional.
  • tnewhook

    It should be possible when modifying the runtime.js:

    Copy all codelines that live in the method acts.LoadJSON to the instance-constructor after the variable-initalisation: "instanceProto.onCreate"

    I'll look to this plugin asap - and then make a new release. If you're faster than me and want to share it - post it and I'll link it in the first post.

    Why I have done the loading with an action? My idea was, that it should be possible to reload the JSON-file whenever wanted. It should possible to modify it per ajax and the reload the new JSON-data with then plugin. <img src="smileys/smiley2.gif" border="0" align="middle" />

  • Thnx for plugin Joe, but i have one question.

    How i can load external json-file, which placed not in the same domain with C2-app?

  • Thnx for plugin Joe, but i have one question.

    How i can load external json-file, which placed not in the same domain with C2-app?

    Yes, i have same question with you etspring

    How i can load external json, mr Joe7

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • One question in propeties about the name of the json-file.

    How do i write the correct path for the location of the json-file.

    By example i have the json file in this folder

    /name_of_my_proyect

               /Animations

               /Events Sheet

               /Files

                       languageStrings.json

               /Layouts

               /sounds

    how do i write this correct path in propeties JSON-FILE

           

    <img src="http://dl.dropbox.com/u/31151399/Construct2/Plugins/joe7_loadJson_demo/images/properties.png" border="0" />

  • Nice Apps. thanks

  • I looked through the code, and it doesnt look like it will call a json which is not on same domain as c2 app.

    This is the shortcoming of JSON.

    XMLHttpRequests can only be made to URI's on the same domain.

    You'll need to use something like JSONP that uses "<script>" to do that.

    Almost tempted to try add that to plugin, but way short on time right now :(

  • How to get name/value pair values from the JSON file, right now it seems to work with only arrays ?

    ex: {"Name": "GoodName","Email": "goodname@goodone.com","ListName": "Lesson 24","PassingGrade": "85"}

    -Thanks

  • mchulet

    Try hash table plugin.

  • Thanks rexrainbow, I am trying it out just now.

    -Thanks

  • I'm very confused . I've put the .json file into the folder of Index.html on the server, and invoked the method LoadJSON.GetData("first",0) and set this value to a text. But the text is NOT FOUNDING ...

    Here is my JSON file's content

    {

         "first":["3"],

         "second":["1"],

         "third":["2"]

    }

    Please tell me where is wrong ...

    THx!

  • Hello!

    How you fix your problem with the unicode?

    And if you don't fixed it, do you know how can I fiz that?

    Thanks! =)

  • Hey, is it even possible to maybe load a JSON from a text variable?

  • This plugin loads JSON file while the game is loading, right? How to reload a JSON during the game?

  • Hi Joe7,

    Can your plug in be used so a game can load json file made from a dictionary or array from a different game. Then can it read the data and set the data to it's arrays or dictionaries?

    I'm trying to use your plugin where one game pulls loads and displays points from another game. For example have the points carry over to the next game, and then to the next.

    I'm trying various methods and exporting with PhoneGap, but I'm not having any luck. Is it possible with a phone app exported with PhoneGap?

    Thanks,

  • Hi Joe7,

    I have a project where I need to use your JSON Plugin, but I need it to set a different source URL at various times in the game. I realise I could just add secondary, third JSON com to the library but would prefer to simply set URL.

    Have you built this in yet? If not can someone using your plugin do this?

    Thanks,

    James

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)