我正在使用Greensock库'TimelineLite‘进行补间。
我一直在寻找这个问题的解决方案,但没有任何运气。如何使我的timelineLite时间线的一部分。假设我在一个时间线内有10个补间,我想让3-10无限循环,前三个只循环一个。
发布于 2012-10-27 22:57:35
使用“onComplete: tweenLite;”向补间添加事件侦听器。
var myTimeline:TimelineLite = new TimelineLite({onComplete:loop});在要开始循环的点处添加标签:
//Add a "spin" label 3-seconds into the timeline
myTimeline.addLabel("spin", 3);然后创建循环函数
function loop():void
{
//go to the "spin" label and play the timeline from there
myTimeline.gotoAndPlay("spin");
}编辑:或者不必创建单独的loop函数:
var myTimeline:TimelineLite = new TimelineLite({
onComplete: tl.gotoAndPlay,
onCompleteScope: tl,
onCompleteParams: ["spin"],
});发布于 2012-10-26 22:58:29
使用TimelineMax。您可以将子时间轴附加到TimelineMax。因此,您可以将循环补间放在一个时间轴上(设置为重复),并将其附加到也具有非循环补间的父时间轴。
https://stackoverflow.com/questions/13088607
复制相似问题