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

Show Posts

| * |

  Show Posts
Pages: [1]
1  Announcements and General Discussion / Architecture / Mediator and view component on: June 29, 2009, 02:55:26
I have some clarifications on Mediator and view component coupling. Lets say i want to display some text on certain events. The text is basically a clip which is available in the library but not added on stage. In mediator constructor i am getting the stage reference as a view component and i am instantiating the clip in a particular notification say CONSTRUCT_LAYOUT. i am adding that particular clip at on the corresponding event to the stage using getter of that viewcomponent and by passing the clip reference as an argument to addchild. The issue is the clip component needs to be imported in mediator class. It works fine. But the problem is ,if i needed to have a different clip that needs to  use the same functionality of the mediator, but having different characteristics in their visual of the component?

Is that i need to pass the clip reference as an argument to view component instead of the stage reference.?

I am confused!! Any help will be much appreciated on the problem

Thanks

2  Announcements and General Discussion / Architecture / Clarification in View on: May 16, 2009, 04:10:13
Hi Cliff,

I was digging through in the framework classes and i found something which is not needed or may be i didnt get it correctly? Could you please explain the same

In view class ,

public function registerObserver ( notificationName:String, observer:IObserver ) : void
      {
         var observers:Array = observerMap[ notificationName ];
         
         if( observers ) {
            observers.push( observer );
         } else {
            observerMap[ notificationName ] = [ observer ];   
         }
      }


There is no necessity for pushing the observer into observers local scope array. Since it doesnt do any other function. Is this done for code clarity or i got it wrong?

Durai
Pages: [1]