Finally after a lot of trials I found the solution. In my MainApp project config file the following setting was required <keep-all-type-selectors>true</keep-all-type-selectors>
--- In [email protected], Alex Harui <aha...@...> wrote: > > I would use the -keep-generated-actionscript option and -link-report option > to see why MenuBar's default styles are not being added to the StyleManager. > > Alex Harui > Flex SDK Developer > Adobe Systems Inc.<http://www.adobe.com/> > Blog: http://blogs.adobe.com/aharui > > From: [email protected] [mailto:[email protected]] On > Behalf Of Rajkumar > Sent: Sunday, August 16, 2009 10:47 PM > To: [email protected] > Subject: [flexcoders] Re: Crash while using MenuBar from a module. > > > > Hello Alex, I had mentioned the top of stack trace in the first post , here > is the complete stack trace. > > TypeError: Error #1007: Instantiation attempted on a non-constructor. > at > mx.controls::MenuBar/updateBackground()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\controls\MenuBar.as:1029] > at > mx.controls::MenuBar/styleChanged()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\controls\MenuBar.as:1263] > at > mx.core::UIComponent/http://www.adobe.com/2006/flex/mx/internal::addingChild()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:5244] > at > mx.core::Container/http://www.adobe.com/2006/flex/mx/internal::addingChild()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\Container.as:3262] > at > mx.core::Container/addChildAt()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\Container.as:2207] > at > mx.core::Container/addChild()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\Container.as:2140] > at > com.atex.OV.Core.UI::OVUIMgr/addUIToApp()[G:\Projects_RJK\AtexUIF\Codebase\App\src\com\atex\OV\Core\UI\OVUIMgr.as:111] > at > com.atex.OV.Core.Application::OVAppBase/listenPlnLoadNotification()[G:\Projects_RJK\AtexUIF\Codebase\App\src\com\atex\OV\Core\Application\OVAppBase.as:251] > at > com.atex.OVF.Core.Notification::OVNotificationCenter/postNotification()[G:\Projects_RJK\AtexUIF\Codebase\Framework\com\atex\OVF\Core\Notification\OVNotificationCenter.as:179] > at > com.atex.OVF.Core.Notification::OVNotificationCenter/postNotificationName()[G:\Projects_RJK\AtexUIF\Codebase\Framework\com\atex\OVF\Core\Notification\OVNotificationCenter.as:197] > at > com.atex.OV.Core.Module::OVModuleMgr/sendPlnsLoadNotification()[G:\Projects_RJK\AtexUIF\Codebase\App\src\com\atex\OV\Core\Module\OVModuleMgr.as:349] > at > com.atex.OV.Core.Module::OVModuleMgr/modulesLoadHandler()[G:\Projects_RJK\AtexUIF\Codebase\App\src\com\atex\OV\Core\Module\OVModuleMgr.as:255] > at > com.atex.OV.Core.Module::OVModuleMgr/onModuleLoad()[G:\Projects_RJK\AtexUIF\Codebase\App\src\com\atex\OV\Core\Module\OVModuleMgr.as:182] > at flash.events::EventDispatcher/dispatchEventFunction() > at flash.events::EventDispatcher/dispatchEvent() > at > ModuleInfoProxy/moduleEventHandler()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\modules\ModuleManager.as:1097] > at flash.events::EventDispatcher/dispatchEventFunction() > at flash.events::EventDispatcher/dispatchEvent() > at > ModuleInfo/readyHandler()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\modules\ModuleManager.as:752] > at flash.events::EventDispatcher/dispatchEventFunction() > at flash.events::EventDispatcher/dispatchEvent() > at > mx.core::FlexModuleFactory/update()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\FlexModuleFactory.as:327] > at > mx.core::FlexModuleFactory/timerHandler()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\FlexModuleFactory.as:556] > at flash.utils::Timer/_timerDispatch() > at flash.utils::Timer/tick() > > Thanks, > Rajkumar > > --- In [email protected]<mailto:flexcoders%40yahoogroups.com>, Alex > Harui <aharui@> wrote: > > > > Post the stack trace. > > > > Alex Harui > > Flex SDK Developer > > Adobe Systems Inc.<http://www.adobe.com/> > > Blog: http://blogs.adobe.com/aharui > > > > From: [email protected]<mailto:flexcoders%40yahoogroups.com> > > [mailto:[email protected]<mailto:flexcoders%40yahoogroups.com>] On > > Behalf Of Rajkumar > > Sent: Thursday, August 13, 2009 11:13 PM > > To: [email protected]<mailto:flexcoders%40yahoogroups.com> > > Subject: [flexcoders] Crash while using MenuBar from a module. > > > > > > > > I am creating three projects as following:- > > 1. MainApp: Main project that give output executable swf, i.e main > > application. > > 2. MyFramework: A flex library project, which will contain all the > > interface declarations. > > 3. CustomModule: A flex project, which will generate one/more module/s, > > which will be loaded in the mainApp. > > > > The Settings for the projects is as following:- > > MainApp: > > Flex Build Path: Library Path: Framework linkage is RSL, > > Flex SDK is added with following settings:- > > Playerglobal: LinkType=external > > flex: LinkType=rsl, Verification = None, DeploymentPath=flex/flex.swf, > > Automatically extract swf is enabled. > > framework: LinkType=rsl, Verification = None, > > DeploymentPath=flex/framework.swf, Automatically extract swf is enabled. > > rpc: LinkType=rsl, Verification = None, DeploymentPath=flex/rpc.swf, > > Automatically extract swf is enabled. > > utilities: LinkType=rsl, Verification = None, > > DeploymentPath=flex/utilities.swf, Automatically extract swf is enabled. > > MyFramework: LinkType=rsl, Verification = none, > > DeploymentPath=rsls/MyFramework.swf, Automatically extract swf is enabled. > > Compiler arguments: > > -load-config+=Appconfig.xml > > -link-report=MainAppLnkReport.xml > > MyFramework: > > Flex Build path settings are similar to MainApp. > > Compiler arguments: > > -load-config+=MyFrameworkconfig.xml > > CustomModule: > > Flex Build path settings are similar to MainApp. > > Compiler arguments: > > -load-config+=MyFrameworkconfig.xml > > -load-externs=path to MainAppLnkReport.xml generated above. > > > > Code: > > From MainApp, > > CustomModule is load code is as following:- > > moduleInfo = ModuleManager.getModule("path to CustomModule.swf"); > > moduleInfo.addEventListener(ModuleEvent.READY,onModuleLoad,false,0,true); > > moduleInfo.addEventListener(ModuleEvent.ERROR,onModuleError,false,0,true); > > moduleInfo.load(ApplicationDomain.currentDomain); > > > > onModuleLoad(event :ModuleEvent) :void > > var moduleInfo :IModuleInfo = event.module; > > var module:* = moduleInfo.factory.create(); > > > > > > Using an interface defined in MyFramewok, and implemented by CustomModule, > > I call a function that create an instance of MenuBar. > > The instance is created, but on calling > > addChild( menuBarObj as DisplayObject); > > > > I get crash at mx.controls::MenuBar/updateBackground at > > var backgroundSkinClass:Class = getStyle("backgroundSkin"); > > background = new backgroundSkinClass(); > > backgroundSkinClass is null. > > > > Callstack after my addChild statement is > > mx.controls::MenuBar/updateBackground > > mx.controls::MenuBar/styleChanged > > mx.core::UIComponent/http://www.adobe.com/2006/flex/mx/internal::addingChild > > mx.core::Container/http://www.adobe.com/2006/flex/mx/internal::addingChild > > mx.core::Container/addChildAt > > mx.core::Container/addChild > > > > I have already tried: > > 1. Creating a variable of MenuBar in MainApp, this resolves the crash, but > > not an accepted solutions, as MainApp cannot be complied again on creating > > another module. > > 2. Extend CustomModule from Module class. > > 3. Similar issue is with checkbox, where application does not crash, but > > draws like a button. > > Checkbox issue gets resolved if CustomModule extends Module. > > or theme is added to Appconfig.xml > > <theme append="true"> > > <filename>${flexlib}/libs/framework.swc</filename> > > </theme> > > 4. Different settings for Flex sdk in Library Path. i.e MergeIntoCode, > > External. > > Already tried > > http://www.mail-archive.com/[email protected]/msg84466.html > > > > Thanks in advance, > > Rajkumar Sehrawat > > >

