<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>麟 - Alan Cheung &#187; Programming</title>
	<atom:link href="http://hkalan.com/category/blog/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://hkalan.com</link>
	<description>Alan Cheung</description>
	<lastBuildDate>Wed, 28 Dec 2011 04:12:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Amazon AWS errors and solutions</title>
		<link>http://hkalan.com/2011/12/20/amazon-aws-errors-and-solutions/</link>
		<comments>http://hkalan.com/2011/12/20/amazon-aws-errors-and-solutions/#comments</comments>
		<pubDate>Tue, 20 Dec 2011 03:06:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://hkalan.com/?p=461</guid>
		<description><![CDATA[FTP: 500 OOPS: cannot change directory:/home/developer &#62; setsebool allow_ftpd_full_access=1 &#62; setsebool sftpd_enable_homedirs on Sendmail: NOQUEUE: SYSERR(apache): can not chdir(/var/spool/clientmqueue/): Permission denied &#62; setsebool httpd_can_sendmail on &#62; service sendmail restart]]></description>
			<content:encoded><![CDATA[<p><strong>FTP: 500 OOPS: cannot change directory:/home/developer</strong></p>
<p>&gt; setsebool allow_ftpd_full_access=1<br />
&gt; setsebool sftpd_enable_homedirs on</p>
<p><strong>Sendmail: NOQUEUE: SYSERR(apache): can not chdir(/var/spool/clientmqueue/): Permission denied</strong><br />
&gt; setsebool httpd_can_sendmail on<br />
&gt; service sendmail restart</p>
]]></content:encoded>
			<wfw:commentRss>http://hkalan.com/2011/12/20/amazon-aws-errors-and-solutions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RemoveChild, exists check</title>
		<link>http://hkalan.com/2011/11/08/removechild-exists-check/</link>
		<comments>http://hkalan.com/2011/11/08/removechild-exists-check/#comments</comments>
		<pubDate>Tue, 08 Nov 2011 06:51:25 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://hkalan.com/?p=458</guid>
		<description><![CDATA[Removing child always need to be checked against if it exists. Use .contains() : var main:MovieClip = new MovieClip; var childMovie:MovieClip = new MovieClip main.addChild(childMovie); if (obj.contains(childMovie) main.remove(childMovie); This will advoid the non-exists problem.]]></description>
			<content:encoded><![CDATA[<p>Removing child always need to be checked against if it exists.</p>
<p>Use .contains() :</p>
<pre>
var main:MovieClip = new MovieClip;
var childMovie:MovieClip = new MovieClip
main.addChild(childMovie);

if (obj.contains(childMovie)
  main.remove(childMovie);
</pre>
<p>This will advoid the non-exists problem.</p>
]]></content:encoded>
			<wfw:commentRss>http://hkalan.com/2011/11/08/removechild-exists-check/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cannot run program &#8220;java.exe&#8221; &#8220;CreateProcess error=87, The parameter is incorrect&#8221;</title>
		<link>http://hkalan.com/2011/10/28/cannot-run-program-java-exe-createprocess-error87-the-parameter-is-incorrect/</link>
		<comments>http://hkalan.com/2011/10/28/cannot-run-program-java-exe-createprocess-error87-the-parameter-is-incorrect/#comments</comments>
		<pubDate>Fri, 28 Oct 2011 01:41:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[ios]]></category>
		<category><![CDATA[ipad]]></category>
		<category><![CDATA[iphone]]></category>

		<guid isPermaLink="false">http://hkalan.com/?p=455</guid>
		<description><![CDATA[Spent like a day to find out why flex would come up a java error, with a message like this: Cannot run program &#8220;java.exe&#8221; &#8220;CreateProcess error=87, The parameter is incorrect&#8221; However, compiling the source and run it off simulator would work fine. Things won&#8217;t work on the iPad / iPhone devices. Searching on google didn&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p>Spent like a day to find out why flex would come up a java error, with a message like this:</p>
<p>Cannot run program &#8220;java.exe&#8221; &#8220;CreateProcess error=87, The parameter is incorrect&#8221;</p>
<p>However, compiling the source and run it off simulator would work fine. Things won&#8217;t work on the iPad / iPhone devices.</p>
<p>Searching on google didn&#8217;t really help. Finally, found it is because the number of files included in the package is too much. In my case I have included 1200+ mp3 files from previous project. </p>
<p>Hope this will help someone to save time.</p>
]]></content:encoded>
			<wfw:commentRss>http://hkalan.com/2011/10/28/cannot-run-program-java-exe-createprocess-error87-the-parameter-is-incorrect/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Resolved Many_Many relationship with CAdvancedArBehavior and application.components.Relation Widget</title>
		<link>http://hkalan.com/2011/01/05/resolved-many_many-relationship-with-cadvancedarbehavior-and-application-components-relation-widget/</link>
		<comments>http://hkalan.com/2011/01/05/resolved-many_many-relationship-with-cadvancedarbehavior-and-application-components-relation-widget/#comments</comments>
		<pubDate>Wed, 05 Jan 2011 17:44:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[CAdvancedArBehavior]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Yii]]></category>

		<guid isPermaLink="false">http://hkalan.com/?p=443</guid>
		<description><![CDATA[I spent so much time to accomplish little thing &#8211; MANY to MANY relationship to work with a Widget in Yii. (I wish to write as least code as possible). Here is my solution: Use this component, it depends on GHelper. You will also want the views files too. Once you got them setup, the [...]]]></description>
			<content:encoded><![CDATA[<p>I spent so much time to accomplish little thing &#8211; MANY to MANY relationship to work with a Widget in Yii. (I wish to write as least code as possible).</p>
<p>Here is my solution:</p>
<p>Use <a href="http://code.google.com/p/gii-template-collection/source/browse/trunk/gtc/components/Relation.php?r=155">this component</a>, it depends on <a href="http://code.google.com/p/gii-template-collection/source/browse/trunk/gtc/components/GHelper.php?r=155">GHelper</a>. You will also want the <a href="http://code.google.com/p/gii-template-collection/source/browse/trunk/gtc/components/views/dropdownlist.php?r=155">views files</a> too.</p>
<p>Once you got them setup, the easiest way to get the MANY to MANY update (and create), do the followings:</p>
<p>1. You will need <a href="http://code.google.com/p/gii-template-collection/source/browse/trunk/gtc/components/CAdvancedArBehavior.php?r=155">CAdvancedArBehavior</a>.<br />
2. Use the same relation name as the table name e.g.:<br />
<code>'Location' =&gt; array(self::MANY_MANY, 'Location', 'client_location(client_id, location_id)')</code><br />
3. Simply use the widget in your view, e.g.:<br />
<code><br />
$this-&gt;widget('application.components.Relation', array(<br />
'model' =&gt; $model,<br />
'style' =&gt; 'listbox',<br />
'relation' =&gt; 'Location',<br />
'fields' =&gt; 'name',<br />
'showAddButton'=&gt;false,<br />
'htmlOptions' =&gt; array('style' =&gt; 'width: 100px;')<br />
));<br />
</code><br />
4. Don&#8217;t forget you need to give &#8220;safe&#8221; in the rules in your model of the attribute (&#8216;Location&#8217; in my case)</p>
<p>5. You may want to alter the $sycndb at around line 82 of CAdvancedArBehavior.php so that it will actually do things with your DB.</p>
]]></content:encoded>
			<wfw:commentRss>http://hkalan.com/2011/01/05/resolved-many_many-relationship-with-cadvancedarbehavior-and-application-components-relation-widget/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flex FileReference Download error: #2167</title>
		<link>http://hkalan.com/2010/04/22/flex-filereference-download-error-2167/</link>
		<comments>http://hkalan.com/2010/04/22/flex-filereference-download-error-2167/#comments</comments>
		<pubDate>Thu, 22 Apr 2010 19:53:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://hkalan.com/?p=353</guid>
		<description><![CDATA[Its quite hard to believe that such a simple thing &#8211; download a file from server in flex is such a pain! The code was very simple, from the manual and example: var fileRef:FileReference = new FileReference&#40;&#41;; fileRef.download&#40;new URLRequest&#40;&#34;myFile.txt&#34;&#41;, &#34;myFile.txt&#34;&#41;; But in real world, there are things that they didn&#8217;t tell unless you hit it! [...]]]></description>
			<content:encoded><![CDATA[<p>Its quite hard to believe that such a simple thing &#8211; download a file from server in flex is such a pain!</p>
<p>The code was very simple, from the manual and example:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> fileRef:FileReference = <span style="color: #000000; font-weight: bold;">new</span> FileReference<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
fileRef.<span style="color: #006600;">download</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> URLRequest<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;myFile.txt&quot;</span><span style="color: #66cc66;">&#41;</span>, <span style="color: #ff0000;">&quot;myFile.txt&quot;</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>But in real world, there are things that they didn&#8217;t tell unless you hit it!<br />
From flash player 10, all uploads/downloads in fileRef won&#8217;t allowed seamlessly. It require user to click a button or hotkey to invoke upload/download action. Otherwise it will give you an error #2167. This isn&#8217;t difficult to resolve if it&#8217;s not too much of a pain for your user to click a button one more time.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">Alert.<span style="color: #0066CC;">show</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Click OK to download.&quot;</span>,<span style="color: #000000; font-weight: bold;">null</span>,<span style="color: #cc66cc;">4</span>,<span style="color: #000000; font-weight: bold;">null</span>,startDownload<span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> startDownload<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><span style="color: #66cc66;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">var</span> fileRef:FileReference;
		fileRef = <span style="color: #000000; font-weight: bold;">new</span> FileReference<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
		const FILE_URL:<span style="color: #0066CC;">String</span> = <span style="color: #ff0000;">&quot;myTextFile.txt&quot;</span>;
		urlReq = <span style="color: #000000; font-weight: bold;">new</span> URLRequest<span style="color: #66cc66;">&#40;</span>FILE_URL<span style="color: #66cc66;">&#41;</span>;
		urlReq.<span style="color: #006600;">method</span> = URLRequestMethod.<span style="color: #0066CC;">GET</span>;
		<span style="color: #0066CC;">try</span>
			<span style="color: #66cc66;">&#123;</span>
				fileRef.<span style="color: #006600;">download</span><span style="color: #66cc66;">&#40;</span>urlReq<span style="color: #66cc66;">&#41;</span>;
			<span style="color: #66cc66;">&#125;</span>
			<span style="color: #0066CC;">catch</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">error</span>:<span style="color: #0066CC;">Error</span><span style="color: #66cc66;">&#41;</span>
			<span style="color: #66cc66;">&#123;</span>
				Alert.<span style="color: #0066CC;">show</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">error</span>.<span style="color: #0066CC;">message</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #66cc66;">&#125;</span>
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>I thought this could work, not until I found that my <a href="http://hkalan.com/2010/04/05/232/">previous post</a>&#8230; you need to define the fileReference outside of the function&#8230; otherwise it won&#8217;t!<br />
Finally&#8230; this would work:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> fileRef:FileReference;
fileRef = <span style="color: #000000; font-weight: bold;">new</span> FileReference<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
Alert.<span style="color: #0066CC;">show</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Click OK to download.&quot;</span>,<span style="color: #000000; font-weight: bold;">null</span>,<span style="color: #cc66cc;">4</span>,<span style="color: #000000; font-weight: bold;">null</span>,startDownload<span style="color: #66cc66;">&#41;</span>;
<span style="color: #000000; font-weight: bold;">function</span> startDownload<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><span style="color: #66cc66;">&#123;</span>
&nbsp;
		const FILE_URL:<span style="color: #0066CC;">String</span> = <span style="color: #ff0000;">&quot;myTextFile.txt&quot;</span>;
		urlReq = <span style="color: #000000; font-weight: bold;">new</span> URLRequest<span style="color: #66cc66;">&#40;</span>FILE_URL<span style="color: #66cc66;">&#41;</span>;
		urlReq.<span style="color: #006600;">method</span> = URLRequestMethod.<span style="color: #0066CC;">GET</span>;
		<span style="color: #0066CC;">try</span>
			<span style="color: #66cc66;">&#123;</span>
				fileRef.<span style="color: #006600;">download</span><span style="color: #66cc66;">&#40;</span>urlReq<span style="color: #66cc66;">&#41;</span>;
			<span style="color: #66cc66;">&#125;</span>
			<span style="color: #0066CC;">catch</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">error</span>:<span style="color: #0066CC;">Error</span><span style="color: #66cc66;">&#41;</span>
			<span style="color: #66cc66;">&#123;</span>
				Alert.<span style="color: #0066CC;">show</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">error</span>.<span style="color: #0066CC;">message</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://hkalan.com/2010/04/22/flex-filereference-download-error-2167/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Problem in downloading file</title>
		<link>http://hkalan.com/2010/04/05/232/</link>
		<comments>http://hkalan.com/2010/04/05/232/#comments</comments>
		<pubDate>Mon, 05 Apr 2010 11:57:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://hkalan.com/2010/04/05/232/</guid>
		<description><![CDATA[Click a button and download a file in Flex is very simple but Adobe’s official example has a problem which made me spent like 20 mins to find a work around. This won’t work: var request:URLRequest = new URLRequest&#40;&#34;index.xml&#34;&#41;; var fileRef:FileReference = new FileReference&#40;&#41;; fileRef.download&#40;request&#41;; But this will work: var fileRef:FileReference = new FileReference&#40;&#41;; function [...]]]></description>
			<content:encoded><![CDATA[<p>Click a button and download a file in Flex is very simple but Adobe’s official example has a problem which made me spent like 20 mins to find a work around.<br />
This won’t work:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> request:URLRequest = <span style="color: #000000; font-weight: bold;">new</span> URLRequest<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;index.xml&quot;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #000000; font-weight: bold;">var</span> fileRef:FileReference = <span style="color: #000000; font-weight: bold;">new</span> FileReference<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
fileRef.<span style="color: #006600;">download</span><span style="color: #66cc66;">&#40;</span>request<span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>But this will work:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> fileRef:FileReference = <span style="color: #000000; font-weight: bold;">new</span> FileReference<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #000000; font-weight: bold;">function</span> downloadFile<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>   
fileRef.<span style="color: #006600;">download</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> URLRequest<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;index.xml&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
downloadFile<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://hkalan.com/2010/04/05/232/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pass by Value</title>
		<link>http://hkalan.com/2010/04/05/pass-by-value/</link>
		<comments>http://hkalan.com/2010/04/05/pass-by-value/#comments</comments>
		<pubDate>Mon, 05 Apr 2010 11:55:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://hkalan.com/?p=230</guid>
		<description><![CDATA[Actionscript 3 will always pass by reference unless the assignation is a primitive type (such as integer or string). I had an array and want to pass it by value (means it will copy the whole array’s value in it instead of referencing). It is because referencing will affect the referenced array when the new [...]]]></description>
			<content:encoded><![CDATA[<p>Actionscript 3 will always pass by reference unless the assignation is a primitive type (such as integer or string). I had an array and want to pass it by value (means it will copy the whole array’s value in it instead of referencing). It is because referencing will affect the referenced array when the new array is being changed in value.I came across with a script to deal with it. it may not be perfect, but have a look:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> clone<span style="color: #66cc66;">&#40;</span>source:<span style="color: #0066CC;">Object</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #66cc66;">*</span><span style="color: #66cc66;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">var</span> myBA:ByteArray = <span style="color: #000000; font-weight: bold;">new</span> ByteArray<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
  myBA.<span style="color: #006600;">writeObject</span><span style="color: #66cc66;">&#40;</span>source<span style="color: #66cc66;">&#41;</span>;
  myBA.<span style="color: #0066CC;">position</span> = <span style="color: #cc66cc;">0</span>;
  <span style="color: #b1b100;">return</span><span style="color: #66cc66;">&#40;</span>myBA.<span style="color: #006600;">readObject</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>Be aware that your objects in your array (or object)’s type may changed to Object/Array instead of it’s previous type.</p>
<p>UPDATE: There is also a method in Flex ObjectUtil class called &#8220;copy&#8221; <a href="http://livedocs.adobe.com/flex/201/langref/mx/utils/ObjectUtil.html#copy()">ObjectUtil.copy();</a> which copies the specified Object and returns a reference to the copy.</p>
<p>Hopefully this is helpful to someone.</p>
]]></content:encoded>
			<wfw:commentRss>http://hkalan.com/2010/04/05/pass-by-value/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dynamic itemrenderer reload when datachanged</title>
		<link>http://hkalan.com/2010/04/05/dynamic-itemrenderer-reload-when-data-changed/</link>
		<comments>http://hkalan.com/2010/04/05/dynamic-itemrenderer-reload-when-data-changed/#comments</comments>
		<pubDate>Mon, 05 Apr 2010 11:47:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://hkalan.com/?p=225</guid>
		<description><![CDATA[I had some troubles to re-load my itemrenderer. When the dataprovider of your collection (Tilebase or whatever) chage, the itemrenderer of exists items does not re-init, if your code is in creationComplete event. Finally I found a solution:in your itemrenderer file, on the creationComplete handler, add: this.addEventListener&#40;FlexEvent.DATA_CHANGE, dataChanged&#41;;dataChanged&#40;&#41;; Then, in the dataChange function, you can [...]]]></description>
			<content:encoded><![CDATA[<p>I had some troubles to re-load my itemrenderer. When the dataprovider of your collection (Tilebase or whatever) chage, the itemrenderer of exists items does not re-init, if your code is in creationComplete event. Finally I found a solution:in your itemrenderer file, on the creationComplete handler, add:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">this</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>FlexEvent.<span style="color: #006600;">DATA_CHANGE</span>, dataChanged<span style="color: #66cc66;">&#41;</span>;dataChanged<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>Then, in the dataChange function, you can do whatever you want for your itemrenderer when your dataprovider change.Hope this will help someone.</p>
]]></content:encoded>
			<wfw:commentRss>http://hkalan.com/2010/04/05/dynamic-itemrenderer-reload-when-data-changed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

