Hi,

You can only call the public function .

Use the outerDocument keyword.  So the item renderer script will be
something like this.

private function myItemFunction():void{
        //Call from here to myPrivateFunction or myPublicFunctio
        outerDocument. myPublicFunction(param);
}

Regards
Subeesh


-----Original Message-----
From: [email protected] [mailto:[email protected]] On
Behalf Of McRain
Sent: 11 September 2009 21:51
To: Flex India Community
Subject: [flex_india:25205] How to call a function from itemRenderer


Hi!
I have a code:

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
layout="absolute" >
<mx:Script>
        <![CDATA[
                private function myPrivateFunction(param:Object):void{
                }
                public function myPublicFunction(param:Object):void{
                }
        ]]>
</mx:Script>
                <mx:DataGrid id="dgGris" dataProvider="{mydp}" >
                        <mx:columns>
                                <mx:DataGridColumn headerText="HEAD"
dataField="item">
                                        <mx:itemRenderer>
                                                <mx:Component>
                                                      <mx:Label
text="{myItemFunction()}">
                                                          <mx:Script>
        
<![CDATA[
        
private function myItemFunction():void{
        
//Call from here to myPrivateFunction or myPublicFunction
        
}
                                                                        ]]>
                                                                </mx:Script>
                                                      </mx:Label>
                                                </mx:Component>
                                        </mx:itemRenderer>
                                </mx:DataGridColumn>
                        </mx:columns>
                </mx:DataGrid>
</mx:Application>

How do I call a function (myPrivateFunction or myPublicFunction) from
the myItemFunction? Application.application. myPrivateFunction - do
not want to use.
Thank you.



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Flex 
India Community" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/flex_india?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to