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>
> >
>