Hi,
this plugin can load and parse a JSON-file. It can be used for translation of words or phrases - written in an external json-file. The "funny characters" in the demo-JSON-file are unicode characters.
Because it loads a custom json-file this plugin doesn't work in preview mode.
____________________________
Update v 1.<font color="red">2</font>
Bugfix - getting entries of keys
Demo+Plugin+JSON-file v 1.2. (capx for C2 r85)
(second test with fewer keys)
____________________________
Update v 1.1
Demo+Plugin+JSON-file v 1.1. (capx for C2 r85)
Two more expressions:
1) getRootKeysSize --> return number
Returns an integer how many keys exists in the JSON-file.
2) getKeySize(stringKey) --> return number
Returns an integer how many entries exist at the key- stringKey.
How to use --> screenshots in my post below
____________________________
Demo+Plugin+Example (v 1.0)
Property:
The name of the json-file. [optional path if the file is not located next to the exported index.html]
<img src="http://dl.dropbox.com/u/31151399/Construct2/Plugins/joe7_loadJson_demo/images/properties.png" border="0">
Condition:
<img src="http://dl.dropbox.com/u/31151399/Construct2/Plugins/joe7_loadJson_demo/images/conditions.png" border="0">
Action:
<img src="http://dl.dropbox.com/u/31151399/Construct2/Plugins/joe7_loadJson_demo/images/actions.png" border="0">
Expressions:
getData(keyWordAsText,positionAsNumber) --> returns Text
eg json-data is: "dog": ["Dog", "Cane"]
getData("dog",0) --> returns "Dog"
getData("dog",1) --> returns "Cane"
readLoadingReturn --> returns Text
show the status of loading: word is found, not found, success, error,..
<img src="http://dl.dropbox.com/u/31151399/Construct2/Plugins/joe7_loadJson_demo/images/expressions.png" border="0">
How to use the plugin - overview:
<img src="http://dl.dropbox.com/u/31151399/Construct2/Plugins/joe7_loadJson_demo/images/overView.png" border="0">
All suggestions are welcome and have fun,
Joe7