AS3 and JSON : error 1061

前端 未结 2 1364
广开言路
广开言路 2021-01-14 22:18

I spent hours around a possibly stupid problem relative to JSON encoding in FLASH.

I Try to do something very simple : I make an object and I want it to be serialize

相关标签:
2条回答
  • 2021-01-14 22:39

    JSON.parse and JSON.stringfy are the methods you are looking for in Flash Player 11+.

    JSON.encode and JSON.decode were part of the Adobe AS3 lib but since the Flash Player has a native JSON parser now you don't need that class.

    0 讨论(0)
  • 2021-01-14 22:41

    All right. As usual, I found the answer a few seconds after posting my question.

    JSON in now incorporated directly in As3, so no need to use com.adobe.serialization.json.JSON

    So I delete the import and replaced :

    var myJson:String = JSON.encode(myData);
    

    by

    var myJson:String = JSON.stringify(myData);
    

    and it works.

    0 讨论(0)
提交回复
热议问题