后面说过关于 Flex中设置slider控件的标记密度(thickness)。接下来讲如果通过设置 DE< tickLength值来DE<设置设置标记的长度。 '; } else { whichEl.style.display = 'none'; sb.innerHTML=' 显示代码'; whichEl.witdh="300px"; } } 隐藏代码 DE<<?xml version="1.0" encoding="utf-8"?><!-- http://blog.flexexamples.com/2008/06/04/setting-the-tick-length-on-a-slider-control-in-flex/ --><mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white"> <mx:HSlider id="slider" minimum="0" maximum="10" value="3" liveDragging="true" tickLength="{slider.value}" tickInterval="1" /></mx:Application>DE< 你可以使用AS来实现 DE<<?xml version="1.0" encoding="utf-8"?><!-- http://blog.flexexamples.com/2008/06/04/setting-the-tick-length-on-a-slider-control-in-flex/ --><mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white"> <mx:Script> <![CDATA[ import mx.events.SliderEvent; private function slider_change(evt:SliderEvent):void { slider.setStyle("tickLength", evt.value); } ]]> </mx:Script> <mx:HSlider id="slider" minimum="0" maximum="10" value="3" liveDragging="true" tickInterval="1" change="slider_change(event);" /></mx:Application>DE< 查看Demo演示 原创作者: peterd。翻译整理:一路风尘