Question
Help with Gradients
Hi --
I am trying to programatically create a gradient fill. I have tried
following the examples in the Flash CS3 help but they don't seem to work
right.
The help file states:
ratios:Array - An array of color distribution ratios; valid values are 0 to
255. This value defines the percentage of the width where the color is
sampled at 100%. The value 0 represents the left-hand position in the
gradient box, and 255 represents the right-hand position in the gradient
box.
So I interpret this to mean that if I have a box that is 200 pixels wide
that 0 would be at 0 in the box, 128 would be at 100 and 255 would be at
200. However, it appears that 255 is always the middle of the box and 128 is
1/4 of the box.
What I want to do is create a three color gradient of red, blue and green
where blue is in the middle, red is on the left and green on the right and
the colors transition.
Can someone please help me here?
Thanks
Rich
I am trying to programatically create a gradient fill. I have tried
following the examples in the Flash CS3 help but they don't seem to work
right.
The help file states:
ratios:Array - An array of color distribution ratios; valid values are 0 to
255. This value defines the percentage of the width where the color is
sampled at 100%. The value 0 represents the left-hand position in the
gradient box, and 255 represents the right-hand position in the gradient
box.
So I interpret this to mean that if I have a box that is 200 pixels wide
that 0 would be at 0 in the box, 128 would be at 100 and 255 would be at
200. However, it appears that 255 is always the middle of the box and 128 is
1/4 of the box.
What I want to do is create a three color gradient of red, blue and green
where blue is in the middle, red is on the left and green on the right and
the colors transition.
Can someone please help me here?
Thanks
Rich
