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: Multiple UI's per mediator - no specific viewCompoment  (Read 6728 times)
Spengler
Newbie
*
Posts: 2


View Profile Email
« on: March 09, 2010, 04:43:18 »

Hi,

I'm trying to build a little Guitar Hero-esque game to try to get my head around PureMVC. I've got three targets on my screen corresponding to three buttons, when  a button is pressed the visual state of the target changes and returns to normal when the key is lifted.

The various state information for the target is held within the target class and I have a TargetMediator class switching the sate of the relevant target when necessary. The TargetMediator class is created and the three targets are created within the TargetMediators onRegister function.

It seems to be working ok, but I'm not registering a view component for the TargetMediator and am wondering if all mediators need to have a registered viewComponent or if they're ok to function like this, handling a few diffeent objects without being bound to one specifically. It seems bad practice to be not to have a registered view component, but it would seem superfluous to have three TargetMediators, one for each target, when they're all doing the same thing anyway.

Any advice/sugestions? Is what I'm doing ok or have I missed the mark?

Cheers,
Ed
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #1 on: March 10, 2010, 11:16:41 »

It's fine. What the Mediator mediates and how it goes about doing it is pliable. It's having a viewComponent property is really just a convenience, and it shouldn't ever be accessed by another actor anyway.

-=Cliff>
Logged
Spengler
Newbie
*
Posts: 2


View Profile Email
« Reply #2 on: March 11, 2010, 04:03:43 »

Cool, cheers.
Logged
Pages: [1]
Print