How to decode Json using native JSON or actionjson in Flex 3

前端 未结 4 1455
没有蜡笔的小新
没有蜡笔的小新 2020-12-09 07:03

I have the below Json (wf.json)

{
\"workflow\":{
    \"template\":\"Analysis1\",

    \"start\":{
        \"instance\":\"HDA_run1\",
        \"user\":\"symte         


        
4条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-09 07:44

    import com.adobe.serializers.json.JSONDecoder;
    
    var JSON:JSONDecoder = new JSONDecoder();
    var result:Object = JSON.decode(JSON_STRING);
    

    that worked for me then you can either construct new object type(s) or jsut access values either

    result.template
    

    or

    result['template']
    

    the latter is good for dynamic valus/keys needed rather than known key values

提交回复
热议问题