Using ActionScript to modify label on a flex hslider -
i have hslider has 2 labels, starting year, , ending year. ending year increments everytime year closed , the label on slider show latest closed year.
i have tried changing slider.labels[1] & changes value when @ in debug, not on screen. tried bindable variable, 1 time again can see labels[1] alter in debug value isn't displayed on screen.
hsstart.labels[0] = acresult[0].rate_min; hsstart.labels[1] = acresult[0].up_range;
or
_arylabels[0] = acresult[0].rate_min; _arylabels[1] = acresult[0].up_range; hsstart.invalidatedisplaylist(); <mx:hslider minimum="1981" maximum="2000" snapinterval="1" id="hsstart" tickinterval="4" livedragging="true" labels="{_arylabels}" width="527" thumbcount="2" change="updateyear(event);" datatipformatfunction="formatslider" allowthumboverlap="true" horizontalcenter="190" top="118" sliderthumbclass="classes.input.bigthumbclass" fillcolors="[0xff0000, 0x00ff00, 0xff0000, 0x00ff00]"/>
this seems simple, have ideas?
paul
you in way:
<?xml version="1.0" encoding="utf-8"?> <mx:application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" minwidth="955" minheight="600" creationcomplete="init()"> <mx:script> <![cdata[ [bindable]private var lastyear:int = 2008; private function init():void { updatelabels(); } protected function onincyear(event:mouseevent):void { lastyear++; hsstart.maximum = lastyear; updatelabels(); } private function updatelabels():void { hsstart.labels = [hsstart.minimum, hsstart.maximum]; } ]]> </mx:script> <mx:hslider id="hsstart" minimum="1981" maximum="{lastyear}" snapinterval="1" tickinterval="4" livedragging="true" width="527" thumbcount="2" allowthumboverlap="true" horizontalcenter="190" top="118" fillcolors="[0xff0000, 0x00ff00, 0xff0000, 0x00ff00]"/> <mx:button x="698" y="36" label="increment year" click="onincyear(event)"/> </mx:application>
actionscript-3 flex flex3
No comments:
Post a Comment