0 Replies Latest reply on Nov 4, 2009 2:39 PM by b_davey311

    AS2 Navigation button indicator help

    b_davey311

      Hi all,

      I'm using this code below to basically toggle the buttons to indicate what page it is you are on in a flash website.  ANd if another button is clicked on - the previous button one will animate out and the newly clicked button will be highlighted.  Now this current code works and all but I'm not able to select the indicated button again to load up the same content if the user so chooses to do so. 95% of the time i wouldn't need this functionality but unfortunately need it this time. Help please?

      Here is the code:
      [CODE]var selectedButton:MovieClip;

      function toggleButtons(btn:MovieClip):Void {
      if (selectedButton) {
      selectedButton.gotoAndPlay("Out");
      selectedButton.enabled = true;
      }
      btn.enabled = false;
      selectedButton = btn;
      }[/CODE]

      Here is the onRelease code calling the toggleButtons:
      [CODE]item_mc.onRelease = function() {
      toggleButtons(this);
      loadMovieNum(this.btnMC.fileLocation.concat('.swf'), 10);
      };[/CODE]

      And finally the buttonClass I use to attach the Over and OUt actionscript (here if necessary):
      [CODE]class ButtonClass extends MovieClip{
      public function ButtonClass(){
      this.onRollOver = this.Over;
      this.onRollOut = this.Out;
      this.onReleaseOutside = this.Out;
      }
      private function Over(){
      this.gotoAndPlay("Over");
      }
      private function Out(){
      this.gotoAndPlay("Out");
      }
      }[/CODE]

      Little help and thanks in advance!