<?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>Flex 4 - Adobe AIR &#187; Modules</title>
	<atom:link href="http://www.flex4all.com/blog/tag/modules/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.flex4all.com/blog</link>
	<description>Rich Internet Applications &#124; Flex &#124; Adobe AIR &#124; Enterprise Software</description>
	<lastBuildDate>Sat, 05 Sep 2009 10:03:56 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Multiple Controller for Modules</title>
		<link>http://www.flex4all.com/blog/2009/09/multiple-controller-modules/</link>
		<comments>http://www.flex4all.com/blog/2009/09/multiple-controller-modules/#comments</comments>
		<pubDate>Sat, 05 Sep 2009 09:42:48 +0000</pubDate>
		<dc:creator>Bidhan Sutar</dc:creator>
				<category><![CDATA[Modules]]></category>
		<category><![CDATA[Modules Framework]]></category>
		<category><![CDATA[Multi Controller]]></category>

		<guid isPermaLink="false">http://www.flex4all.com/blog/?p=39</guid>
		<description><![CDATA[It supports multiple controllers in a single application. So modules can have their own controllers. It is based on event bubbling.
You can register the event and the handlers either in MXML  or in a class by extending the controller in the framework. The event and the handlers are provided to the controller as an instance [...]]]></description>
			<content:encoded><![CDATA[<p>It supports <strong>multiple controllers</strong> in a single application. So <strong>modules</strong> can have their own controllers. It is based on event bubbling.</p>
<p>You can register the event and the handlers either in MXML  or in a class by extending the controller in the framework. The event and the handlers are provided to the controller as an instance of the EventMap class.</p>
<p>The details of these classes :-</p>
<p><strong>The controller</strong></p>
<p><strong><span style="color: #ff0000;">com.fmvc.controller.FController</span></strong></p>
<p>It registers the events and the corresponding handlers. When the event is fired the class in which the handler method exists is instantiated and the handler method is executed. There can be multiple handlers in one class. While registering the events the className, methodName and the eventName are to be given.</p>
<p>For registering the events either MXML or AS can be used. A reference of the component to which the controller is added is to be provided as the value of the property base when the controller is initiated. This is for adding a different controllers  for modules or a set of components. By default is will point to the main application.</p>
<p><strong>Event</strong></p>
<p><strong><span style="color: #ff0000;">com.fmvc.event.FlowEvent</span></strong></p>
<p>The event which is to be dispatched for handling in the controller. This event bubbles always and that is how it reaches the controller. </p>
<p><strong>Handlers</strong></p>
<p>The event handlers will be defined in the classes (like the command classes in Cairngorm) in the application. There can be multiple methods in a single class.</p>
<p>The name of the method will be registered in the controller. The handler class should implement the interface <strong> </strong></p>
<p><strong><span style="color: #ff0000;">com.fmvc.controller.IEventHandler</span></strong></p>
<p><span style="color: #000000;">I am also putting an example for the same which has one module application.</span></p>
<p>[kml_flashembed publishmethod="dynamic" fversion="10.0.r2" replaceId="FrameworkTest" movie="http://www.flex4all.com/blog/wp-content/uploads/frameworkTest.swf" width="100%" height="450" targetclass="flashmovie"]</p>
<p><a href="http://adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>
<p>[/kml_flashembed]</p>
<p>I am also attaching the source  code. </p>
<p> <a title="Flex project Source Code Framework Test" href="http://www.flex4all.com/blog/wp-content/uploads/frameworkTest.zip" target="_blank">Click Here</a></p>
<p>Do let your comments for the same</p>
<h6><span style="color: #c0c0c0;"> - Manoj Mathew</span></h6>
]]></content:encoded>
			<wfw:commentRss>http://www.flex4all.com/blog/2009/09/multiple-controller-modules/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
