Hi Alex It worked .
Thanks Rajan ________________________________ From: Alex Harui <[EMAIL PROTECTED]> To: "[email protected]" <[email protected]> Sent: Saturday, November 8, 2008 11:59:22 PM Subject: RE: [flexcoders] ModuleLoader does not load module when instance is created as ModuleLoader() I would try Panel.addChild( mod2) From:[EMAIL PROTECTED] ups.com [mailto:flexcoders@ yahoogroups. com] On Behalf Of ilikeflex Sent: Friday, November 07, 2008 3:12 PM To: [EMAIL PROTECTED] ups.com Subject: [flexcoders] ModuleLoader does not load module when instance is created as ModuleLoader( ) Hi I am trying to load module as show below. I am using panel.addChild( mod2.child) ; but i never see module loaded in the panel. It is very simple app.I do not know why the module is not being loaded . Any pointer is highly appreciated. I have been putting my head for last 4 hours. Thanks ilikeflex <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe. com/2006/ mxml" layout="absolute"> <mx:Script> <![CDATA[ import mx.events.ModuleEve nt; import mx.modules.ModuleLo ader; import mx.events.ItemClick Event; public var mod2:ModuleLoader = new ModuleLoader( ); public function onNavBarClicked( event:ItemClickE vent):void { trace("function executed"); var item:Object = event.item; mod2.url = String(item. module); mod2.loadModule( ); mod2.percentWidth = 100; mod2.percentHeight = 100; mod2.addEventListen er("ready", onReady); } public function onReady(event: ModuleEvent) :void { panel.addChild( mod2.child) ; } ]]> </mx:Script> <mx:Array id="arr"> <mx:Object label="Select Coverage"/> <mx:Object label="Life Insurance" module="insurancemodules/ LifeInsurance. swf" /> <mx:Object label="Auto Insurance" module="insurancemodules/ AutoInsurance. swf" /> <mx:Object label="Home Insurance" module="insurancemodules/ HomeInsurance. swf" /> </mx:Array> <mx:LinkBar itemClick="onNavBarClicked( event)" dataProvider="{arr}" /> <mx:Panel width="100%" height="100%" top="50" id="panel" title="MainPanel"/> </mx:Application>

