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]
Author Topic: Mediator and view component  (Read 2307 times)
Posts: 2

View Profile Email
« 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


Global Moderator
Hero Member
Posts: 2871

View Profile WWW Email
« Reply #1 on: June 30, 2009, 12:59:52 »

Create a StageMediator and send it notifications containing the child to be added. Have it cast the body to Sprite or MovieClip, whichever. Then send the children to be added from their Mediators, and have the StageMediator add them to the stage.

Pages: [1]