How to parse JSON (AS3)

后端 未结 2 1894
春和景丽
春和景丽 2021-01-04 19:55

How to parse downloaded .json file with a string inside it to a string variable? With as3corelib.swc.

2条回答
  •  粉色の甜心
    2021-01-04 20:52

    The function for parsing JSON using as3corelib ( ie not the native JSON class ) is 'decode()'

    JSON.decode( inputJson );
    

    If the input json is properly encoded, strings should be available inside the resulting object. You may have trouble parsing strings if they have not been correctly escaped, but that is a problem with the input data.

提交回复
热议问题