Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought


Over 10 years of community discussion and knowledge are maintained here as a read-only archive.

New discussions should be taken up in issues on the appropriate projects at https://github.com/PureMVC

Pages: [1]
Print
Author Topic: Problem registering multiple mediators to AIR app  (Read 8043 times)
krille
Newbie
*
Posts: 4


View Profile Email
« on: September 29, 2008, 12:10:31 »

Hello Everybody,

I have a problem that I don't really understand and would be glad to receive some help  ::)
I'd like to register 2 mediators to my app, both beeing responsible for different views (MXML components)
within the AIR app.

In the StartupCommand's execute method I do the following

:
var app:MemorizeAir = note.getBody() as MemorizeAir;

// register proxies
facade.registerProxy( new DatabaseProxy() );
facade.registerProxy( new PreferenceProxy() );
facade.registerProxy( new PracticeProxy() );

// register mediators
facade.registerMediator( new PracticeMediator( app.practiceScreen ) );
facade.registerMediator( new VocabularyMediator( app.vocabularyScreen ) );

So "app.practiceScreen" is a different component than "app.vocabularyScreen", and now after
digging around I found out that only the first of these mediators will listen for notifications,
in the case above its the PracticeMediator.

Why is that please and what would be the solution to my problem?

Thanks in advance and keep up the great work!

« Last Edit: September 29, 2008, 12:31:24 by krille » Logged
duncanhall
Newbie
*
Posts: 2


View Profile Email
« Reply #1 on: September 29, 2008, 12:42:31 »

That shouldn't be the case. Are you giving each of your mediators a unique String as a name and passing this to the super constructor?
Logged
krille
Newbie
*
Posts: 4


View Profile Email
« Reply #2 on: September 29, 2008, 12:48:47 »

 :D OMG!!
Can't believe I didn't check that...
I copied an existing mediator and forgot to change it's name - ouch!

Thanks a lot!
Logged
Pages: [1]
Print