0 Replies Latest reply on May 6, 2009 6:43 AM by subieguy2

    Hiding Buttons

    subieguy2 Level 1

      I have some script at the document level that creates several buttons and names them. It also calls my function which is located at the document level in another script. The function sends the user to the appropriate destination/view. Then turns off the proper layers. The only thing I can't figure out is how to get it to hide some of the buttons on the page that you go to.

       

      So referring to my script below when I click on button "001_callout" the function goes to a destination "view_01" and turns off all of the layers except for "Callout 1" and "Paste 1st (Data)". So all 3 buttons "001_callout", "002_callout", "003_callout" are on the same page/at the same destination. So clicking on button "001_callout" I want it to also HIDE the other buttons on the page "002_callout", "003_callout".

       

      // Button creation and assign the function to call

      // 001_callout
      var c001 = this.addField("001_callout");
      c001.setAction("MouseUp", "this.calloutOne();");

       

      // 002_callout
      var c001 = this.addField("002_callout");
      c001.setAction("MouseUp", "this.calloutTwo();");

       

      // 003_callout
      var c001 = this.addField("003_callout");
      c001.setAction("MouseUp", "this.calloutThree();");

       

       

       

      // Function for CALLOUT 1
      function calloutOne(){
      this.gotoNamedDest('view_01');

       

      var Callout = "Callout 1";
      var PasteFirst = "Paste 1st (Data)";
      var ocgArray = this.getOCGs(this.pageNum);
      for ( var i=0; i < ocgArray.length; i++) {
      if ( ocgArray[i].name == Callout ) {
      ocgArray[i].state = true;
      }
      else ocgArray[i].state = false;
      }

       

      for ( var z=0; z < ocgArray.length; z++) {
      if ( ocgArray[z].name == PasteFirst ) {
      ocgArray[z].state = true;
      }
      }
      }

       

       

      // Function for CALLOUT 2
      function calloutOne(){
      this.gotoNamedDest('view_01');

       

      var Callout = "Callout 2";
      var PasteFirst = "Paste 1st (Data)";
      var ocgArray = this.getOCGs(this.pageNum);
      for ( var i=0; i < ocgArray.length; i++) {
      if ( ocgArray[i].name == Callout ) {
      ocgArray[i].state = true;
      }
      else ocgArray[i].state = false;
      }

       

      for ( var z=0; z < ocgArray.length; z++) {
      if ( ocgArray[z].name == PasteFirst ) {
      ocgArray[z].state = true;
      }
      }
      }

       

       

      // Function for CALLOUT 3
      function calloutOne(){
      this.gotoNamedDest('view_01');

       

      var Callout = "Callout 3";
      var PasteFirst = "Paste 1st (Data)";
      var ocgArray = this.getOCGs(this.pageNum);
      for ( var i=0; i < ocgArray.length; i++) {
      if ( ocgArray[i].name == Callout ) {
      ocgArray[i].state = true;
      }
      else ocgArray[i].state = false;
      }

       

      for ( var z=0; z < ocgArray.length; z++) {
      if ( ocgArray[z].name == PasteFirst ) {
      ocgArray[z].state = true;
      }
      }
      }