在保持底部 (Y) 位置的同时进行形状补间/变换?
我正在尝试对火箭发射的影片剪辑进行补间。我希望它在升空前“挤压”,然后在升空时“拉伸”。
当我使用变换工具在时间轴上对此进行补间时,我可以“挤压”火箭,并且火箭的底部保持在“地面”上。这就是我想要的。然而,由于我不会详细说明的原因,我需要在 AS3 中执行此操作,而不是在时间轴上执行此操作。但是,当我使用“高度”补间时,影片剪辑高度会发生变化,但它会在底部收缩/拉伸(锁定在顶部)。
可以用补间类做我想做的事吗?我还需要使用“高度”之外的其他东西吗?
我应该使用变换矩阵吗?如果我使用变换矩阵,我可以对其进行补间吗? (我在变换矩阵方面没有太多经验。)
这是我用于拉伸的补间:
var tweenPlayer1:Tween = new Tween(mc_player, "height", Strong.easeOut, mc_player.height, mc_player.height+100, 2, true);
I'm trying to shape tween a movie clip of a rocket blasting off. I want it to "squash" before liftoff, and then "stretch" as it lifts off.
When I tween this on the timeline with the transform tool, I can "squash" the rocket, and the base of the rocket stays on the "ground". This is what I want. However, for reasons I won't go into, I need to do this in AS3, as opposed to on the timeline. When I use a "height" tween, though, the movieclip height changes, but it shrinks/stretches at the bottom (locked at the top).
Is it possible to do what I want with the tween class? Do I need to use something besides "height"?
Should I use a transform matrix, instead? If I use a transform matrix, can I tween it? (I don't have very much experience with transform matricies.)
Here's the tween I'm using for the stretch:
var tweenPlayer1:Tween = new Tween(mc_player, "height", Strong.easeOut, mc_player.height, mc_player.height+100, 2, true);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
可能有更好的方法来处理startingYandHeight,但这对你有用
There probably is a better way to handle startingYandHeight but this will work for you
问题可能在于您将图形锚定在 FLA 中的影片剪辑对象内的位置。如果您调整图形使其底部对齐,例如影片剪辑内部的graphic.y = -graphic.height,则Y轴上的缩放应该只是从底部而不是从顶部推动图形。
The issue probably lies with the where you have the graphic anchored inside of your movieclip object in your FLA. If you adjusted the graphic so that is was bottom justified, for example graphic.y = -graphic.height inside of the movieclip, scaling on the Y axis should simply push the graphic from the bottom and not from the top.
正如我上面所描述的,这是另一种方法。这与更改注册点具有相同的效果,而无需处理子组件和层的麻烦。
基于我在这里找到的教程:http://theflashconnection。 com/content/how-to-change-registration-point-as3#viewSource
Here's another approach, as I described, above. This has the same effect as changing the registration point without the headache of dealing with child components and layers.
Based on the tutorial that I found here: http://theflashconnection.com/content/how-to-change-registration-point-as3#viewSource