Repeater is much more flexible than many people think. It is often thought of as a way to make a list, but is really more a dataProvider driven wrapper for addChild and removeChild, with a few other cool things built in.
I can imagine several use cases for needing to reference a repeated item. I have done it myself, though if I were to reproduce today the particular functionality I am thinking of, I would use events instead. Tracy ________________________________ From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of valdhor Sent: Friday, June 27, 2008 11:51 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Setting unique ID with repeater and custom component I don't know about most people but I never need to know the id of a "repeated" item. All of the items I have in a repeater are instances of a specific object. This object has class members and functions and can do everything it needs to do on its own. If I need it to (Which is infrequent) each object can get to its parent or even the Application object itself. So, I ask, Why would you need to refer to a repeated component? --- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> , "Amy" <[EMAIL PROTECTED]> wrote: > > --- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> , "sdl1326" <azsl1326-email@> wrote: > > > > I am using the Tile Component along with a repeater and then a custom > > component (image control). Is it possible to give the custom component > > a unique id/name? I have tried to use a variable associated with the > > current repeater item ({repeater.currentItem.name}), however, it does > > not seem that this is possible as I am getting an error that the ID is > > not a valid identifier. > > > > Thanks for any and all replies. > > > > If you have something like this: > > <mx:Repeater id="theRepeater" dataProvider="{yourAC}"> > <yourNS:YourComponent id="foo"/> > </mx:Repeater> > > then you can refer to any repeated component by its index within foo. > i.e. foo[0] is the first component. This is pretty thoroughly > documented in the help for Repeater. > > HTH; > > Amy >