beginGradientFill() NOT WORKING

Ask a Question related to Macromedia Flash Actionscript, Design and Development.

  1. #1

    Default beginGradientFill() NOT WORKING

    I pass the following function a hex color "00FF00" and a MovieClip name. the clip is on the stage and visible when the function is called.
    The clip changes color when the with statement is commented out and the color statements at the bottom are uncommented.

    WHY can't I get the gradient to work??? I have been trying for 3 weeks. HELP PLEEEEEEEEEASE!!!!

    function chgBroder(newColor:String, myClip:MovieClip) {
    if (newColor<>" ") {
    var colorHex:Number = parseInt(newColor, 16);
    with (myClip) {
    colors = [colorHex, 0x000000];
    alphas = [100, 100];
    ratios = [0, 255];
    beginGradientFill("radial", colors, alphas, ratios);
    endFill();
    }
    //var bColor_color = new Color(myClip);
    //bColor_color.setRGB(colorHex);
    }
    }

    I have placed this on the back burner until the end of the project. Well I'm there and I can't complete it until I make this code work. I'll try any suggestions!!!!


    chrism59 webforumsuser@macromedia.com Guest

  2. Similar Questions and Discussions

    1. beginGradientFill() > matrix
      Hi, I'm having some difficulty understanding the matrix properties for the beginGradientFill method. So far (I think) I have found out the...
    2. beginGradientFill() NOT WORKING MX 2004
      I wrote the following code for flash 7.0, it will not work! somehow my settings got switch to 6.0 and the code works fine. Is there something wrong...
    3. beginGradientFill Question
      In the beginGradientFill method, what exactly does the transformation matrix control...... ? I mean the a:somevalue b:somevalue etc....I can't...
    4. beginGradientFill HELP
      lineTo (not lineto) moveTo (not moveto)
    5. beginGradientFill?
      I cut and paste the sample code in the help files for beginGradientFill and nothing shows up. I found some example code of it online and tried...
  3. #2

    Default Re: beginGradientFill() NOT WORKING

    beginGradientFill is missing the matrix parameter, it fails without it,

    from the Reference -
    myMovieClip.beginGradientFill (fillType, colors, alphas, ratios, matrix)

    regards
    Jack..
    Jack. webforumsuser@macromedia.com Guest

  4. #3

    Default Re: beginGradientFill() NOT WORKING

    The matrix is an optional parameter.
    I have an image in the movieclip.
    I am trying to change the color of the image contained in the clip.


    chrism59 webforumsuser@macromedia.com Guest

  5. #4

    Default Re: beginGradientFill() NOT WORKING

    >The matrix is an optional parameter
    is this new feature of MX2004 ?
    this fails in MX -

    this.createEmptyMovieClip("grad",1);
    with(grad){
    colors = [0xFF0000,0x0000FF]; alphas = [100,100]; ratios = [0,0xFF];
    //matrix = {a:500,b:0,c:0,d:0,e:200,f:0,g:350,h:200,i:1};
    beginGradientFill("radial",colors,alphas,ratios);//,matrix
    moveto(100,100); lineto(100,300); lineto(300,300);
    lineto(300,100); lineto(100,100); endFill();
    }

    you might be able to adapt the method used in the file at this link,

    [url]http://www.jackleaman.co.uk/flash/two/color1.swf[/url]

    regards
    Jack..
    Jack. webforumsuser@macromedia.com Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139