flex - How can I user getRepeaterItem to set the progress of a progress bar? -
i have progress bar inside repeater , therefore need use getrepeateritem set it's progress suggested in this question.
how can such value of progress may taken repmonitor.currentitem.threatlevel?
<mx:accordion id="monaccordian" includein="monitoring" x="10" y="10" width="554" height="242" change="monaccordianchange()" > <mx:repeater id="repmonitor" dataprovider="{monitoringarray}"> <mx:canvas width="100%" height="100%" label="{repmonitor.currentitem.firstname+' '+ repmonitor.currentitem.lastname}" > <mx:image x="10" y="10" source="{repmonitor.currentitem.imagename}" width="175" height="118"/> <s:label x="200" y="14" text="threat level:"/> <mx:progressbar x="200" y="30" mode="manual" label="" id="bar" width="200" /> </mx:canvas> </mx:repeater> </mx:accordion>
this function needs called every time threatlevel changes in order update repeater items:
private function updateprogresses() : void { if (!bar) return; (var : int = 0; < bar.length; i++) { var p : progressbar = bar[i] progressbar; if (p) { p.setprogress(monitoringarray[i].threatlevel, 100); } } }
Comments
Post a Comment