2 Replies Latest reply on Aug 5, 2009 11:16 AM by mmrm

    f.setAction problem

    mmrm Level 1

      I am trying to create a button like this:

       

      app.addMenuItem({ cName: "Add Home Terrirtory to IO", cParent:"Tools", cExec:" AddHT()"});

      function AddHT() {var size = this.getPageBox("Art");

      if ((size[0] == 0) & (size[1] == 792) & (size[2] == 612) & (size[3] == 0))

      {

      var inch = 72; for (var p = 0; p < this.numPages; p++)

      {var aRect = this.getPageBox( {nPage: p} );

      var aRect = this.getPageBox( {nPage: p} );

      aRect[0] += 5.31*inch;

      aRect[2] = aRect[0] +.49*inch;

      aRect[1] -= 1.05*inch;

      aRect[3] = aRect[1] - 30;

       

      var f = this.addField("Home Territory", "button", p, aRect );

      f.setAction("MouseUp", "var buttonState = event.target.buttonGetCaption() == ""; event.target.buttonSetCaption(buttonState ? "O" : "");");

      f.borderStyle = border.s;

      f.highlight = "push";

      f.textSize = 28;

      f.textColor = color.black;

      f.textFont = "Futura-Light";

      }}

      };

       

       

      but I keep getting an error.

       

      missing ) after argument list

      1:Console:Exec

      undefined

       

      I think I've narrowed it down to me action but I don't know what's wrong.  If I manually paste the action text into the button options it works just fine.