在as3中指定tweenlite的最大循环

时间:2015-01-27 04:14:52

标签: actionscript-3 tweenlite

    public function tweenLetterReward(totalReward:int):void {

        var prizeAr:Vector.<String> = new < String > ["str1", "str2", "str3", "str4",
                                                      "str5"];
        for (var i:int = 0; i < totalReward; i++) 
        {
            //rewardText.visible = true;
            TweenLite.to(rewardText, (.5+i*1), { y:150, onComplete:function(_i:int):void {
                rewardText.y = 300;
                rewardText.text = prizeAr[_i];
                tweenLetterReward(_i);
                //rewardText.visible = false;
            }, onCompleteParams:[i]});
        }
    }

在上面的代码中,假设我调用tweenLetterReward(3); 在onComplete函数中,我跟踪_i值。它为何变为下降或_i = 2,1,0。它应该是0,1,2。请帮忙。感谢

0 个答案:

没有答案