Hey,

That's one way.  But, since the ModelLocator is already Bindable, you
don't need to add event listeners for data changes.  As an alternative
you can bind {} ModelLocator variables to the dataProviders in your
components.  When the data in the model variables is changed, the
binding mechanism automatically updates the view.  If you need to do
something in the view, when the data is updated, you can always use the
valueCommit event on the bound control.

Next stop; ApplicationController and Commands.

-TH

--- In [email protected], "fb6668" <[EMAIL PROTECTED]> wrote:
>
> Never mind, I worked it out. I used my model locator:
>
> in SmallGraph:
> model.assets.addEventListener("ASSET_DATA_CHANGE_VIEW",listen);
> public function listen(e:Event):void
> {
> Alert.show("asset event");
> }
>
> then in the model:
> public function changeAssetView()
> {
> dispatchEvent(new Event('ASSET_DATA_CHANGE_VIEW'));
> }
>
> This seems to work!
>
> --- In [email protected], "fb6668" fiona@ wrote:
> >
> > I have a question about how events are used.
> >
> > I have a component which has the following sub-components:
> >
> > <mx:HBox width="100%" id="assetBox">
> > <view:AssetGraphPanel height="100%"/>
> > <view:AssetAccordion id="accordion" />
> > </mx:HBox>
> >
> > The AssetGraphPanel itself contains components:
> >
> > <mx:PieChart id="topPie" ...
> > </mx:PieChart>
> >
> > <assets:SmallGraph person="Joint"/>
> > <assets:SmallGraph person="Client"/>
> > <assets:SmallGraph person="Partner"/>
> >
> > These graphs need to change when a button inside the AssetAccordion
is
> > clicked, by calling a function in SmallGraph called 'updateChart()'.
> > There will be other things that should also trigger this function to
> > be called, from other components.
> > So, how do I add an event listener/dispatcher so that the SmallGraph
> > can hear it whereever in the application it was fired from?
> > Seems to me I want the opposite of bubbling?
> >
> > Thanks for your patience.
> >
>



Reply via email to