0

有什么方法可以HSlider在组件内部使用 a 进行缩放(使用百分比值)?

我实际上有一个容器:

<s:BorderContainer id="suppCont" x="238" y="10" width="710" height="514"
                   backgroundColor="#FFFFFF" borderAlpha="0.4" cornerRadius="5"></s:BorderContainer>

我希望能够使用它HSlider来放大内部BorderContainer

<s:HSlider x="597" y="491" maximum="500" minimum="0" stepSize="50" value="100"/>

任何建议将不胜感激。

4

1 回答 1

0

You can use Zoom effect or just change the scale of BorderComponent, like this:

<s:HSlider id="slider" minimum="0" maximum="100" thumbDrag="slider_thumbDragHandler(event)" />
<s:BorderContainer id="borderComponent">
    //some content
    ....
    ....
</s:BorderContainer>

And handlere like this:

protected function slider_thumbDragHandler(event:TrackBaseEvent):void
{
    trace(slider.value);

    borderComponent.scaleX = (1 + slider.value/100);
    borderComponent.scaleY = (1 + slider.value/100);
}
于 2013-05-06T09:27:16.037 回答