1 Reply Latest reply on Nov 27, 2006 5:24 PM by noviceone

    Navigation status

    noviceone
      I have several movie buttons. The active button is to have a different color to let the user know where he is currently on the site. Sounds easy right?

      I tried this:

      var activeButton:String;

      buttonOne.onRelease = function():Void
      {
      [activeButton]button_txt.setTextFormat(normalButton_fmt); //reset previous button to normal look - failure
      activeButton = this; //need this to control what button is active (orange) - success
      this.button_txt.setTextFormat(activeButton_fmt); //set text to orange...success

      <do something>
      }

      activeButton doesn't work. Is it because I data typed it as a string instead of a movieClip? Does anyone have any example of how they do this? I'm sure there is an easier way.


        • 1. Re: Navigation status
          noviceone Level 1
          Here is the fix:

          first, declare activeButton as a movieclip instead of a string

          var activeButton:MovieClip;
          Then make the following BOLD changes:

          buttonOne.onRelease = function():Void {
          this_parent[activeButton. _name].button_txt.setTextFormat(normalButton_fmt);
          activeButton = this;
          this.button_txt.setTextFormat(activeButton_fmt);

          <do something>