Hi, thanks for taking the time to look at my problem. I would like to be able to make changes to a colour gradient of a sprite from my library, as opposed to one drawn dynamically.
So the code I thought would look something like this:
var radType:String = GradientType.RADIAL;
var radMatrix:Matrix = new Matrix();
radMatrix.createGradientBox(120,120);
var radColours:Array = [0x3174d0, 0x15396f];
var radAlphas:Array = [1, 1];
var radRatios:Array = [0, 255];
var myLibrarySprite:spriteInLibrary = new spriteInLibrary();
myLibrarySprite.graphics.beginGradientFill(radType, radColours, radAlphas, radRatios,radMatrix);
addChild(myLibrarySprite);
I’ve been using essentially this code (plus a bit for say drawing a square) happily to gradient fill sprites that are dynamically drawn
Any help is appreciated.
Pointers towards tutorials that do this or corrections to my code or just
[FONT=Times New Roman][SIZE=3]reassurance[/SIZE][/FONT] that it’s possible.
I dont get any errors from this.
I have tried adding myLibrarySprite.graphics.clear() but that does not make a difference.