【问题标题】:Flex SpinnerList - how animate spin?Flex SpinnerList - 如何动画旋转?
【发布时间】:2012-08-10 07:14:24
【问题描述】:

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

【问题讨论】:

    标签: actionscript-3 apache-flex mobile air


    【解决方案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();
    
    }
    

    } }

    【讨论】:

      猜你喜欢
      • 2011-08-29
      • 1970-01-01
      • 2011-08-21
      • 1970-01-01
      • 2011-12-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多