Alpha 0 vs可见=否 [英] Alpha 0 vs Visible = false
问题描述
我正在开发一个Flash网站,其中包含一些动画(是的),我对如何获得更好的效果表示怀疑。其中一些动画的alpha值从1变为0。所以我有两种方法:
I'm developing a website in flash that has some animations (oh yeah) and I have a doubt about the way I got a better performance. Some of this animations got an alpha changing from 1 to 0. So there is two ways I did:
- 补间当然是对象保留在Alpha = 0的舞台上,是否还有剩余的处理工作?还是Flash很聪明,只是忽略对象?
- 手动操作,当alpha低于0.1时,我将visible设置为0,仅此而已。但是我想知道补间动画是否比手工制作的函数更快...
有什么意见吗?
推荐答案
绝对使用Greensock库。
Definitely use the Greensock library.
要为Alpha设置动画,然后使其不可见,请执行以下操作:
To animate the alpha, then make it invisible, do this:
TweenLite.to(movieClip, 0.5, { autoAlpha: 0 });
有关Greensock Tweening引擎的更多信息:
http://www.greensock.com/tweenlite/
More info about the Greensock Tweening engine: http://www.greensock.com/tweenlite/
如果您也有显示列表上有很多对象,并且会影响性能,您仍然可以将对象移出渲染区域,该区域(如果我是对的话)离开舞台2000px,因此您应该执行以下操作:
If you have too many objects on the display list and it effects the performance, you still can move your objects out of the "render" area, which (If I am correct) 2000px out of the stage, so then you should do this:
TweenLite.to(movieClip, 0.5, {autoAlpha: 0, onComplete: function() {
movieClip.x = movieClip.y = 10000;
}});
我希望对您有所帮助,
抢劫
I hope it helps, Rob
这篇关于Alpha 0 vs可见=否的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!