4 Replies Latest reply on Mar 29, 2011 12:26 PM by jbe2011

    Toggleing OCGs with buttons



      I am trying to toggle the visiblity of certain layers/OCGs with the pushing of a button. I imported a drawing from AutoCAD into acrobat and want to be able to shut certain parts of the drawing on and off using the radio buttons. I thought i had it working but when i came back in this moring the buttons no longer work. The script in the MouseUp i was using is:


      var ocg = FindOCG("1900 COMBO");
      ocg.state = on;


      var ocg = FindOCG("11B COMBO");
      ocg.state = false;


      var ocg = FindOCG("1900 D COMBO");
      ocg.state = false;


      where "1900 COMBO", "11B COMBO" and "1900 D COMBO" are the imported layer names from AutoCAD.


      I am very new to the scripting so I really dont know whats wrong. The debugger is telling me

      TypeError: ocg is undefined


      I may be doing this completely wrong for all i know......Any help would be greatly appreciated.