Yes, you simply loop over them. There is no easier way.

 

- Gordon

 


From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of shemeshkale
Sent: Sunday, October 29, 2006 1:06 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: how do i access properties of a component inside a repeater?

 

so,
if i want to change all items size inside a repeater i would go:

private function changeSize():void{
for(var i:Number = 0;i<btn1.length;i++){
btn1[i].height = slider1.value;
btn1[i].width = slider1.value;
}
}

???
i thought there is an easier way.
something like : repeater.allChildren().width
--- In [EMAIL PROTECTED]ups.com, "jamesdustinmercer"
<dustin.mercer@...> wrote:
>
> Give the button inside the repeater an id. Then the button will be
> accessible through an array syntax, off the button id.
>
> I.E.
>
> private function changeSize():void{
> btnWhatever[0].width = 100;
> btnWhatever[0].height = 100;
> }
>
> <mx:Button id="btnWhatever" height="50" width="50"
> label="{String(rp.currentItem)}"/>
>
> --- In [EMAIL PROTECTED]ups.com, "shemeshkale" <baldhead72@>
> wrote:
> >
> > i have a Tile with repeater inside.
> > inside the repeater - a button.
> > pretty simple.
> >
> > with a slider i want to change the size (width/height) of the
> button.
> > i works great if i bind width/height to slider value.
> > but how i do it the other way? from the slider to the button?
> > what should come inside the changeSize function?
> >
> > here is a basic code:
> >
> > <?xml version="1.0"?>
> > <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
> >
> > <mx:Script>
> > <![CDATA[
> > [Bindable]
> > private var dp:Array = [132456789, 2, 3, 4, 5, 6, 7,
> 8, 9];
> >
> > private function changeSize():void{
> > //what should be here?
> > }
> >
> > ]]>
> > </mx:Script>
> >
> > <mx:Panel title="Repeater Resize" width="75%" height="75%"
> > paddingTop="10" paddingLeft="10" paddingRight="10"
> > paddingBottom="10">
> >
> > <mx:HSlider maximum="200" minimum="100" value="120"
> id="slider1"
> > change="changeSize()" liveDragging="true"/>
> >
> > <mx:Tile direction="horizontal" borderStyle="inset"
> > horizontalGap="10" verticalGap="15" width="100%"
> > paddingLeft="10" paddingTop="10" paddingBottom="10"
> > paddingRight="10">
> > <mx:Repeater id="rp" dataProvider="{dp}">
> > <mx:Button height="50" width="50"
> > label="{String(rp.currentItem)}"/>
> > </mx:Repeater>
> > </mx:Tile>
> > </mx:Panel>
> > </mx:Application>
> >
>

__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Software development tool Software development Software development services
Home design software Software development company

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___

Reply via email to