本文介绍了AS3吐温冻结的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开始使用AS3的吐温功能,但注意到一些奇怪的行为,每一次在一段时间。基本上,它冻结它完成补间之前。

I started using AS3's Tween function but noticed some strange behavior every once in awhile. Basically, it freezes before it finishes the tween.

该网站似乎提供了解决方案:http://www.rgbeffects.com/blog/actionscript/tween-freeze-frustrations-avoid-actionscript-tweens-stalling-out/

This website seems to offer the solution:http://www.rgbeffects.com/blog/actionscript/tween-freeze-frustrations-avoid-actionscript-tweens-stalling-out/

我的程序要求旋转调整屡试不爽precisely。我喜欢用土坯到位的功能,但是这让我很紧张,因为它有这样的一个大问题。

My program requires that the rotation tween works precisely every time. I like to use the functions adobe put in place but this makes me nervous since it has such a big issue.

我应该使用AS3的补间动画或一些外部吐温像greensock.com的TweenLite的?

Should I be using AS3's tween or some external tween like greensock.com's TweenLite?

这将是更可靠?

推荐答案

最有可能的补间实例是prematurely垃圾收集,因为你没有引用存储在某个地方。这是一个常见的​​错误,你可以很容易地为谷歌。

Most likely your tween instance is being prematurely garbage-collected, because you don't store a reference to it somewhere. This is a common mistake which you can easily Google for.

解决方法:存储引用Tween实例,而它正在执行的动画从GC保存

Solution: store a reference to Tween instance while it is performing animation to save it from GC.

单击链接了解详细说明: AS3垃圾收集,您都充斥着早日结束上的原因。

Follow the link for detailed explanation: AS3 Garbage Collection, the reason your tweens are ending early.

adobe.com上官方文章也提到这个问题(见注意在文章​​底部):

Official article on adobe.com also mention this problem (see note at the bottom of article):

注:考虑变量范围使用Tween类。如果补间是在一个功能创建的,重要的是,该变量的范围之外存在的函数本身。如果补间存放于本地范围的变量,动作垃圾收集删除补间的功能完成后,将有可能被补间甚至开始之前。

这是some垃圾链接收集如果您想了解更多关于GC的逻辑。

And here are some links on garbage collecting if you would like to learn more on GC logics.

这篇关于AS3吐温冻结的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-18 23:28