AS3自訂HSlider

來源:互聯網
上載者:User

AS3自訂HSlider

效果:



改動的地方:
1.HSliderSkin 控制項主皮膚
2.HSliderTrackSkin 軌道皮膚
3.HSliderThumbSkin 滑塊皮膚

1.HSliderSkin 添加以下代碼:

<!-- 滑塊左邊的藍色條 -->

其中right是設定藍色條的右邊距,自己修改成合適的產生方法

<!-- blur -->
<s:Rect left="1" right="{1 + (100 - hostComponent.value)/100*this.width}" top="3.5" bottom="3.5"
radiusX="2" radiusY="2">
<s:fill>
<s:LinearGradient rotation="90">
<s:GradientEntry color="0x9ac6df"/>
<s:GradientEntry color="0xafe2ff"/>
</s:LinearGradient>
</s:fill>
</s:Rect>



2.HSliderTrackSkin 修改為以下代碼:


<!-- fill -->
<s:Rect left="1" right="1" top="3.5" bottom="3.5" radiusX="2" radiusY="2">
<s:fill>
<s:LinearGradient rotation="90">
<s:GradientEntry color="0xCECECE"/>
<s:GradientEntry color="0xDEDEDE"/>
</s:LinearGradient>
</s:fill>
</s:Rect>



3.HSliderThumbSkin 代碼如下:


<!-- border -->
<s:Rect left="-1" right="-1" top="-1" bottom="-1" radiusX="4" radiusY="4">
<s:fill>
<s:SolidColor color="0x4F4F4F"  />
</s:fill>
</s:Rect>

<!-- fill -->
<s:Rect left="-0.5" right="-0.5" top="-0.5" bottom="-0.5" radiusX="3" radiusY="3">
<s:fill>
<s:LinearGradient>
<s:GradientEntry color="0xFFFFFF" 
color.over="0xE5E5E5"
color.down="0x999999" />
</s:LinearGradient>
</s:fill>
</s:Rect>

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.