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" <[EMAIL PROTECTED]> 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.
>