Flash AS3:在帧到帧上补间 MC 到 MC

发布于 2024-08-08 01:30:56 字数 1098 浏览 5 评论 0原文

我正在尝试在 Flash CS3 中构建四帧动画。 背景图像(每个都设置为 MovieClips)在每一帧上都会发生变化,并且我想在每个 MC 上放置淡出/淡入过渡。 但我似乎无法让它正常工作。 这是我的代码:

if (currentFrame == 1) {
    var alphaTweenOut1:Tween = new Tween (image1, "alpha", Regular.easeOut, 100, 0, 1, true);
    var alphaTweenIn2:Tween = new Tween (image2, "alpha", Regular.easeIn, 0, 100, 3, true);
} else if (currentFrame == 2) {
    var alphaTweenOut2:Tween = new Tween (image2, "alpha", Regular.easeOut, 100, 0, 1, true);
    var alphaTweenIn3:Tween = new Tween (image3, "alpha", Regular.easeIn, 0, 100, 3, true);
} else if (currentFrame == 3) {
    var alphaTweenOut3:Tween = new Tween (image3, "alpha", Regular.easeOut, 100, 0, 1, true);
    var alphaTweenIn4:Tween = new Tween (image4, "alpha", Regular.easeIn, 0, 100, 3, true); 
} else {
    var alphaTweenOut4:Tween = new Tween (image4, "alpha", Regular.easeOut, 100, 0, 1, true);       
    var alphaTweenIn1:Tween = new Tween (image1, "alpha", Regular.easeIn, 0, 100, 3, true);
    //loop back to first frame (there is a 5th frame that is triggered on mouse events)
    gotoAndPlay(1);
}

I am trying to build a four frame animation in Flash CS3.
The background images (each being set to MovieClips) change on each frame, and I want to put a fade out/in transition on each of the MC's.
I can't seem to get this working properly though.
Here is the code I have:

if (currentFrame == 1) {
    var alphaTweenOut1:Tween = new Tween (image1, "alpha", Regular.easeOut, 100, 0, 1, true);
    var alphaTweenIn2:Tween = new Tween (image2, "alpha", Regular.easeIn, 0, 100, 3, true);
} else if (currentFrame == 2) {
    var alphaTweenOut2:Tween = new Tween (image2, "alpha", Regular.easeOut, 100, 0, 1, true);
    var alphaTweenIn3:Tween = new Tween (image3, "alpha", Regular.easeIn, 0, 100, 3, true);
} else if (currentFrame == 3) {
    var alphaTweenOut3:Tween = new Tween (image3, "alpha", Regular.easeOut, 100, 0, 1, true);
    var alphaTweenIn4:Tween = new Tween (image4, "alpha", Regular.easeIn, 0, 100, 3, true); 
} else {
    var alphaTweenOut4:Tween = new Tween (image4, "alpha", Regular.easeOut, 100, 0, 1, true);       
    var alphaTweenIn1:Tween = new Tween (image1, "alpha", Regular.easeIn, 0, 100, 3, true);
    //loop back to first frame (there is a 5th frame that is triggered on mouse events)
    gotoAndPlay(1);
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文