private var seriesArray:Array = [series1, series2, series3, series4, series5 ]; // etc.
private function changeSeries():void { for each (var series:Object in seriesArray) { series.yField = 'male'; } } I haven't tried to compile it and run but it should work. --- In flexcoders@yahoogroups.com, "AJC2357" <ajc2...@...> wrote: > > Hi all, > > If I have a function like this..... > > private function changeSeries(): void { > series1.yField = 'male'; > series2.yField = 'male'; > series3.yField = 'male'; > series4.yField = 'male'; > series5.yField = 'male'; > series6.yField = 'male'; > series7.yField = 'male'; > series8.yField = 'male'; > series9.yField = 'male'; > series10.yField = 'male'; > } > > Is there an easy way to simplify it? Something like.... > > private function changeSeries(): void { > "something to indicate i equaling zero through ten" > series[i] = 'male'; > } > > Any code help would be much appreciated! > > Alex >