A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Transforming Color over Steps

  1. #1
    Junior Member
    Join Date
    Nov 2000
    Posts
    18
    I am doing a multimedia CD for an upcoming confrence and the main informational part is set up like a web site and I trying to set up the AS so that when you click on the buttons for the different sections it will make the background image MC change colors, ie. blue tint picture to green tint.

    So far I can get the color to change by adding to each button a variation (depending on the color) of this:
    //myBackground is the target
    on (release) {
    myColor = new Color (myBackground);
    myColorTransform = new Object;
    myColorTransform = { ra: '100', rb: '50', ga: '100', gb: '40', ba: '0', bb: '-255', aa: '100', ab: '0'}
    myColor.setTransform(myColorTransform);

    }

    But what I want to do is make the color change over several steps. I am compleatly clueless on how to make it transition over steps to the new color.

    Please help.

  2. #2
    Senior Member
    Join Date
    Feb 2002
    Posts
    536
    Why don't u use a moviclip to change its colors?!

    Working with an array and a movieclip u can change "myBackground" colors

    create a new movieclip (controlColors) with 4 frames.
    1st frame
    colors = new Array('FF00CC1,'FFFF00','FF0000','0000CC')
    size = colors.length
    stop();

    4th frame
    if (x < size) {
    newColor = new Color("_root.myBackground");
    newColor.setRGB(parseInt("0x"+colors[x]));
    delete newColor;
    x++;
    gotoAndPlay(2)
    } else {
    x=0
    stop();
    delete colors;
    }

    In the main timeline u call it.
    on (release) {
    _root.controlColors.gotoAndPlay(1)
    }

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center