Have the function placed in the script section of parentDocument a.l.a
the document which contains this mxml file or the parentApplication
a.l.a the Application tag which contains the whole app.
<mx:Button label="" icon="@Embed('../images/delete.png')"
click="parentDocument.deleteRow( data.tld );" />
<mx:Button label="" icon="@Embed('../images/delete.png')"
click="parentApplication.deleteRow( data.tld );" />
Even I faced the same problem, If anyone can suggest a way to access
the code placed in the same mxml file, it would be really helpful
Hope this helps,
Cheers,
Ravi Gummadi
PartyGaming Plc
________________________________
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Alexandre Lemaire
Sent: Tuesday, March 13, 2007 10:44 AM
To: [email protected]
Subject: [flexcoders] Need a hand with a scope problem
Inside of an mxml file, I have a datagrid, with a Button item renderer
as such:
<mx:DataGridColumn
headerText="delete" textAlign="center" editable="false">
<mx:itemRenderer>
<mx:Component>
<mx:VBox horizontalAlign="center">
<mx:Button label="" icon="@Embed('../images/delete.png')" />
</mx:VBox>
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
In that Button, I would like to call a function that exists in the same
.mxml file
public function deleteRow( id:String ):void{
}
Unfortunately, if I edit the button to read like:
<mx:Button label="" icon="@Embed('../images/delete.png')"
click="deleteRow( data.tld );" />
It writes that the function deleteRow doesn't exist, which I imagine is
a scope problem. How do I get around this?
Thanks in advance,
Alex