You can use this class I wrote a while ago: http://www.mediaverk.lv/asd/com/jR/Math/ColorTween.as var colorPalete:Array = new ColorTween([0x0, 0xFFFFFF]).getArray(countOfSteps);
2006/4/4, GregoryN <[EMAIL PROTECTED]>: > > Hello Juan, > > Your task seems rather simple: > 1) Create or attach a number of clips (10 in your case) > 2) Assign a color to each of them > > My Dynamic Blend component does exactly this: > http://www.gousable.com/flash/dynBlend.html > > There is also old version (Flash MX) available for free - in case > you'd like to see the source code ;-). > > > -- > Best regards, > GregoryN > ================================ > http://GOusable.com > Flash components development. > Usability services. > > On 4/3/06, Juan Anzaldo <[EMAIL PROTECTED]> wrote: > > > > I'm doing a class that manages a colors palette > > I want to select a color and know 10 steps from the > > color to White to the color > > > > I have this code that make a gradient from white to > > the color that I want and from this color to black > > ----------------------- > > createEmptyMovieClip("gradiente_mc", 10); > > var xi:Number = 301; > > var yi:Number = 0; > > var ancho:Number = 30; > > var alto:Number = 150; > > var fillType:String = "linear"; > > var alphas:Array = [100, 100, 100]; > > var ratios:Array = [1, 100, 254]; > > var matrix:Object = > > {matrixType:"box",x:xi,y:yi,w:ancho,h:alto,r:90/180*Math.PI}; > > var spreadMethod:String = "pad"; > > var interpolationMethod:String = "linearRGB"; > > var focalPointRatio:Number = 0.9; > > > > dibuja = function(sColor) > > { > > var colores:Array = [0xFFFFFF,sColor, 0x000000]; > > with (gradiente_mc) > > { > > lineStyle(1, 0x000000) > > beginGradientFill(fillType, colores, alphas, > > ratios, matrix); > > moveTo(xi, yi); > > lineTo(xi+ancho, yi); > > lineTo(xi+ancho, yi+alto); > > lineTo(xi, yi+alto); > > lineTo(xi, yi); > > endFill(); > > } > > } > > dibuja(0x2B0A9E); > > > > ------------------ > > It functions very good but I need just 10 steps from > > the color to white and each color stay in a movie clip > > > > like shows the figure because I need to use the colors > > for apply in others _mc's > > > > figure URL : > > > > http://201.131.19.21/administracion2/colores.gif > > > > tnx for your help > > > > > > Ing. Juan Anzaldo > > Tel Cel. 614 427-6523 > > Blog : http://janzaldo.blogspot.com > > > _______________________________________________ > Flashcoders@chattyfig.figleaf.com > To change your subscription options or search the archive: > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > Brought to you by Fig Leaf Software > Premier Authorized Adobe Consulting and Training > http://www.figleaf.com > http://training.figleaf.com > _______________________________________________ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com