如何解码 Json 文件。 我的代码
var bytes:ByteArray = new json_file();
var json:String = bytes.readUTFBytes(bytes.length);
var arr:Object = JSON.decode(json);
运行上述命令时出现以下错误
Access of undefined property JSON.
-JSON
最佳答案
使用下面的代码对我有用。
安装了这段代码
var arr:Object = com.adobe.serialization.json.JSON.decode(json);
用这个
var arr:Object = JSON.decode(json);
并导入
下面的包
import com.adobe.serialization.json.JSON;
关于json - 从 Flex 中的 Assets 访问 JSON 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14001052/