<?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>Arteraktiv &#187; coding technique</title>
	<atom:link href="http://arteraktiv.com/tag/coding-technique/feed/" rel="self" type="application/rss+xml" />
	<link>http://arteraktiv.com</link>
	<description>Actionscript, PHP, JAVA</description>
	<lastBuildDate>Thu, 31 Mar 2011 02:56:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Flex dan MVC</title>
		<link>http://arteraktiv.com/2009/11/19/flex-dan-mvc/</link>
		<comments>http://arteraktiv.com/2009/11/19/flex-dan-mvc/#comments</comments>
		<pubDate>Thu, 19 Nov 2009 05:08:30 +0000</pubDate>
		<dc:creator>Agil</dc:creator>
				<category><![CDATA[coding technique]]></category>
		<category><![CDATA[flex 3]]></category>
		<category><![CDATA[actionscript 3]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[design pattern]]></category>
		<category><![CDATA[MVC]]></category>

		<guid isPermaLink="false">http://localhost/blog/?p=3</guid>
		<description><![CDATA[Tutorial flex kali ini membahas tentang teknik coding aplikasi menggunakan MVC (Model View Controller) sehingga nantinya aplikasi akan lebih mudah diubah antar mukanya (user interface) tanpa mempengaruhi alur logikanya (Business Logic) ataupun sebaliknya.]]></description>
			<content:encoded><![CDATA[<p>Tulisan ini diolah dari <a title="flex and mvc" href="http://www.actionscript.org/resources/articles/751/1/Flex-and-MVC---Part-I/Page1.html" target="_blank">sini</a>.</p>
<p>Tulisan ini akan mengulas sedikit tentang penggunaan MVC pada flex. MVC (Model View Controller) ialah design pattern yang umum pada dunia software engineering. Teknik ini membantu memisahkan view, model, dan controller.</p>
<p><strong>MVC: Pendahuluan </strong></p>
<p>Suksesnya penggunaan Model View Controller (MVC) memisahkan business logic (controller) dari user interface, sehingga aplikasi mudah untuk diubah dan dikelola baik pada business logic-nya atau pada user interface-nya tanpa mempengaruhi satu sama lain.<span id="more-3"></span></p>
<p><strong>Model<br />
<span style="font-weight: normal;">Model menggambarkan data dari aplikasi.</span></strong></p>
<p><strong>View</strong>Menyajikan model dalam bentuk yang dapat dimengerti manusia yang disebut User Interface.</p>
<p><strong>Controller<br />
<span style="font-weight: normal;">Memuat business logic yang bertanggung jawab mengubah data pada model.</span></strong> Pada Web Application umumnya, page HTML (JSP/ASP) membentuk view, model digambarkan oleh data yang disimpan pada View State/Session/Database. Business Services (Controller) digunakan untuk berinteraksi dengan model dan memperbarui data.</p>
<p>Untuk lebih lengkapnya bisa baca di <a title="Wikipedia MVC" href="http://en.wikipedia.org/wiki/Model-view-controller" target="_blank">Wikipedia</a>.</p>
<p>Hello World &#8211; cepat dan singkat.</p>
<p>Pada tulisan ini kita akan mencoba &#8220;Hello World&#8221; yang sederhana  Pada contoh berikut ini, program ini akan menerima input dari user yang kemudian mengatakan &#8220;Hello&#8221; pada user.</p>
<p><strong>main.mxml</strong></p>
<div class="codecolorer-container mxml default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br /></div></td><td><div class="mxml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #7400FF;">&gt;</span></span><br />
<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Application</span> xmlns:mx=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span></span><br />
<span style="color: #000000;">&nbsp; &nbsp; width=<span style="color: #ff0000;">&quot;300&quot;</span></span><br />
<span style="color: #000000;">&nbsp; &nbsp; height=<span style="color: #ff0000;">&quot;150&quot;</span><span style="color: #7400FF;">&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #339933;">&lt;mx:Script&gt;</span><br />
<span style="color: #339933;">&nbsp; &nbsp; &nbsp; &nbsp; &lt;![CDATA[</span><br />
<span style="color: #339933;">&nbsp; &nbsp; &nbsp; &nbsp; import mx.controls.Alert;</span><br />
<span style="color: #339933;">&nbsp; &nbsp; &nbsp; &nbsp; // Business Logic Controller</span><br />
<span style="color: #339933;">&nbsp; &nbsp; &nbsp; &nbsp; private function clickHandler():void</span><br />
<span style="color: #339933;">&nbsp; &nbsp; &nbsp; &nbsp; {</span><br />
<span style="color: #339933;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Model</span><br />
<span style="color: #339933;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Alert.show('Hello '+personName.text, 'Hello World!');</span><br />
<span style="color: #339933;">&nbsp; &nbsp; &nbsp; &nbsp; }</span><br />
<span style="color: #339933;">&nbsp; &nbsp; &nbsp; &nbsp; ]]&gt;</span><br />
<span style="color: #339933;">&nbsp; &nbsp; &lt;/mx:Script&gt;</span><br />
&nbsp; &nbsp; <span style="color: #000000;"><span style="color: #808080; font-style: italic;">&lt;!-- View --&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:TextInput</span> id=<span style="color: #ff0000;">&quot;personName&quot;</span> <span style="color: #7400FF;">/&gt;</span></span><br />
<br />
&nbsp; &nbsp; <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Button</span> id=<span style="color: #ff0000;">&quot;showHello&quot;</span> label=<span style="color: #ff0000;">&quot;Say Hello&quot;</span> click=<span style="color: #ff0000;">&quot;clickHandler();&quot;</span><span style="color: #7400FF;">/&gt;</span></span><br />
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Application</span><span style="color: #7400FF;">&gt;</span></span></div></td></tr></tbody></table></div>
<p>Di sini Anda lihat kita telah menambahkan 3 component. Sintaks MXML sebagai view, clickHandler() sebagai business logic atau controller (dalam hal ini menambahkan kata-kata pada user dan mengatakan hello) dan model yang memuat data yaitu nama yang diketikkan user.</p>
<p><strong>main.swf</strong></p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="300" height="150" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="src" value="http://arteraktiv.com/fai/wp-content/uploads/2010/01/MVC_quick_dirty.swf" /><embed type="application/x-shockwave-flash" width="300" height="150" src="http://arteraktiv.com/fai/wp-content/uploads/2010/01/MVC_quick_dirty.swf"></embed></object></p>
<p>Mungkin kita sempat berpikir mengapa harus menggunakan cara yang rumit untuk hal sesederhana itu? Untuk contoh ini memang terlihat sederhana, namun seiring bertambahnya kode kita maka akan terasa bahwa pola(pattern) ini sangat berguna.</p>
<p>Ok, saatnya kita buat aplikasi flex dengan MVC yang sedikit lebih lengkap.</p>
<p>Membuat View</p>
<p>Marilah kita buat view-nya yang semata-mata bertanggung jawab untuk menampilkan data kepada user.</p>
<p><strong>Main.mxml</strong></p>
<div class="codecolorer-container mxml default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br /></div></td><td><div class="mxml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #7400FF;">&gt;</span></span><br />
<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Application</span> xmlns:mx=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span><span style="color: #7400FF;">&gt;</span></span><br />
<br />
&nbsp; &nbsp; <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:TextInput</span> id=<span style="color: #ff0000;">&quot;personName&quot;</span> <span style="color: #7400FF;">/&gt;</span></span><br />
<br />
&nbsp; &nbsp; <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Text</span> id=<span style="color: #ff0000;">&quot;res&quot;</span> text=<span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #7400FF;">/&gt;</span></span><br />
<br />
&nbsp; &nbsp; <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Button</span> id=<span style="color: #ff0000;">&quot;showHello&quot;</span> label=<span style="color: #ff0000;">&quot;Say Hello&quot;</span> <span style="color: #7400FF;">/&gt;</span></span><br />
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Application</span><span style="color: #7400FF;">&gt;</span></span></div></td></tr></tbody></table></div>
<p>Kode tersebut akan menampilkan interface sederhana, yaitu:</p>
<ul>
<li>TextInput: digunakan user untuk memasukkan namanya.</li>
<li>Text: yang akan menampilkan hasil keluaran.</li>
<li>Button: mengelik akan memicu event.</li>
</ul>
<p>Membuat Model</p>
<p>Model berfungsi untuk memuat data. Dalam kasus ini kita akan membuat singleton class sehingga data tetap terjaga (persisted) walaupun lintas class.</p>
<p><strong>Model.as</strong></p>
<div class="codecolorer-container actionscript3 default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br /></div></td><td><div class="actionscript3 codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #9900cc; font-weight: bold;">package</span> classes<span style="color: #000066; font-weight: bold;">.</span>MVC1<br />
<span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#91;</span>Bindable<span style="color: #000000;">&#93;</span><br />
&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> Model<br />
&nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">private</span> static <span style="color: #6699cc; font-weight: bold;">var</span> _model<span style="color: #000066; font-weight: bold;">:</span>Model<span style="color: #000066; font-weight: bold;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">public</span> static <span style="color: #339966; font-weight: bold;">function</span> getInstance<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span>Model<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span>_model == <span style="color: #0033ff; font-weight: bold;">null</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _model = <span style="color: #0033ff; font-weight: bold;">new</span> Model<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">return</span> _model<span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> Model<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _model = <span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">var</span> result<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=string%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:string.html"><span style="color: #004993;">String</span></a> = <span style="color: #990000;">&quot;Hello &quot;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
<span style="color: #000000;">&#125;</span></div></td></tr></tbody></table></div>
<p>Catatan:</p>
<ol>
<li>Class telah ditandai sebagai [Bindable], sehingga perubahan pada salah satu member-nya akan mempengaruhi View.</li>
<li>variabel &#8220;result&#8221; memuat data dan akan digunakan untuk memperbaharui View.</li>
</ol>
<p>Membuat Controller</p>
<p>Controller memuat business logic yang dalam hal ini sangat sederhana (Menambahkan string &#8220;hello&#8221; pada nama user).</p>
<p><strong>Controller.as</strong></p>
<div class="codecolorer-container actionscript3 default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br /></div></td><td><div class="actionscript3 codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #9900cc; font-weight: bold;">package</span> classes<span style="color: #000066; font-weight: bold;">.</span>MVC1<br />
<span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> Controller<br />
&nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> showName<span style="color: #000000;">&#40;</span><span style="color: #004993;">name</span><span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=string%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:string.html"><span style="color: #004993;">String</span></a><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #6699cc; font-weight: bold;">var</span> model<span style="color: #000066; font-weight: bold;">:</span>Model = Model<span style="color: #000066; font-weight: bold;">.</span>getInstance<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; model<span style="color: #000066; font-weight: bold;">.</span>result <span style="color: #000066; font-weight: bold;">+</span>= &nbsp;<span style="color: #004993;">name</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
<span style="color: #000000;">&#125;</span></div></td></tr></tbody></table></div>
<p>Terlihat bahwa kita menggunakan Model sebagai singleton class yang kemudian memperbaharui nilai &#8220;result&#8221;.</p>
<p>Menghubungkan dengan View</p>
<p>Saatnya untuk menghubungkan view pada model dan controller. Sehingga Main.mxml menjadi seperti berikut ini:</p>
<p><strong>Main.mxml</strong></p>
<div class="codecolorer-container mxml default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br /></div></td><td><div class="mxml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000;">&lt;?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #7400FF;">&gt;</span></span><br />
<span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Application</span> xmlns:mx=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span></span><br />
<span style="color: #000000;">&nbsp; &nbsp; width=<span style="color: #ff0000;">&quot;300&quot;</span> height=<span style="color: #ff0000;">&quot;150&quot;</span><span style="color: #7400FF;">&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #339933;">&lt;mx:Script&gt;</span><br />
<span style="color: #339933;"> &nbsp; &nbsp; &nbsp; &nbsp;&lt;![CDATA[</span><br />
<span style="color: #339933;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;import classes.MVC1.Controller;</span><br />
<span style="color: #339933;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;import classes.MVC1.Model;</span><br />
<br />
<span style="color: #339933;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[Bindable]</span><br />
<span style="color: #339933;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;private var model:Model = Model.getInstance();</span><br />
<br />
<span style="color: #339933;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;private function clickHandler():void</span><br />
<span style="color: #339933;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</span><br />
<span style="color: #339933;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;var controller:Controller = new Controller();</span><br />
<span style="color: #339933;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;controller.showName(personName.text);</span><br />
<span style="color: #339933;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</span><br />
<span style="color: #339933;"> &nbsp; &nbsp; &nbsp; &nbsp;]]&gt;</span><br />
<span style="color: #339933;"> &nbsp; &nbsp;&lt;/mx:Script&gt;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:TextInput</span> id=<span style="color: #ff0000;">&quot;personName&quot;</span> <span style="color: #7400FF;">/&gt;</span></span><br />
<br />
&nbsp; &nbsp; <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Text</span> id=<span style="color: #ff0000;">&quot;res&quot;</span> text=<span style="color: #ff0000;">&quot;{model.result}&quot;</span> <span style="color: #7400FF;">/&gt;</span></span><br />
<br />
&nbsp; &nbsp; <span style="color: #000000;"><span style="color: #7400FF;">&lt;mx:Button</span> id=<span style="color: #ff0000;">&quot;showHello&quot;</span> label=<span style="color: #ff0000;">&quot;Say Hello&quot;</span> click=<span style="color: #ff0000;">&quot;clickHandler();&quot;</span><span style="color: #7400FF;">/&gt;</span></span><br />
<span style="color: #000000;"><span style="color: #7400FF;">&lt;/mx:Application</span><span style="color: #7400FF;">&gt;</span></span></div></td></tr></tbody></table></div>
<p>Catatan:</p>
<ol>
<li>event handler button memanggil Controller.</li>
<li>text terikat pada variabel &#8220;result&#8221; pada Model.</li>
</ol>
<p>dan sekarang kita dapatkan MVC-nya telah tersambung satu sama lain.</p>
<p>Tulisan ini kami terjemahkan dengan beberapa tambahan dan pengurangan, saran, kritik, pertanyaan silakan tuliskan komentar.</p>
<p>Terima Kasih.</p>
]]></content:encoded>
			<wfw:commentRss>http://arteraktiv.com/2009/11/19/flex-dan-mvc/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

