flashactionscript-3tweentweener

Infinite tweening hue loop in AS3 with Tweener


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!


Solution

  • 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.