设置是否在AS3 prevent时间轴补间的属性? [英] Does setting properties in AS3 prevent timeline tweens?

查看:128
本文介绍了设置是否在AS3 prevent时间轴补间的属性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我有一个视频剪辑分配了一个类和我更改影片剪辑在code的属性,似乎财产不能再在时间轴上补间。

If I have a movieclip that has a class assigned to it and I change a property of that movieclip in code, it seems that the property can no longer be tweened on the timeline.

例如,如果我的班台this.x = 100,后来在时间轴上我补间对象的位置,也不会发生时间轴补间。

For example, if my class sets this.x = 100, and later on the timeline I tween the position of the object, that timeline tween will not occur.

更改或者将scaleX或scaleY属性也似乎停止时间轴补间的发生。

Changing either scaleX or scaleY property also seems to stop timeline tweens from happening.

有没有其他人遇到过,如果是的话,是有办法解决它?

Has anyone else experienced this, and if so, is there a way around it?

推荐答案

您是不是正确的。改变一个MC在舞台上的某些属性将导致Flash来假设你要它与脚本的位置,补间将不再工作。一对夫妇解决方法:

You have it right. Changing certain properties of an MC on the stage will cause Flash to assume that you are going to position it with script, and tweens will no longer work. A couple of workarounds:

  1. 在Reparent的东西,让你不同的脚本和IDE定位。也就是说,如果你在补间的对象的X位置,也与剧本旋转它,改变它,这样你补间一个容器剪辑的X和内旋转的内夹。
  2. 请你所有的定位与脚本 - 即使用Tween类,或在补库
  3. 如果播放头会转到过去的框架,其中剪辑是不是在舞台上,然后一帧它在哪里,这将重置剪辑IDE定位和补间工作。即使你跳过去的空架与的gotoAndPlay 这是真实的。因此,例如,如果使用脚本移动剪辑的10帧,然后在第20帧你的gotoAndPlay(30); ,然后补间在第30帧将工作正确的,如果你把一个空白帧帧20和30之间的某个地方。
  1. Reparent things so that you separate scripted and IDE positioning. That is, if you were tweening an object's X position and also rotating it with script, change it so that you tween the X of a container clip, and rotate an inner clip inside.
  2. Do all your positioning with script - i.e. use the Tween class, or a tween library.
  3. If the playhead goes past a frame where the clip is not on the stage, and then to a frame where it is, this will "reset" the clip to work with IDE positioning and tweens. This is true even if you jump past the empty frame with gotoAndPlay. So for example, if you use script to move the clip on frame 10, and then on frame 20 you do gotoAndPlay(30);, then a tween at frame 30 will work correctly if you put a blank frame somewhere between frames 20 and 30.

这篇关于设置是否在AS3 prevent时间轴补间的属性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆