【问题标题】:how to make the images appear one by one? flash as3如何让图像一张一张出现?闪存 as3
【发布时间】:2011-10-09 14:18:12
【问题描述】:

我试图让我的图像一张一张出现,但它们一起出现在屏幕上:

for (var i=0; i<myImages.length; i++){
    myImages[i].alpha = 0;
    myImages[i].buttonMode = true;
    TweenLite.to(myImages[i], 1, {delay:.5, alpha:1});
}

延迟不是正确的选择,你知道吗?

谢谢

【问题讨论】:

    标签: flash actionscript-3 tween gsap


    【解决方案1】:

    试试这个小变化:

    for (var i=0; i<myImages.length; i++){
        myImages[i].alpha = 0;
        myImages[i].buttonMode = true;
        TweenLite.to(myImages[i], 1, {delay:(0.5*i), alpha:1});
    }
    

    当您在不同的图像上设置多个 TweenLite 补间时,如果所有补间的 延迟持续时间 相同,则所有图像都会显示在屏幕上同时,你不觉得吗? ;)

    所以解决方案是在循环图像时增加补间的延迟。

    【讨论】:

      【解决方案2】:
      for (var i=0; i<myImages.length; i++){
          myImages[i].alpha = 0;
          myImages[i].buttonMode = true;
          TweenLite.to(myImages[i], 1, {delay:(i+1)*0.5, alpha:1});
      }
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2020-06-24
        • 2013-12-08
        • 2013-09-04
        • 1970-01-01
        • 1970-01-01
        • 2011-01-29
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多