as3,flash fl 补间过渡冻结
我在不同的影片剪辑中进行了一堆不同的补间,但似乎有时补间会在过渡过程中冻结。
这家伙也有同样的问题,他的问题得到了解答,但我不太清楚当他们告诉他该怎么做时他们到底是什么意思:http://www.actionscript.org/forums/showthread.php3?t=222606
我是否必须在开始时导入我的补间类根目录中的站点然后引用每个影片剪辑中的类,而不是分别导入每个影片剪辑中的类?
以下是我的一个影片剪辑中的补间示例:
// Import classes
import fl.transitions.Tween;
import fl.transitions.easing.*;
// Bring in elements with tweening
var bandY:Tween = new Tween(band, "y", Strong.easeOut, 533, 259, 3, true);
var boxY:Tween = new Tween(box, "y", None.easeOut, -122, 0, 1, true);
var signY:Tween = new Tween(sign, "y", Regular.easeOut, 551, 224, 1.5, true);
var signX:Tween = new Tween(sign, "x", Regular.easeOut, -17, 82, 1.5, true);
var dragonMaskWidth:Tween = new Tween(dragonMask, "width", Regular.easeOut, 30, 500, 3, true);
I have a bunch of different tweens going on in different movie clips but it seems that sometimes the tweens will freeze halfway through during my transitions.
This guy is having the same problem and his question was answered but I'm not too sure exactly what they meant when they told him what to do: http://www.actionscript.org/forums/showthread.php3?t=222606
Do I have to import my tween classes at the very beginning of my site in the root then reference those in every movie clip as opposed to importing the classes in each movieclip separately?
Here is an example of a tween inside one of my movieclips:
// Import classes
import fl.transitions.Tween;
import fl.transitions.easing.*;
// Bring in elements with tweening
var bandY:Tween = new Tween(band, "y", Strong.easeOut, 533, 259, 3, true);
var boxY:Tween = new Tween(box, "y", None.easeOut, -122, 0, 1, true);
var signY:Tween = new Tween(sign, "y", Regular.easeOut, 551, 224, 1.5, true);
var signX:Tween = new Tween(sign, "x", Regular.easeOut, -17, 82, 1.5, true);
var dragonMaskWidth:Tween = new Tween(dragonMask, "width", Regular.easeOut, 30, 500, 3, true);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您引用的论坛中的帖子的意思是他们 OP 应该尝试为补间创建非局部变量。所以,
他们不是这样做,而是说尝试这样做:
通过这样做,变量“theTween”的范围不是 onClick 事件处理函数的本地范围,而是与函数本身在同一范围内。
我最大的建议是尝试使用不同的补间库,那里有很多。恕我直言,Flash 中用于补间的内置库还有很多不足之处。我会看一下其中的一个或多个:
TweenLite
Tweener
GTween
AS3 动画系统
还有更多...只需看一下看
What the post meant in the forum you referenced was that they OP should try creating non-local variables for the tweens. SO, instead of doing this
They were saying to try this:
By doing this, the scope of the variable "theTween" is not local to the onClick event handler function, but rather it is in the same scope as the function itself.
My biggest recommendation would be to try using a different tweening library, there are TONS out there. The built-in library for Tweening in flash leaves a lot to be desired IMHO. I would take a look at one or more of these:
TweenLite
Tweener
GTween
AS3 Animation System
There are many more... just take a look
事实上,我已经明白了另一个人在说什么。
我必须将补间变量移到函数之外,这是有道理的。
一开始很难看出他们的代码有什么不同。
还意识到这是不好的示例代码,因为没有函数。
Actually, I figured out what the other guy was saying.
I have to move tween variables outside of functions, makes sense.
It was hard to see the difference in their code at first.
Also realized that this was bad example code to use because there's no functions.