开发者

Infinite tweening hue loop in AS3 with Tweener

开发者 https://www.devze.com 2022-12-16 02:10 出处:网络
I\'m trying to infinitely loop a bitmap all the way through the colour 开发者_高级运维spectrum using AS3, Tweener and its ColorShortcuts class. This doesn\'t loop back tothe function \"tween1\":

I'm trying to infinitely loop a bitmap all the way through the colour 开发者_高级运维spectrum using AS3, Tweener and its ColorShortcuts class. This doesn't loop back to the function "tween1":

function tween1():void {
    Tweener.addTween(image, { _hue: 180, time:5, onComplete:tween2 } );
}

function tween2():void {
    Tweener.addTween(image, { _hue: -180, time:5, onComplete:tween1 } );
}

Any ideas? Thanks in advance!


I haven't tested, but could you get away with:

function tween1():void {
    image._hue = -180;//you might need something like a colorMatrix here
    Tweener.addTween(image, { _hue: 180, time:5, onComplete:tween1 } );
}

I know there is no _hue by default, but I'm guessing you see what I mean.

0

精彩评论

暂无评论...
验证码 换一张
取 消