try putting your Button inside your custom component and creating a instance var inside your custom component that you can pass in the Repeater call. Me thinks what you are trying is telling Flex to pass an array of Button to your custom component.
so have VB.mxml look like this <?xml version="1.0" encoding="utf-8"?> <VBox xmlns:mx="http://www.adobe.com/2006/mxml" width="100" height="100"> <mx:Script> <![CDATA[ [Bindable] private var inNum:Number; ]]> </mx:Script> <mx:Button height="49" width="50" label="{inNum.toString()}" /> </VBox> and the main.mxml look like <?xml version="1.0"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:local="*"> <mx:Script> <![CDATA[ [Bindable] private var dp:Array = [1, 2, 3, 4, 5, 6, 7, 8, 9]; ]]> </mx:Script> <mx:Repeater id="rp" dataProvider="{dp}"> <local:VB inNum="{rp.currentItem}"> </mx:Repeater> </mx:Application> might have some syntax issue, I didn't get a chance to test this. Note, if dp is modified in anyway at runtime, this approach would probably require you to override the getter/setter on inNum. HTH DK On 7/12/06, Norbert Csík <[EMAIL PROTECTED]> wrote: > I think there is a problem with repeaters and custom components. > Please consider the following code: > > <?xml version="1.0"?> > <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:local="*"> > <mx:Script> > <![CDATA[ > [Bindable] > private var dp:Array = [1, 2, 3, 4, 5, 6, 7, 8, 9]; > ]]> > </mx:Script> > > <mx:Repeater id="rp" dataProvider="{dp}"> > <local:VB> > <mx:Button height="49" width="50" > label="{String(rp.currentItem)}" /> > </local:VB> > </mx:Repeater> > > </mx:Application> > > > Where The VB is a custom component extending a VBox: > > <?xml version="1.0" encoding="utf-8"?> > <VBox xmlns="lib.tx.*" xmlns:mx="http://www.adobe.com/2006/mxml" > width="100" height="100"> > > </VBox> > > But if you compile and run this code it fails with the error > "TypeError: Error #1034: Type Coercion failed: cannot convert > mx.controls::[EMAIL PROTECTED] to Array." > > One interesting point is if you replace the {String(rp.currentItem)} > binding in the button with some static string it works: > > <mx:Button height="49" width="50" label="tryit" /> > > So there's a problem with the repater. What do you think? > > nOR > > --- In [email protected], "Ian Skinner" <[EMAIL PROTECTED]> wrote: > > > > it is not a problem to use repeaters and custom components AFAIK. I > > will note that sometimes you need to create your own getter/setter > > methods for use. I don't thinks that's the issue with Ian though, but > > could be. > > > > DK > > > > > > > > > -- > Flexcoders Mailing List > FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt > Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com > Yahoo! Groups Links > > > > > > > > -- Douglas Knudsen http://www.cubicleman.com this is my signature, like it? -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/

