0

如何以编程方式设置组件 SpinnerList (Flex mobile) 的旋转,使其可以旋转几秒钟,然后在选定的索引处停止?

4

1 回答 1

0
private function scrollToIndex(index:int, animationDuration:int = 1000):void {
if ((index != -1) && (list.layout != null)) {
var spDelta:Point = list.dataGroup.layout.getScrollPositionDeltaToElement(index);
if ((spDelta != null) && (spDelta.y != 0)) {
var target:DataGroup = list.dataGroup;
var animation:AnimateProperty = new AnimateProperty(target);
animation.property = "verticalScrollPosition";
animation.duration = animationDuration;
animation.toValue = target.verticalScrollPosition + spDelta.y;
animation.play();

}

} }

于 2012-08-11T08:33:06.680 回答