A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Problems with changing colors of buttons.

  1. #1
    Junior Member
    Join Date
    Jul 2000
    Posts
    17

    Problems with changing colors of buttons.

    Hi,

    I’m working on a menu that has to change the color of a button (a movieclip with a invisible button on it), when you move your mouse over it. Next to that, when you click a certain button, the color has to change, and the button must become inactive, till another button is clicked.

    The “mouseOver’s” work, but the I can’t make the button change till another button is clicked. For this I use the following code on a keyframe:

    Code:
    stop();
    //change the color of button 1, and make it inactive
    _root.button1.button._visible = false;
    _root.button1.tekstkader.textColor = 0xFFFFFF;
    var kleur1 = new Color("_root.button1.witvlak");
    kleur1.setRGB(0x000000);
    // turn back to original state: button 2, and make it active
    _root.button2.button._visible = true;
    _root.button2.tekstkader.textColor = 0x000000;
    var kleur2 = new Color("_root.button2.witvlak");
    kleur2.setRGB(0xFFFFFF);
    Can anyone tell me what I am doing wrong? Because the code above don’t work. I will add a fla, to make the problem more clear.

    Thanks,
    Jef
    Attached Files Attached Files
    Last edited by jef; 07-13-2005 at 04:07 AM.

  2. #2
    Junior Member
    Join Date
    Jul 2000
    Posts
    17
    I am using another code to make the menu I described work. It is a function that I call, everytime a button is clicked. I want the button become inactive (make the transparant button on th movieclip invisible) color of the text on the button to change, but the last doesn't work.
    Code:
    function VeranderMenu(button) {
         for (x=1; x<6; x++) {
              if (x != button) {
                   _root["button"+x].button._visible = true;
                   _root["button"+x].tekstkader.textColor = 0x000000;
              } else {
                   _root["button"+x].button._visible = false;
                   _root["button"+x].tekstkader.textColor = 0xFFFFFF;
              }
         }
    }
    the action I use on the button:

    Code:
    on (release) {
         _root.VeranderMenu(1);
    }
    I will also add the new fla

    Can anyone tell me how to make the text on the button change color, when it is clicked?
    Attached Files Attached Files
    Last edited by jef; 07-13-2005 at 09:19 AM.

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