I did an application to show a datagrid with a custom column in Flex 3 how can I access to the method loadDetails in this code?:
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script>
<![CDATA[
public function loadDetails(id:String) : void { // Some code here
}
]]>
</mx:Script>
<mx:DataGrid dataProvider="{[{id:'123456',name:'',address:''}]}">
<mx:columns>
<mx:DataGridColumn headerText="Serial" dataField="id"/>
<mx:DataGridColumn headerText="Cliente" dataField="name"/>
<mx:DataGridColumn headerText="Dirección" dataField="address"/>
<mx:DataGridColumn width="50" dataField="id" headerText="">
<mx:itemRenderer>
<mx:Component>
<mx:LinkButton label="" toolTip="Details" icon="@Embed('../resources/icons/details.png')" click="loadDetails(data.id);">
</mx:LinkButton>
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
</mx:columns>
</mx:DataGrid>
</mx:Application>
When I tried to run this code Flex throws an error. It says that loadDetails it's not defined. I supposed that error is because of scope. But I don't have any idea about how to solve it.