Really need some help here...
Thanks in advance
gurpreet
--
You received this message because you are subscribed to the Google Groups "Flex India Community" group.
To post to this group, send email to flex_...@googlegroups.com.
To unsubscribe from this group, send email to flex_india+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/flex_india?hl=en.
On Feb 26, 9:53 pm, Vaibhav Seth <seth.vaibhav...@gmail.com> wrote:
> Mapping the events to command is a kind of event listener only.
> So, if even if the view goes out of the application, it doesn't mean the
> handlers attached will also go away. There are possibilities that they will
> respond even if the view have been removed from the list.
> Use the weak-reference true, while adding the command in the controller and
> use removeCommand() while you unload the module. Also, keep the event names
> unique across all modules.
>
>
>
> On Fri, Feb 26, 2010 at 11:37 AM, Ajay Chhaya <ajay.fl...@gmail.com> wrote:
> > please check the frontcontroller, if it's instance are being created twice.
> > ---------------------
> > Ajay Chhaya
>
> >www.ajaychhaya.com
> > --------------------------------
>
> > On Fri, Feb 26, 2010 at 5:07 PM, gurpreet <gsmai...@gmail.com> wrote:
>
> >> I am loading modules in my application which is based on Cairngorm.
> >> Each of the module has its own frontcontroller. I'm facing an issue
> >> that when a cairngorm event is dispatched within the module, the
> >> command execute() method gets called twice. Has anyone faced this
> >> before?
>
> >> Really need some help here...
>
> >> Thanks in advance
> >> gurpreet
>
> >> --
> >> You received this message because you are subscribed to the Google Groups
> >> "Flex India Community" group.
> >> To post to this group, send email to flex_...@googlegroups.com.
> >> To unsubscribe from this group, send email to
> >> flex_india+...@googlegroups.com<flex_india%2Bunsu...@googlegroups.com>
> >> .
> >> For more options, visit this group at
> >>http://groups.google.com/group/flex_india?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Flex India Community" group.
> > To post to this group, send email to flex_...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > flex_india+...@googlegroups.com<flex_india%2Bunsu...@googlegroups.com>
I was able to fix the issue. What was happening is that on unloading
the module, I was not removing the listed commands for that
controller. On loading the module again, each command would get added
again. So if I unload and load the module 5 times, the command would
get added 5 times.
Now I've added the following function to the module controller and
call it every time the module unloads. This cleans up the commands
list from the controller.
public function removeAllCommands():void
{
for (var key:String in commands)
{
removeCommand(key);