let’s say i have this object on stage and it is called myShape and i want to manipulate it via action-script and apply a gradient color to it ..
no if it is a fill color i could have used the colortransform method but i don’t think that it will work .. and please don’t suggest me to draw the shape with action script .
import flash.geom.*
import flash.display.*
var fillType:String = GradientType.LINEAR;
var colors:Array = [0xFF0000, 0x0000FF];
var alphas:Array = [1, 1];
var ratios:Array = [0x00, 0xFF];
var matr:Matrix = new Matrix();
matr.createGradientBox(200, 100, 0, 0, 0);
var spreadMethod:String = SpreadMethod.PAD;
myShape.graphics.beginGradientFill(fillType, colors, alphas, ratios, matr, spreadMethod);
now when i test this i don’t get any errors but i doesn’t apply any thing ..
I would create a bounding rectangle Shape, fill it with the gradient and apply the object as a mask. Is it possible in your case?