7 Replies Latest reply on Aug 2, 2007 12:36 PM by _name

    Arrays & MovieClip Buttons

    loudgreenideas
      I have a scene that has 10 buttons that I would like to have the following behavior:

      1. onRollOver, button border highlights
      2. onRollOut, button returns to default appearance
      3. onRelease, button text bolds and remains that way until another button is pressed
      4. With an onRelease event, I would also like to set a single variable to an integer. This will be input for a second animation sequence.

      And I want the first button to start out as if it were already pressed.

      I have built this with an Array of MovieClip buttons. Each movieclip has _up, _over, _down states. I've used an Array to eliminate the need to copy the same event handling code 10 times.

      I have behaviors #1 & 2 finished. However, behaviors #3 & 4 are giving me a headache. I can get the "_down" state to stick only as long as I don't RollOver any other button. In addition, I can't get the variable ("pressed") to take any value other than 10 (which is clearly the end of the for loop).

      Any recommendations on how to proceed, or how to do this more elegantly, would be greatly appreciated.

      Here's the relevant code: