<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic JSONUtils encode to string at 3.1 in ArcGIS API for Flex Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/jsonutils-encode-to-string-at-3-1/m-p/627741#M13983</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am migrating a flex application from ArcGIS flex API 2.4 / Flex SDK 4.5 to API 3.1 / Flex SDK 4.6&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;After changing all the occurences of JSON.decode and JSON.encode to use JSONUtil.encode/decode (importing com.esri.ags.utils.JSONUtil; ) I am getting runtime errors while debugging.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The error message is:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;Error: Unknown Property: 'dispatchResetEvent'.
 at mx.collections::ListCollectionView/http://www.adobe.com/2006/actionscript/flash/proxy::getProperty()
 at JSON$/stringifySpecializedToString()
 at JSON$/stringify()
 at com.esri.ags.utils::JSONUtil$/encode()&lt;C&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at myProject.components::myProjectUserFavourites/UpdateFavouritesToServer()&lt;C&gt;&lt;/C&gt;&lt;/C&gt;&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;where dispatchResetEvent is part of the inherited object of an MX:ArrayCollection that I'm trying to encode:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This worked fine at 2.4/4.5 but doesn't work at 3.1/4.6&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Attached is the FlashBuilder Expression at the line that calls the encode where the error occurs:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;var FavouritesJSON:String = JSONUtil.encode(ArrayOfAllFavourites.source);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can anyone shed any light onto what might be the cause and or solution&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Andrew&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 07 Feb 2013 01:07:10 GMT</pubDate>
    <dc:creator>AndrewThomas</dc:creator>
    <dc:date>2013-02-07T01:07:10Z</dc:date>
    <item>
      <title>JSONUtils encode to string at 3.1</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/jsonutils-encode-to-string-at-3-1/m-p/627741#M13983</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am migrating a flex application from ArcGIS flex API 2.4 / Flex SDK 4.5 to API 3.1 / Flex SDK 4.6&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;After changing all the occurences of JSON.decode and JSON.encode to use JSONUtil.encode/decode (importing com.esri.ags.utils.JSONUtil; ) I am getting runtime errors while debugging.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The error message is:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;Error: Unknown Property: 'dispatchResetEvent'.
 at mx.collections::ListCollectionView/http://www.adobe.com/2006/actionscript/flash/proxy::getProperty()
 at JSON$/stringifySpecializedToString()
 at JSON$/stringify()
 at com.esri.ags.utils::JSONUtil$/encode()&lt;C&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at myProject.components::myProjectUserFavourites/UpdateFavouritesToServer()&lt;C&gt;&lt;/C&gt;&lt;/C&gt;&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;where dispatchResetEvent is part of the inherited object of an MX:ArrayCollection that I'm trying to encode:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This worked fine at 2.4/4.5 but doesn't work at 3.1/4.6&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Attached is the FlashBuilder Expression at the line that calls the encode where the error occurs:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;var FavouritesJSON:String = JSONUtil.encode(ArrayOfAllFavourites.source);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can anyone shed any light onto what might be the cause and or solution&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Andrew&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Feb 2013 01:07:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/jsonutils-encode-to-string-at-3-1/m-p/627741#M13983</guid>
      <dc:creator>AndrewThomas</dc:creator>
      <dc:date>2013-02-07T01:07:10Z</dc:date>
    </item>
    <item>
      <title>Re: JSONUtils encode to string at 3.1</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/jsonutils-encode-to-string-at-3-1/m-p/627742#M13984</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'd try:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;var FavouritesJSON:String = JSONUtil.encode(ArrayOfAllFavourites.toArray());&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 09 Feb 2013 15:06:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/jsonutils-encode-to-string-at-3-1/m-p/627742#M13984</guid>
      <dc:creator>DasaPaddock</dc:creator>
      <dc:date>2013-02-09T15:06:12Z</dc:date>
    </item>
    <item>
      <title>Re: JSONUtils encode to string at 3.1</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/jsonutils-encode-to-string-at-3-1/m-p/627743#M13985</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks Dasa.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I would have thought these two were pretty much equivalent:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;var FavouritesJSON:String = JSONUtil.encode(ArrayOfAllFavourites.source);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;var FavouritesJSON:String = JSONUtil.encode(ArrayOfAllFavourites.toArray());&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regardless, neither worked as there was several nested array collections so I managed to pre-emptively alter those in other places before they ever got to this function. Those that I couldn't I had to manually parse the array collection and set the five properties. Not ideal but manageable in my case.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It's strange that this suddenly didn't handle it at 3.1 but was OK at 2.4.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Andrew&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Feb 2013 01:02:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/jsonutils-encode-to-string-at-3-1/m-p/627743#M13985</guid>
      <dc:creator>AndrewThomas</dc:creator>
      <dc:date>2013-02-12T01:02:42Z</dc:date>
    </item>
  </channel>
</rss>

