--- In flexcoders@yahoogroups.com, "Derek Vadneau" <[EMAIL PROTECTED]> wrote: > > Sorry, I responded before trying, duh. > > Here's some working code (modified from the docs "Referencing repeated > components"): > > <?xml version="1.0" encoding="utf-8"?> > <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" > layout="absolute"> > <mx:Script> > <![CDATA[ > [Bindable] > private var dp:Array = [1, 2, 3, 4, 5, 6, 7, 8, 9]; > > private function onClick(b:*):void > { > trace(b); > } > ]]> > </mx:Script> > > <mx:Panel title="Repeater Example" width="75%" height="75%" > paddingTop="10" paddingLeft="10" paddingRight="10" > paddingBottom="10"> > <mx:Text width="100%" color="blue" > text="Use the Repeater class to create 9 Button controls in a 3 > by 3 Tile container."/> > > <mx:Tile direction="horizontal" borderStyle="inset" > horizontalGap="10" verticalGap="15" > paddingLeft="10" paddingTop="10" paddingBottom="10" > paddingRight="10"> > <mx:Repeater id="rp" dataProvider="{dp}"> > <mx:LinkButton id="myLB" height="50" width="50" > label="{String(rp.currentItem)}" > click="onClick(event.target);"/> > </mx:Repeater> > </mx:Tile> > > <mx:Button label="onClick" click="onClick(myLB[0]);"/> > > </mx:Panel> > </mx:Application> > > On 6/6/07, nhp_ny <[EMAIL PROTECTED]> wrote: > > > > --- In flexcoders@yahoogroups.com <flexcoders% 40yahoogroups.com>, > > "nhp_ny" <nhp_ny@> wrote: > > > > > > <mx:Repeater ... > > > > <mx:LinkButton id="myLB" click="onClick(Event.currentTarget)"/> > > > </mx:Repeater> > > > > > > > > > how can i fire the click event of repeater child component myLB [0]? > > > just to simulate a mouse click on that component. > > > > > > > is it possibile that nobody here knows how to do this? i just need to > > call the onClick function passing it the first child component of the > > repeater that should be myLB[0]. > > > > > > > > > > -- > > Derek Vadneau >
yes ok,... thats what i'm working on too... but when i put the : <mx:Button label="onClick" click="onClick(myLB[0]);"/> line inside a function, i doesn't work.. because i need to call the function from AS. Like: proivate function onInitApp():void { onClick(myLB[0]); } thanks