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!
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.
精彩评论