Прежде всего, я знаю, что есть искровой компонент VolumeBar, но я не могу его использовать для требований дизайна.
Я пытаюсь создать пользовательский компонент, но высота не отвечает как следует
[Update]
Это я называю классом
<components:VolumeSlider steps="4" height="100" />
Проблема в том, что бегунок громкости отлично адаптируется, а компонент Мои пользовательские элементы - нет.
<s:HGroup width="100%" height="100%" maxHeight="{height}" >
<s:VGroup width="100%" height="100%" paddingBottom="20" paddingTop="20">
<s:VSlider id="slider" width="100%" height="100%" maximum="{_steps-1}" />
</s:VGroup>
<s:VGroup id="items" width="100%" height="100%" />
</s:HGroup>
<fx:Script>
<![CDATA[
import mx.events.FlexEvent;
[Bindable]
private var _steps:uint = 10;
public function set steps( value:uint ):void
{
_steps = value;
if ( items != null && items.numChildren != 0 )
{
items.removeAllElements();
}
create();
}
private function create():void
{
for ( var i:uint = 0; i < _steps; ++i )
{
var item:VolumeSliderItem = new VolumeSliderItem();
item.percentHeight = item.percentWidth = 100;
if ( items != null )items.addElement(item );
}
}
]]>
</fx:Script>
где VolumeSliderItem - кнопка зажигания