6 Replies Latest reply on Aug 1, 2006 5:24 PM by adrianTNT

    Color code problem

    adrianTNT Level 1
      Hello.
      I have this code:

      colors = [0xFFCC00, 0xFFFF00];
      alphas = [100, 100];
      ratios = [0, 0xFF];
      matrix = {a:100, b:20, c:5, d:100, e:0, f:10, g:100, h:10, i:5};
      beginGradientFill("linear", colors, alphas, ratios, matrix);

      I use it to fill a clip with a gradient color.
      I want the second color (in first line) to be taken from a variable.
      I tried:

      my_color = "0x"+"FFFFCC";
      colors = [0xFFCC00, my_color];
      alphas = [100, 100];
      ratios = [0, 0xFF];
      matrix = {a:100, b:20, c:5, d:100, e:0, f:10, g:100, h:10, i:5};
      beginGradientFill("linear", colors, alphas, ratios, matrix);

      It doesnt work, it doesn't read the variable as a color and the color it sets is black.
      Anyone knows how the color code should be composed so that I can have that color code taken from a variable?

      Thank you.
      - Adrian.