The problem is that anything inside your <mx:Component> tags are in a different scope to the rest of the items in the file. You have one component trying to talk to another component but it can't because the function is private to the first component.
One fix is to make the function public so that other components can invoke it. --- In [email protected], Adrian Williams <[EMAIL PROTECTED]> wrote: > > Tracy, > > Thanks for the help!! I have some additional questions on this. I > am very new to flex/as and am stuck on a couple items. > > I found some examples on how to setup the renderer and have > implemented this. I created a function to create the actual mailto > string and have hit these snags: > > Here is the code for the function: > > private function convertEmailToMailto(emailAddy:String):String > { > var mailtoEmailAddy:String ; > mailtoEmailAddy = '<a href="mailto:' + emailAddy + '">' > + emailAddy + '</a>'; > return mailtoEmailAddy; > } > > And here is the renderer code: > > <mx:itemRenderer> > <mx:Component> > <mx:Text > htmlText="{convertEmailToMailto(data.emailAddress)}"/> > </mx:Component> > </mx:itemRenderer> > > The first problem I have is that I am getting "call to possibly > undefined method convertEmailToMailto" error and am not sure what the > problem is. > > The next is that I am confused about the bubbling. I am assuming > I will need to add a 'click=""' in the <mx:Text> line and I see in the > properties for TextEvent to do a TextEvent:LINK but I am not having a > lot of luck seeing how to implement this. > > Help? > > Thanks, > Adrian > > Tracy Spratt wrote: > > > > There are several ways to do this. One way is to create an > > itemRenderer using htmlText. htmlText can include an <a href="" /> > > tag. You can have the click dispatch a bubbling TextEvent, and in the > > handler, access the dataProvider item via the event.currentTarget > > property, and use the url to build your mailto url, and navigateToURL > > to laouch the browser. > > > > > > > > There will be examples of all of this if you look a bit. > > > > > > > > Tracy > > > > > > > > ------------------------------------------------------------------------ > > > > *From:* [email protected] [mailto:[EMAIL PROTECTED] > > *On Behalf Of *Adrian Williams > > *Sent:* Monday, July 07, 2008 1:04 PM > > *To:* [email protected] > > *Subject:* [flexcoders] Creating a hyperlink mailto in advanced data grid > > > > > > > > Hi All, > > > > I am using an advanced data grid to display a variety of data, one > > of which is a users email address. I'd like to be able to set it up > > so that for any given row in the report, the email addresses are > > actually hyperlinks to open a mailto: that address. How do I do this? > > > > Thanks, > > Adrian > > > > >

