4 Replies Latest reply on Sep 1, 2011 10:04 PM by kglad

    line

    narmathadevi

      hai,

       

       

                How to create the gradient line?

        • 2. Re: line
          kglad Adobe Community Professional & MVP

          check the movieclip method, lineGradientStyle().

           

           

          this.createEmptyMovieClip("mc",1);
          with (mc) {
              colors = [0xff0000, 0x00ff00];
              alphas = [100, 100];
              ratios = [0, 0xFF];
              matrix = {a:200, b:0, c:0, d:0, e:200, f:0, g:200, h:200, i:1};
              spreadMethod = "reflect";
              interpolationMethod = "linearRGB";
              focalPointRatio = 0.9;
              lineStyle(8);
              lineGradientStyle("linear",colors,alphas,ratios,matrix,spreadMethod,interpolationMethod,f ocalPointRatio);
              moveTo(100,100);
              lineTo(100,300);
              lineTo(300,300);
              lineTo(300,100);
              lineTo(100,100);
              endFill();
          }

          1 person found this helpful
          • 3. Re: line
            narmathadevi Level 1

            hai,

             

                      The given coding is correct for rectangle but i am asking the gradient "line" and how to give the "matrix" parameter in lineGradientStyle() for "line".

            • 4. Re: line
              kglad Adobe Community Professional & MVP

              a rectangle is 4 lines.  here's one line:

               

              this.createEmptyMovieClip("mc",1);
              with (mc) {
                  colors = [0xff0000, 0x00ff00];
                  alphas = [100, 100];
                  ratios = [0, 0xFF];
                  matrix = {a:200, b:0, c:0, d:0, e:200, f:0, g:200, h:200, i:1};
                  interpolationMethod = "linearRGB";
                  lineStyle(8);
                  lineGradientStyle("linear",colors,alphas,ratios,matrix,spreadMethod,i nterpolationMethod,focalPointRatio);
                  moveTo(100,100);
                  lineTo(300,100);
              }

               

              // read the help files to learn how to create the gradient you want.