flex移动应用程序中的补间库

时间:2011-11-18 16:37:41

标签: flex mobile tween

我想在flex移动应用中补间图片的alpha。我试过tweenlite 但它运行得太快了。是否有任何优化的方法,或在目标C中链接 代码?

感谢

1 个答案:

答案 0 :(得分:0)

使用TweenLite库,您可以使用帧数或使用时间长度来控制补间的长度。

在tweenProperties对象中,使用useFrames关键字指定补间时间范围是指定帧还是秒。

'to'或'from'补间的第二个参数指定长度。

因此,创建一个补间超过10帧的alpha补间,它应如下所示:

tweenProperties = new Object();
tweenProperties.alpha = yourNewAlphaHere;
tweenProperties.useFrames = true;

TweenLite.to(myObjectToTween, 10,tweenProperties);

要创建补间超过10秒的alpha补间,它将如下所示:

tweenProperties = new Object();
tweenProperties.alpha = yourNewAlphaHere;
tweenProperties.useFrames = false;

TweenLite.to(myObjectToTween, 10,tweenProperties);

根据您正在做的事情,您可能需要将TweenNano视为移动应用,因为它是最小的覆盖范围。