Skip to main content
Participant
May 21, 2010
Question

How to increase RGB values of a radial gradient of shapes every 1 or 3 frames?

  • May 21, 2010
  • 1 reply
  • 524 views

Hello everybody. I really need help. Indeed, i would like to inrease the RGB values of my radial gradient of my shape every 1 or 3 frames. I did it manually, but its very long. So i would like to know if anyone can help me to make it with code, it's will be most efficient and fast. I've already created my shape with a radial gradient. Now i would like just to increase the RGB values of my radial gradient. Can you help me please!

This code create my shape with a radial gradient:

var radType:String = GradientType.RADIAL;

var radMatrix:Matrix = new Matrix();

radMatrix.createGradientBox(120,120);


var tabCouleurs:Array = [0xFFFFFF, 0xAEAEAE];


var radColours:Array = tabCouleurs;

var radAlphas:Array = [1, 1];

var radRatios:Array = [0, 255];

var gradients:Sprite = new Sprite();

gradients.graphics.beginGradientFill(radType, radColours, radAlphas, radRatios,radMatrix);

gradients.graphics.drawRect(0, 0, 120, 120);

gradients.x = 50;

gradients.y = 50;

addChild(gradients);

This topic has been closed for replies.

1 reply

Participant
May 21, 2010

Anyone can help me ?

Inspiring
May 22, 2010

Not really sure what you mean by increase RGB values. But if that is what you want to do then that is what you need to do.

clear() your graphics

increase the values

redraw

Nothing particularly difficult there. What is the problem you are having?