i'm trying to make 2 pages communicate each other similar to XSL's "parameter" property. I want to make it so that when i click something, the action will apply to not just the mxml that the "something" was click, but also apply to other mxml pages/components?
private function itemClickHandler(event:ItemClickEvent):void
{
Alert.show("Getting click event");
}
its complaining because it cannot find the function itemClickHandler in mxml file A, how can i solve this? should i have the handler method in an as file instead and just have to refer to the script in mxml?
itemClickHandler is in the scope of B, so that certainly shouldn't be accessible in A.
Generally, its good to use a common parent container C as a mediator between A and B. Something happens in A, so A dispatches an event "somethingHappened". C is listening for A's event. When C receives that event, calls a function on B so that B can respond to whatever happened in B.