Flex SpinnerList - how animate spin?

非 Y 不嫁゛ 提交于 2019-12-12 01:08:03

问题


How to programmatically set the spin of component SpinnerList (Flex mobile) so that it can spin for a few seconds and then stopped at selected index?


回答1:


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();

}

} }



来源:https://stackoverflow.com/questions/11897035/flex-spinnerlist-how-animate-spin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!