You can use TweenMax's ability to tween hex colors and fire an onUpdate
callback that applies the new values, like this (AS3):

import flash.geom.*
import flash.display.*
import gs.*;

var gradientColors:Object = {left:0xFF0000, right:0x0000FF};
var gradientMatrix:Matrix = new Matrix();
gradientMatrix.createGradientBox(100, 100, 0, 0, 0);

function applyGradient():void {
        this.graphics.beginGradientFill(GradientType.LINEAR,
[gradientColors.left, gradientColors.right], [1, 1], [0, 255],
gradientMatrix, SpreadMethod.PAD);  
        this.graphics.drawRect(0, 0, 100, 100);
}
applyGradient();

TweenMax.to(gradientColors, 2, {hexColors:{left:0x00FF00, right:0x660066},
onUpdate:applyGradient, delay:1});

The same sort of thing can be done in AS2 as well.

You can get TweenMax at www.TweenMax.com

Jack


-----Original Message-----
From: Ali Drongo [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 08, 2008 3:47 AM
To: Flash Coders List
Subject: Re: [Flashcoders] How do you do this? (animating gradient
fillcolours)

Thanks for your reply allandt, I can see how TweenLite could tween  
the color property of a movie clip but how is the gradient bit achieved?
Cheers,
Ali


On 8 Jul 2008, at 09:39, allandt bik-elliott (thefieldcomic.com) wrote:

> not entirely sure but it sounds like a tweenmax color matrix tween
>
> take a look at http://blog.greensock.com/
>
> a
>
> On Tue, Jul 8, 2008 at 9:20 AM, Ali Drongo  
> <[EMAIL PROTECTED]> wrote:
>
>> Hiya, how do you think you would do this? Can anyone point me to some
>> tutorials or give me a snippet?
>> Cheers!
>> Ali
>>
>> _______________________________________________
>> Flashcoders mailing list
>> Flashcoders@chattyfig.figleaf.com
>> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>>
> _______________________________________________
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to