Colour Changing // Flash

Out of context: Reply #5

  • Started
  • Last post
  • 5 Responses
  • ********
    0

    Place the following on actions frame in main timeline:

    Color.prototype.setColorRGB = function (r, g, b) {

    if (!isNaN(r+g+b) && r=0 && g=0 && b=0) {

    r = (parseInt (r)).toString(16); r.length == 1 ? r = "0" + r : r;
    g = (parseInt (g)).toString(16); g.length == 1 ? g = "0" + g : g;
    b = (parseInt (b)).toString(16); b.length == 1 ? b = "0" + b : b;

    this.setRGB(parseInt("0x"+r+g+b...
    }
    }

    To examples of usage:

    onClipEvent(load) {
    c = new Color(mc);
    c.setColorRGB(255,0,255);
    }

    or

    on (release) {
    c = new Color(_root.mc_2);
    c.setColorRGB(0,0,0);
    }

    hope that helps.

View thread