I have the following problem:
Description:
I have a page with a button and a spark list (spark.components.List), when the button is clicked, all the elements in the list should change their label.
The list uses a custom item renderer to display the data (The renderer is a spark item renderer: s:ItemRenderer and the data that will be displayed comes from database).
When I click the button, I dispatch an event "button_clicked", that event should be listened by all the elements in the custom item renderer.
In the renderer, I have this function that should listen to the "button_clicked" event:
public function init():void
{
this.addEventListener("button_clicked", button_clicked);
}
public function button_clicked(event:Event):void
{
mdm.Dialogs.prompt("Button clicked event dispatched");
}
Problem: The method "button_clicked" is never executed, which means that the event is not listened in the item renderer.
Anyone that can help me to understand how to dispatch an event in a parent and listen to it in the ItemRenderer object.
Thanks