You can use the JSON helper class... if your dictionary is:
var dict = {"Challenge": "text with spaces", "Controls": 1, "Graphics": 1}
(note that your dictionary MUST have quotes arround keys)
you can get a JSON string with:
var jstr = JSON.print(dict)
And you can parse it to a JSONParseResult with:
var res = JSON.parse(jstr)
The JSON parse result has some variables you can se here. There you can get the JSON object with:
var obj = res.result
You can check if the object returned is a dictionary or an array with
typeof(obj)
If you only need to convert dict to JSON string, then the JSON.print
is what you are looking for.