Unless you unloaded the module, or the module got garbage collected because 
there were no references to the module, the module should not load again, so 
there probably won't be another ready event.  Why not just addCHild the 
moduleLoader no matter what?

From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of 
ilikeflex
Sent: Wednesday, November 12, 2008 10:08 PM
To: [email protected]
Subject: [flexcoders] Show the module second time


Hi Team

How to show the module second time?

I have a button. On click event i load the module. Now if i again
click the same button again after say 2 min. I do not want to load
the module again but i want to use the loaded module.

I am storing the module into array with url as index(Associated
Array).

code:

var module:ModuleLoader = arr[moduleName];
if( module )
{
showContent.removeAllChildren();
showContent.addChild(module);
showContent.invalidateDisplayList();
}
else
{
moduleLoader.percentHeight = 100;
moduleLoader.percentWidth = 100;
moduleLoader.url = String(moduleName);
moduleLoader.loadModule();
}

//event listener function on module.Ready event
public function addModuleToView(event:ModuleEvent):void
{
showContent.removeAllChildren();
module[event.module.url] = moduleView);
showContent.addChild(moduleView);
}

i want to add the module to showContent container when button is
clicked second time.

But i do not see the module added to contianer second time?

Can anybody please give any pointers??????
I have spend lot of time but no clue.

Thanks
ilikeflex

Reply via email to