Select to view content in your preferred language

Access of undefined property JSON

1915
5
Jump to solution
07-16-2012 12:49 PM
ShaningYu
Honored Contributor
In updating a project that compiled in FB 4.5 to 4.6, received such an error:
Description Resource Path Location Type 1120: Access of undefined property JSON
I referred to the thread at http://forums.arcgis.com/threads/52264-upgraded-to-Flex-Viewer-2.5-Flex-4.6-SDK-and-have-JSON-compil..., and updated the library:
   import com.esri.ags.utils.JSON;  //com.esri.serialization.json.JSON; V4.5
But still get the error for this piece of code:
  var dobj:Object = JSON.encode(ac);
Please provide your advice if you know how to fix it.  Thanks.
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus
Shanning,

   Because both adobe and esri has a library with the same function you have to fully qualify the calls:

var dobj:Object = com.esri.ags.utils.JSON.encode(ac);

View solution in original post

0 Kudos
5 Replies
RobertScheitlin__GISP
MVP Emeritus
Shanning,

   Because both adobe and esri has a library with the same function you have to fully qualify the calls:

var dobj:Object = com.esri.ags.utils.JSON.encode(ac);
0 Kudos
ShaningYu
Honored Contributor
Thanks.  Prob. solved.
0 Kudos
ChristinaGnadinger
Emerging Contributor
Thank you Robert!


Shanning,

   Because both adobe and esri has a library with the same function you have to fully qualify the calls:

var dobj:Object = com.esri.ags.utils.JSON.encode(ac);
0 Kudos
by Anonymous User
Not applicable
Robert -

   Any update for this for FlexViewer 3.6?  I leap-frogged a couple of versions and tried what was suggested above but still can't get the Viewer to compile ...

Thanks in advance!

     - Bob
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Bob,

   If you grab the Viewer source from github and then just follow all the direction in this link to get started.

http://resources.arcgis.com/en/help/flex-viewer/concepts/index.html#/Getting_started_for_developers/...
0 Kudos