3

How to decode Json file. My code

var bytes:ByteArray = new json_file();
var json:String = bytes.readUTFBytes(bytes.length);
var arr:Object = JSON.decode(json);

I'm getting the following error when I run the above command

Access of undefined property JSON.
-JSON
ketan
  • 19,129
  • 42
  • 60
  • 98
Thiru
  • 31
  • 3

1 Answers1

1

Use the below code its working for me.

Insted of this code

var arr:Object = com.adobe.serialization.json.JSON.decode(json);

Use this one

var arr:Object = JSON.decode(json);

and import the below package

import com.adobe.serialization.json.JSON;   
Srivathsan
  • 519
  • 4
  • 18
Dinesh
  • 566
  • 4
  • 16