One of my favorite techniques is to have a button on screen that when clicked, 
does some introspection, like checking numChildren to make sure the module is 
still there, and testing its size, visibility, position, etc.

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of 
ilikeflex
Sent: Friday, November 14, 2008 6:53 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Show the module second time


Hi

I am doing the addChild(module) second time but it does not load into
screen. I am storing the reference to modules loaded in associate
array.

In my code "showContent" is canvas.I have put the "unload" listener
to see if the module is unloaded. But this is never invoked. So i am
clear that module is not garbage collected. So i think issue may be
adding to the canvas.

Is there any way i can debug this. Do i need to call any invalidate
function to reflect the changes after module is added to canvas.

Any pointer is appreciated.

Thanks
ilikeflex

--- In flexcoders@yahoogroups.com<mailto:flexcoders%40yahoogroups.com>, Alex 
Harui <[EMAIL PROTECTED]> wrote:
>
> 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: flexcoders@yahoogroups.com<mailto:flexcoders%40yahoogroups.com>
[mailto:flexcoders@yahoogroups.com<mailto:flexcoders%40yahoogroups.com>] On 
Behalf Of ilikeflex
> Sent: Wednesday, November 12, 2008 10:08 PM
> To: flexcoders@yahoogroups.com<mailto:flexcoders%40yahoogroups.com>
> 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();
> var moduleView:ModuleLoader = event.target;
> 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