I'm making a Flash game with ActionScript 3 and I have a square with a gradient applied to it. I am trying to programmatically changing the colour of the square depending on time, for example, some times it is orange, some times it is red, but it must always fade to black at the bottom.
The problem is, I'm using ColorTransform (as per here) but it seems to overwrite the gradient and simply fill the square with the solid colour. This isn't what I want. I want the colour that is chosen to fade to black at the bottom, like the original gradient.
How can I do this? Is there a way to only change the "hue" of the symbol (IE: not filling the entire thing with a solid colour), or will I have to reapply a gradient programmatically, with the desired colours?