1 Reply Latest reply on Oct 12, 2010 9:45 AM by gpetukhov

    JSON decoder decode is not working

    vivekprakas

      I'm using flash builder 4.

       

      The code below doesn't work nor it gives any form of errors.

       

      import com.adobe.serializers.json.JSONDecoder;

      var s:String="{hours:16, minutes:9, seconds:2}";
      var obj:Object=j.decode(s);
      Alert.show(obj.hours.toString());

        • 1. Re: JSON decoder decode is not working
          gpetukhov

          I am using Flash CS5 and I have the same problems.

           

          private function fetchUserInfo(data: Object): void {

              try{

                     var arr:Array = JSON.decode(String(data));

               }

                catch(e:Error){

                      atext.appendText("error occured");

                }

          }

           

          Error is always being caught.