<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Tutorial : Using JSON with Flex 2 and ActionScript 3</title>
	<atom:link href="http://www.mikechambers.com/blog/2006/03/28/tutorial-using-json-with-flex-2-and-actionscript-3/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mikechambers.com/blog/2006/03/28/tutorial-using-json-with-flex-2-and-actionscript-3/</link>
	<description>code = joy</description>
	<lastBuildDate>Thu, 11 Mar 2010 21:22:56 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Anh Quy</title>
		<link>http://www.mikechambers.com/blog/2006/03/28/tutorial-using-json-with-flex-2-and-actionscript-3/comment-page-2/#comment-15842</link>
		<dc:creator>Anh Quy</dc:creator>
		<pubDate>Thu, 19 Feb 2009 03:53:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.mikechambers.com/blog/?p=966#comment-15842</guid>
		<description>Brian,
I just happened to come across this post and your comment.
I&#039;m also a beginner in Flex. :-)
I found this post by Alex Harui from Adobe&#039;s Flex team, I think it will be very helpful:

http://blogs.adobe.com/aharui/2007/03/thinking_about_item_renderers_1.html

The Sub-Object Item Renderer may be close to what you&#039;re looking for. So check it out and hopefully you can find your answer.

As for label function, maybe this can help:
http://blog.flexexamples.com/2007/09/25/creating-a-simple-label-function-on-a-flex-combobox-control/

Anh Quy</description>
		<content:encoded><![CDATA[<p>Brian,<br />
I just happened to come across this post and your comment.<br />
I&#8217;m also a beginner in Flex. :-)<br />
I found this post by Alex Harui from Adobe&#8217;s Flex team, I think it will be very helpful:</p>
<p><a href="http://blogs.adobe.com/aharui/2007/03/thinking_about_item_renderers_1.html" rel="nofollow">http://blogs.adobe.com/aharui/2007/03/thinking_about_item_renderers_1.html</a></p>
<p>The Sub-Object Item Renderer may be close to what you&#8217;re looking for. So check it out and hopefully you can find your answer.</p>
<p>As for label function, maybe this can help:<br />
<a href="http://blog.flexexamples.com/2007/09/25/creating-a-simple-label-function-on-a-flex-combobox-control/" rel="nofollow">http://blog.flexexamples.com/2007/09/25/creating-a-simple-label-function-on-a-flex-combobox-control/</a></p>
<p>Anh Quy</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brian</title>
		<link>http://www.mikechambers.com/blog/2006/03/28/tutorial-using-json-with-flex-2-and-actionscript-3/comment-page-1/#comment-15537</link>
		<dc:creator>Brian</dc:creator>
		<pubDate>Fri, 09 Jan 2009 19:49:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.mikechambers.com/blog/?p=966#comment-15537</guid>
		<description>I&#039;m coming to the source as I can&#039;t find an answer anywhere else.  How do I get nested array field&#039;s into a dataGrid column?  Currently I have:

private function sentimentRH(event:ResultEvent):void {
var data:Object = JSON.decode(event.result.toString())
myArray = new ArrayCollection(data.features);
}

The top level array is features, the nested array is products.  dataField=&quot;name&quot; gives me features.name however I&#039;m unable to get product.* into a column.

The dataGrid dataField is fine pulling fields out of the top level array but doesn&#039;t understand features.product.  Searching around I&#039;ve found some clues to using labelFunction rather than dataField but I can&#039;t find any detailed explanation of implementing it although I understand it to be &quot;complex&quot;...  I&#039;m fairly new to Flex/AS and totally stuck, any explanation/example would be much appreciated.  There is one response above that makes sense but is apparently cutoff(?).

TIA/</description>
		<content:encoded><![CDATA[<p>I&#8217;m coming to the source as I can&#8217;t find an answer anywhere else.  How do I get nested array field&#8217;s into a dataGrid column?  Currently I have:</p>
<p>private function sentimentRH(event:ResultEvent):void {<br />
var data:Object = JSON.decode(event.result.toString())<br />
myArray = new ArrayCollection(data.features);<br />
}</p>
<p>The top level array is features, the nested array is products.  dataField=&#8221;name&#8221; gives me features.name however I&#8217;m unable to get product.* into a column.</p>
<p>The dataGrid dataField is fine pulling fields out of the top level array but doesn&#8217;t understand features.product.  Searching around I&#8217;ve found some clues to using labelFunction rather than dataField but I can&#8217;t find any detailed explanation of implementing it although I understand it to be &#8220;complex&#8221;&#8230;  I&#8217;m fairly new to Flex/AS and totally stuck, any explanation/example would be much appreciated.  There is one response above that makes sense but is apparently cutoff(?).</p>
<p>TIA/</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Krishnan</title>
		<link>http://www.mikechambers.com/blog/2006/03/28/tutorial-using-json-with-flex-2-and-actionscript-3/comment-page-1/#comment-15120</link>
		<dc:creator>Krishnan</dc:creator>
		<pubDate>Fri, 28 Nov 2008 09:42:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.mikechambers.com/blog/?p=966#comment-15120</guid>
		<description>Can anyone let me know how I can send JSONObject or JSONArray using Flex HTTPService?

Also can anyone shed light on how to receive the same as JSONObject or JSONArray in Java.

I am trying something like this in Java

@Path(&quot;/datareceive&quot;)
public class DataReceive {	
    @PUT
    @Consumes(&quot;application/json&quot;)
    public String putProduct(JSONObject jsonEntity) throws JSONException {
		System.out.println(jsonEntity.length());
        return &quot;&quot;;
    }
}




The following is the error that I get when I try to send JSON Encoded data from Flex using HTTPService

Error #1065: Variable {&quot;id&quot;:&quot;userCollection&quot;,&quot;users&quot;:[{&quot;name&quot;:&quot;user0&quot;,&quot;password&quot;:&quot;password0&quot;,&quot;login&quot;:true,&quot;flags&quot;:[1,2,3,4,5,6],&quot;role&quot;:{&quot;name&quot;:&quot;user&quot;}},{&quot;name&quot;:&quot;user1&quot;,&quot;password&quot;:&quot;password1&quot;,&quot;login&quot;:false,&quot;flags&quot;:[1,2,3,4,5,6],&quot;role&quot;:{&quot;name&quot;:&quot;user&quot;}}],&quot;userCount&quot;:2,&quot;extension&quot;:null,&quot;flags&quot;:[&quot;a&quot;,&quot;b&quot;,&quot;c&quot;,false,1,5,77,null]} is not defined.

What could be the reason behind the issue?

Thanks
Krishnan</description>
		<content:encoded><![CDATA[<p>Can anyone let me know how I can send JSONObject or JSONArray using Flex HTTPService?</p>
<p>Also can anyone shed light on how to receive the same as JSONObject or JSONArray in Java.</p>
<p>I am trying something like this in Java</p>
<p>@Path(&#8220;/datareceive&#8221;)<br />
public class DataReceive {<br />
    @PUT<br />
    @Consumes(&#8220;application/json&#8221;)<br />
    public String putProduct(JSONObject jsonEntity) throws JSONException {<br />
		System.out.println(jsonEntity.length());<br />
        return &#8220;&#8221;;<br />
    }<br />
}</p>
<p>The following is the error that I get when I try to send JSON Encoded data from Flex using HTTPService</p>
<p>Error #1065: Variable {&#8220;id&#8221;:&#8221;userCollection&#8221;,&#8221;users&#8221;:[{"name":"user0","password":"password0","login":true,"flags":[1,2,3,4,5,6],&#8221;role&#8221;:{&#8220;name&#8221;:&#8221;user&#8221;}},{&#8220;name&#8221;:&#8221;user1&#8243;,&#8221;password&#8221;:&#8221;password1&#8243;,&#8221;login&#8221;:false,&#8221;flags&#8221;:[1,2,3,4,5,6],&#8221;role&#8221;:{&#8220;name&#8221;:&#8221;user&#8221;}}],&#8221;userCount&#8221;:2,&#8221;extension&#8221;:null,&#8221;flags&#8221;:["a","b","c",false,1,5,77,null]} is not defined.</p>
<p>What could be the reason behind the issue?</p>
<p>Thanks<br />
Krishnan</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robalinho</title>
		<link>http://www.mikechambers.com/blog/2006/03/28/tutorial-using-json-with-flex-2-and-actionscript-3/comment-page-1/#comment-15078</link>
		<dc:creator>Robalinho</dc:creator>
		<pubDate>Fri, 21 Nov 2008 12:59:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.mikechambers.com/blog/?p=966#comment-15078</guid>
		<description>define variables:
[Bindable]
public var texto:String;

[Bindable]
public var teste:ArrayCollection = new ArrayCollection([{&quot;title&quot;:&quot;Matthews&quot;,&quot;src&quot;:&quot;Matt&quot;},{&quot;title&quot;:&quot;Matthews2&quot;,&quot;src&quot;:&quot;Matt2&quot;}]);
		   

define function to encode:
public function JSONfunc(entrada:Object):void
{
  var arr1:Array = new Array(entrada);
  var arr3:ArrayCollection  = new  ArrayCollection(arr1);
  var js:JSONEncoder = new SONEncoder(arr3[0].source);
  texto = JSONEncoder(js).getString();
}	


call function:
</description>
		<content:encoded><![CDATA[<p>define variables:<br />
[Bindable]<br />
public var texto:String;</p>
<p>[Bindable]<br />
public var teste:ArrayCollection = new ArrayCollection([{"title":"Matthews","src":"Matt"},{"title":"Matthews2","src":"Matt2"}]);</p>
<p>define function to encode:<br />
public function JSONfunc(entrada:Object):void<br />
{<br />
  var arr1:Array = new Array(entrada);<br />
  var arr3:ArrayCollection  = new  ArrayCollection(arr1);<br />
  var js:JSONEncoder = new SONEncoder(arr3[0].source);<br />
  texto = JSONEncoder(js).getString();<br />
}	</p>
<p>call function:</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joseph Zibara</title>
		<link>http://www.mikechambers.com/blog/2006/03/28/tutorial-using-json-with-flex-2-and-actionscript-3/comment-page-1/#comment-14306</link>
		<dc:creator>Joseph Zibara</dc:creator>
		<pubDate>Thu, 09 Oct 2008 18:46:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.mikechambers.com/blog/?p=966#comment-14306</guid>
		<description>Can Someone paste the json file, cause I have a feeling it&#039;s not being found.</description>
		<content:encoded><![CDATA[<p>Can Someone paste the json file, cause I have a feeling it&#8217;s not being found.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jesse Donat</title>
		<link>http://www.mikechambers.com/blog/2006/03/28/tutorial-using-json-with-flex-2-and-actionscript-3/comment-page-1/#comment-13552</link>
		<dc:creator>Jesse Donat</dc:creator>
		<pubDate>Thu, 28 Aug 2008 17:43:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.mikechambers.com/blog/?p=966#comment-13552</guid>
		<description>Same problem as anoop</description>
		<content:encoded><![CDATA[<p>Same problem as anoop</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nathan Pillai</title>
		<link>http://www.mikechambers.com/blog/2006/03/28/tutorial-using-json-with-flex-2-and-actionscript-3/comment-page-1/#comment-12668</link>
		<dc:creator>Nathan Pillai</dc:creator>
		<pubDate>Tue, 08 Jul 2008 22:22:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.mikechambers.com/blog/?p=966#comment-12668</guid>
		<description>I have a Flex / JSON / DWR issue :

private function onJSONLoad(event:ResultEvent):void
 {
var params:Object = {}; 
      params[&quot;callCount&quot;] = &quot;1&quot;; 
      params[&quot;page&quot;] = &quot;/index.jsp&quot;;
      params[&quot;c0-scriptName&quot;] = &quot;Suggest&quot;;
      params[&quot;c0-methodName&quot;] = &quot;search&quot;;
      params[&quot;c0-id&quot;] = &quot;0&quot;;
                
      params[&quot;c0-param0&quot;] = &quot;string:search-term&quot;; 
      params[&quot;c0-param1&quot;] = &quot;string:goodman group%7C&quot;;
      params[&quot;c0-param2&quot;] = &quot;number:10&quot;;
      params[&quot;batchId&quot;] = &quot;0&quot;;
      params[&quot;scriptSessionId&quot;] = &quot;Nathan-DeskTop&quot;;
                           
trace(params);
				
	trace(&quot;service call begin&quot;);

	service.send(params);

trace(&quot;service call end&quot;);
}

The above Action script  POSTs data to a Servlet  below well :


			
It fails to post data to a JSON/DWR based service below :




The response from the DWR service is below :
//#DWR-REPLY

if (window.dwr) dwr.engine._remoteHandleBatchException({ name:&#039;org.directwebremoting.extend.ServerException&#039;, message:&#039;The specified call count is not a number: null&#039; });

else if (window.parent.dwr) window.parent.dwr.engine._remoteHandleBatchException({ name:&#039;org.directwebremoting.extend.ServerException&#039;, message:&#039;The specified call count is not a number: null&#039; });


Based on  the error &#039;The specified call count is not a number: null&#039; – I guess the params[&quot;callCount&quot;] = &quot;1&quot;; is not posted to the server.  Probably nothing gets posted to the server in the JSON format.

I tried these below, no luck

//service.send( JSON.encode(params) );
				
//var  encoder:JSONEncoder = new JSONEncoder(params);
				
//service.send( encoder.getString() );

Wondering how to post JSON data, could you please help ?</description>
		<content:encoded><![CDATA[<p>I have a Flex / JSON / DWR issue :</p>
<p>private function onJSONLoad(event:ResultEvent):void<br />
 {<br />
var params:Object = {};<br />
      params["callCount"] = &#8220;1&#8243;;<br />
      params["page"] = &#8220;/index.jsp&#8221;;<br />
      params["c0-scriptName"] = &#8220;Suggest&#8221;;<br />
      params["c0-methodName"] = &#8220;search&#8221;;<br />
      params["c0-id"] = &#8220;0&#8243;;</p>
<p>      params["c0-param0"] = &#8220;string:search-term&#8221;;<br />
      params["c0-param1"] = &#8220;string:goodman group%7C&#8221;;<br />
      params["c0-param2"] = &#8220;number:10&#8243;;<br />
      params["batchId"] = &#8220;0&#8243;;<br />
      params["scriptSessionId"] = &#8220;Nathan-DeskTop&#8221;;</p>
<p>trace(params);</p>
<p>	trace(&#8220;service call begin&#8221;);</p>
<p>	service.send(params);</p>
<p>trace(&#8220;service call end&#8221;);<br />
}</p>
<p>The above Action script  POSTs data to a Servlet  below well :</p>
<p>It fails to post data to a JSON/DWR based service below :</p>
<p>The response from the DWR service is below :<br />
//#DWR-REPLY</p>
<p>if (window.dwr) dwr.engine._remoteHandleBatchException({ name:&#8217;org.directwebremoting.extend.ServerException&#8217;, message:&#8217;The specified call count is not a number: null&#8217; });</p>
<p>else if (window.parent.dwr) window.parent.dwr.engine._remoteHandleBatchException({ name:&#8217;org.directwebremoting.extend.ServerException&#8217;, message:&#8217;The specified call count is not a number: null&#8217; });</p>
<p>Based on  the error &#8216;The specified call count is not a number: null&#8217; – I guess the params["callCount"] = &#8220;1&#8243;; is not posted to the server.  Probably nothing gets posted to the server in the JSON format.</p>
<p>I tried these below, no luck</p>
<p>//service.send( JSON.encode(params) );</p>
<p>//var  encoder:JSONEncoder = new JSONEncoder(params);</p>
<p>//service.send( encoder.getString() );</p>
<p>Wondering how to post JSON data, could you please help ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: anoop</title>
		<link>http://www.mikechambers.com/blog/2006/03/28/tutorial-using-json-with-flex-2-and-actionscript-3/comment-page-1/#comment-12598</link>
		<dc:creator>anoop</dc:creator>
		<pubDate>Wed, 25 Jun 2008 16:39:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.mikechambers.com/blog/?p=966#comment-12598</guid>
		<description>how remove the error &quot;call to possibly undefined method JSONDecoder&quot;
 i import all the classes like
    import com.adobe.serialization.json.JSONDecoder; 
 but in that after typing import.com.adobe. ,i get only sourceview,does not get serialization in that how to get that...i am flex beginner...if u helping means its a great thing.......</description>
		<content:encoded><![CDATA[<p>how remove the error &#8220;call to possibly undefined method JSONDecoder&#8221;<br />
 i import all the classes like<br />
    import com.adobe.serialization.json.JSONDecoder;<br />
 but in that after typing import.com.adobe. ,i get only sourceview,does not get serialization in that how to get that&#8230;i am flex beginner&#8230;if u helping means its a great thing&#8230;&#8230;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sreeks</title>
		<link>http://www.mikechambers.com/blog/2006/03/28/tutorial-using-json-with-flex-2-and-actionscript-3/comment-page-1/#comment-12510</link>
		<dc:creator>Sreeks</dc:creator>
		<pubDate>Tue, 10 Jun 2008 10:57:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.mikechambers.com/blog/?p=966#comment-12510</guid>
		<description>Hi Mike,

I am getting the following error when tried to use the code provided in this blog. I appreciate any help is provided to me to sort out this issue.



Error: Unexpected o encountered
	at com.adobe.serialization.json::JSONTokenizer/parseError()[C:\Development\ContractProjects\Adobe\as3corelib\src\com\adobe\serialization\json\JSONTokenizer.as:546]
	at com.adobe.serialization.json::JSONTokenizer/getNextToken()[C:\Development\ContractProjects\Adobe\as3corelib\src\com\adobe\serialization\json\JSONTokenizer.as:171]
	at com.adobe.serialization.json::JSONDecoder/nextToken()[C:\Development\ContractProjects\Adobe\as3corelib\src\com\adobe\serialization\json\JSONDecoder.as:86]
	at com.adobe.serialization.json::JSONDecoder/parseObject()[C:\Development\ContractProjects\Adobe\as3corelib\src\com\adobe\serialization\json\JSONDecoder.as:142]
	at com.adobe.serialization.json::JSONDecoder/parseValue()[C:\Development\ContractProjects\Adobe\as3corelib\src\com\adobe\serialization\json\JSONDecoder.as:199]
	at com.adobe.serialization.json::JSONDecoder()[C:\Development\ContractProjects\Adobe\as3corelib\src\com\adobe\serialization\json\JSONDecoder.as:64]
	at com.adobe.serialization.json::JSON$/decode()[C:\Development\ContractProjects\Adobe\as3corelib\src\com\adobe\serialization\json\JSON.as:81]
	at TestJSON/onJSONLoad()[D:\Other\Workplace\Flex\SampleProject\src\TestJSON.mxml:15]
	at TestJSON/__xmlRpc_result()[D:\Other\Workplace\Flex\SampleProject\src\TestJSON.mxml:34]
	at flash.events::EventDispatcher/dispatchEventFunction()





Awaiting for your reply.

Thanks for your precious time.
Sreekanth S</description>
		<content:encoded><![CDATA[<p>Hi Mike,</p>
<p>I am getting the following error when tried to use the code provided in this blog. I appreciate any help is provided to me to sort out this issue.</p>
<p>Error: Unexpected o encountered<br />
	at com.adobe.serialization.json::JSONTokenizer/parseError()[C:\Development\ContractProjects\Adobe\as3corelib\src\com\adobe\serialization\json\JSONTokenizer.as:546]<br />
	at com.adobe.serialization.json::JSONTokenizer/getNextToken()[C:\Development\ContractProjects\Adobe\as3corelib\src\com\adobe\serialization\json\JSONTokenizer.as:171]<br />
	at com.adobe.serialization.json::JSONDecoder/nextToken()[C:\Development\ContractProjects\Adobe\as3corelib\src\com\adobe\serialization\json\JSONDecoder.as:86]<br />
	at com.adobe.serialization.json::JSONDecoder/parseObject()[C:\Development\ContractProjects\Adobe\as3corelib\src\com\adobe\serialization\json\JSONDecoder.as:142]<br />
	at com.adobe.serialization.json::JSONDecoder/parseValue()[C:\Development\ContractProjects\Adobe\as3corelib\src\com\adobe\serialization\json\JSONDecoder.as:199]<br />
	at com.adobe.serialization.json::JSONDecoder()[C:\Development\ContractProjects\Adobe\as3corelib\src\com\adobe\serialization\json\JSONDecoder.as:64]<br />
	at com.adobe.serialization.json::JSON$/decode()[C:\Development\ContractProjects\Adobe\as3corelib\src\com\adobe\serialization\json\JSON.as:81]<br />
	at TestJSON/onJSONLoad()[D:\Other\Workplace\Flex\SampleProject\src\TestJSON.mxml:15]<br />
	at TestJSON/__xmlRpc_result()[D:\Other\Workplace\Flex\SampleProject\src\TestJSON.mxml:34]<br />
	at flash.events::EventDispatcher/dispatchEventFunction()</p>
<p>Awaiting for your reply.</p>
<p>Thanks for your precious time.<br />
Sreekanth S</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bill</title>
		<link>http://www.mikechambers.com/blog/2006/03/28/tutorial-using-json-with-flex-2-and-actionscript-3/comment-page-1/#comment-12483</link>
		<dc:creator>Bill</dc:creator>
		<pubDate>Mon, 02 Jun 2008 20:48:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.mikechambers.com/blog/?p=966#comment-12483</guid>
		<description>I&#039;m having the same issue as John Hall.  It seems to be an issue with Flex 3 and the corelib ActionScript 3 library.

Anyone found a solution to this?</description>
		<content:encoded><![CDATA[<p>I&#8217;m having the same issue as John Hall.  It seems to be an issue with Flex 3 and the corelib ActionScript 3 library.</p>
<p>Anyone found a solution to this?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
