I wrote the following code to create a Module Manager, but it throws
the error which is shown below the code snippet. Please help me to
solve this issue.
------------------------------------------------------------------------------------------------------------------------------------------------------------
Code
<mx:Script>
<![CDATA[
import mx.modules.ModuleLoader;
import mx.events.ModuleEvent;
import mx.modules.ModuleManager;
import mx.modules.IModuleInfo;
public var info:IModuleInfo;
public function initApp():void {
info = ModuleManager.getModule("modules/Module1.swf");
info.addEventListener(ModuleEvent.READY,
modEventHandler);
info.load();
}
private function modEventHandler(e:ModuleEvent):void
{
vb1.addChild(info.factory.create() as Module1);
}
]]>
</mx:Script>
<mx:VBox id="vb1" width="100%" height="100%">
</mx:VBox>
------------------------------------------------------------------------------------------------------------------------------------------------------------
Error
TypeError: Error #1009: Cannot access a property or method of a null
object reference.
at components::WorkSpace/modEventHandler()[C:\Users\AMD\Documents
\Flex Builder 3\showcase\src\components\WorkSpace.mxml:31]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at ModuleInfoProxy/moduleEventHandler()[E:\dev\3.1.0\frameworks
\projects\framework\src\mx\modules\ModuleManager.as:1027]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at ModuleInfo/readyHandler()[E:\dev\3.1.0\frameworks\projects
\framework\src\mx\modules\ModuleManager.as:706]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.core::FlexModuleFactory/update()[E:\dev\3.1.0\frameworks
\projects\framework\src\mx\core\FlexModuleFactory.as:325]
at mx.core::FlexModuleFactory/docFrameHandler()[E:\dev
\3.1.0\frameworks\projects\framework\src\mx\core\FlexModuleFactory.as:
413]
--
You received this message because you are subscribed to the Google Groups "Flex
India Community" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/flex_india?hl=en.