In the help docs, lots of articles on dispatching events. But in brief,
in the component, dispatchEvent(new Event("somethingHappened"));
But you referenced an Adobe component List (I thought you said this was
a custom component), read up on the List class in the help docs, it
dispatches its own events so you'll need to find out what event you want
to listen for.
Jason Merrill
Bank of America
GT&O L&LD Solutions Design & Development
eTools & Multimedia
Bank of America Flash Platform Developer Community
________________________________
From: [email protected]
[mailto:[EMAIL PROTECTED] On Behalf Of so_osverg
Sent: Monday, February 04, 2008 7:18 PM
To: [email protected]
Subject: [flexcoders] Re: Targeting from components
I'm not sure if I'm setting this up correctly:
//event handler to initialize data and fire services
private function initializeApp():void
{
menuView.detailsWin.storyList.addEventListener(MouseEvent.CLICK,
storyClickHandler);
}
private function storyClickHandler(events:MouseEvent):void{
storyView.story.url =
menuView.detailsWin.storyList.selectedItem.url;
storyView.story.send();
currentState = "storyState";
}
//end AS3 code in the main application
what I can't figure out is how to correctly broadcast the event
from the component...
<mx:List width="100%" height="100%" id="storyList"
enabled="true"
backgroundAlpha="1.0"
dataProvider="{informant.lastResult.stories.story}"
labelField="name" color="#000000" />
--- In [email protected]
<mailto:flexcoders%40yahoogroups.com> , "Merrill, Jason"
<[EMAIL PROTECTED]> wrote:
>
> I think you should instead have your custom component
broadcast an
> event, and have a listener in your main application listen for
it and
> respond, making the change to your app.
>
>
> Jason Merrill
> Bank of America
> GT&O L&LD Solutions Design & Development
> eTools & Multimedia
>
> Bank of America Flash Platform Developer Community
>