Use xfa.host.beep to trigger two consecutive beeps?

Seems like this should be pretty straight forward but apparently not.
I've tried various combinations, placing xfa.host.beep(1) in:
- consecutively in the click event of button;
- separately in the mouseUp and click event;
- placing xfa.host.beep into a function and calling the function twice
- calling the function then xfa.host.beep(1);
Even tried xfa.host.beep(1) in the click event of Button1 and then executing the click event of hidden Button 2, which contained xfa.host.beep(1).
Any work around suggestions? Thanks!
Brian

Hi,
You could pass in the xfa.host object so you could call the beep() method.  But in a custom dialog the setTimeOut doesn't work, so you could try looping for half a second between beeps.
function dialog()
var dialogDescriptor =
  description:
   name: "Beep Test",
   elements: [
     type: "button",
     item_id: "beep",
     name: "Beep Beep",
     type: "ok",
  beep : function(dialog)
   dialogObject.host.beep(1);
   var startTime = Date.now();
   while (Date.now() - startTime < 500) { }
   dialogObject.host.beep(1);
  validate : function(dialog)
   //add validate code here
   return true;
var dialogObject =
  execDialog: function() { return app.execDialog(dialogDescriptor); },
return dialogObject;
var d = dialog();
d.host = xfa.host;
d.execDialog();
Acrobat also has an app.beep(1) which you could use.
Regards
Bruce

Similar Messages

  • Getting rid of "Warning:  JavaScript Window" when using xfa.host.response()

    When I use xfa.host.response() I get that javascript warning. Is there a way to get rid of it?
    Thanks.

    The only way I know of to get rid of this warning is to Certify the document. Once the document has been certified, any javascript interaction either through the Dialog Manager or xfa.host.response will not have the warning.
    However, The only way to certify the document is to use Document Security Server or manually through Acrobat by adding a blank signature.
    I also dont know if this will work with Dynamic forms without breaking the certification. It worked in Static / Acrobat 6 compatible PDF's.
    Any scripting or dynamic rebuild of the form will break the certification and the message comes back.
    So basically, stick with the warning for now or else you need to make sure you revalidate the signature after EVERY piece of script using the signatureValidate() method of the AcroForm Field.

  • Xfa.host.beep

    I have a button that I want to make a Windows error sound when certain conditions are met. I've tried variations of xfa.host.beep() (e.g. xfa.host.beep("1"), xfa.host.beep("2")), but they never generate any sound. I tried both Acrobat and Reader (11.0.09) static and dynamic forms.

    Well actually, they didn't. I looked at my sound mixer (Windows 7)
    System sounds were disabled...

  • How to certificate a Form, that i can use xfa.host.importData("");?

    Hello!
    I´ve got made a Form that can import an XML Document. For this feature i use the javascript function
    xfa.host.importData(""); <-- empty String to open the OpenFileDialog
    the form works in Adobe Acrobat Reader 7.05 fine, but now i have updated my Adobe Acrobat Reader to 7.07 and nothing happend. A first look in the JavaScript Debbuger says me, that there is an security problem. So i have searched for this problem here in the forum and found an answer that this is only working with a certificated document/form.
    Is that right? I think its a bug, because why shoudt i certificate a document for Adobe Reader 7.07 and not for 7.05?
    My question is, how do i certificate the Form and what do i need to configure in the adobe reader that my document is working?

    [email protected] wrote:
    > Eva,
    >
    > While it's technically possible to attach files to an XFA-PDF form (a form designed in LiveCycle Designer (XFA) and saved as a PDF document) using Acrobat Pro, for example, it's really not recommended. An XFA form saved as a PDF document really a PDF with a thin wrapper around an XFA document. When the PDF document is opened in Designer, the PDF wrapper is discarded and therefore any annotations (such as bookmarks, attachments, comments, etc.) that you might have added to the PDF document using Acrobat are lost. Fortunately, we have a great solution for this in an upcoming release but I can't really give any details on it at the moment.
    >
    > As far as digital signatures go, I'm not really an expert in that area so I can't speak to whether attachments get signed or not. This might be a good question to post on an Acrobat Forum
    or the Reader Extension Forum
    >
    > Stefan
    > Adobe Systems
    Stefan,
    I'll have to disagree with you...I don't see the use of file attachments within an XFA form as an
    issue. Sure, the attachments will be discarded when you open them in Designer, but the purpose of
    Designer is for designing the form template, not as a client application for
    viewing/filling/distributing forms. The same could be said for form data or digital signatures...as
    soon as you open up a PDF file containing saved form data in Designer, you lose that information as
    well.
    As far as the digital signatures go...the attachments are included as part of the information
    that is signed. If you add or remove an attachment, the signature validation icon will display a
    yellow exclamation mark indicating that something in the form has changed.
    Justin Klei
    Cardinal Solutions Group
    www.cardinalsolutions.com

  • Xfa.host.gotoURL() in Adobe Reader / Dynamic Tables with AcroForms?

    Hi All,
    I have a dynamic table in my LifeCycle form. Each table row contains a button that links to an external PDF file (using xfa.host.gotoURL). The links work fine in Acrobat 8 Pro, so far, so good... But when clicking the buttons in Reader 8, nothing happens. No error message or security warning, nothing...
    I searched the web and some forums for this problem and by reading between the lines of some posts I came to guess that my LifeCycle form will not work in Adobe Reader unless I purchase the respective LifeCycle Extensions license... :-/
    What exactly are my options now? Can I get the buttons to work in Adobe Reader somehow (using JS) without having to purchase the Reader Extensions? Or can I somehow recreate the dynamic table of the LifeCycle form using AcroForms in Acrobat 8 Pro to avoid the problem? If so, how do I add such a table using Acrobat's form tools...?
    Thanks for your help,
    Marcus

    Normal http://... URLs do indeed work, but relative URLs pointing to local files do not work with the Adobe Reader on my machine. I thought this might be due to a security restriction that can only be overcome by using the Reader Extensions...?
    Is there any other way of linking to other PDFs on the local machine than the gotoURL method? I also tried launchApp(), but it didn't work either.
    I currently use this statement to link to PDFs in a subfolder:
    xfa.host.gotoURL("TrainingGuides/"
    + docName + ".pdf", 1);

  • How to Get Rid of the Unwanted Slash Appended by xfa.host.gotoURL?

    Hello LifeCycle users,
    I'm using "xfa.host.gotoURL" to call a number of URLs on the local network and I figured out that the gotoURL method automatically appends an unwanted slash to the URL. Unfortunately, with this unwanted slash the last parameter in my URLs does not work.
    For example, I call an URL like this:
    xfa.host.gotoURL(http://myhost?param1=NO&param2=YES&
    param3=YES, 0);
    The URL passed to the browser seems to be:
    http://myhost?param1=NO&param2=YES&param3=YES/
    causing "param3" to not work anymore. Only "param1" and "param2" are evaluated on "myhost".
    Is there any workaround (except adding a dummy parameter after "param3") for this?
    Thanks,
    Marcus

    You should post your question in the Forum Comments forum,
    http://forums.adobe.com/index.jspa?view=discussions

  • Xfa.host.setFocus(); beep problem

    xfa.host.setFocus(Expand); is placed under text field. when cursore goes into the "expand" field, a beep is created.
    How can I stop it?

    To be more precise what stephen said,
    Go to your volume properities and change the settings for ALERTS, WARNINGS and other options.
    This will be stopped for sure.
    Thanks
    Pravee

  • Xfa.host.gotoURL : Mixed results using Acrobat Pro

    In my form, I've got a button that executes an xfa.host.gotoURL on the value of another field, which has a url (www.aetna.com). When you click the button, it simply executes:
    xfa.host.gotoURL(WebAddress.rawValue);
    It works fine in both designer and Reader, but in Acrobat Pro, it doesnt do anything. No errors, no status boxes, nothing. Has anyone else seen or experienced anything like this? Is there another way to popup a window/navigate to a website other than xfa.host.gotoURL?

    When you use Acrobat as a stand alone application, you will get this behavior.I think what happended is when you try to open a web page, HTML is being sent to Acrobat and it does not know what to do with it. If you want this to work to view the page you will have to use Acrobat inside of a browser. Now the browser recieves the HTML and knows how to interpret it.

  • How to change appearance of xfa.host.messagebox

        Is there anyway to apply a different look to the xfa.host.messagebox ?  It is pretty, um what is the word ..... -- ugly. That is the word
    Any help would be very appreciated.
    Thanks

    Hi,
    The url that Steve gave above takes you to the Help file for LC Designer.
    You put the messageBox line within your script when you want to alert the user to something or to give them a choice. for example you could put the script within a calculate event to let the user know the value of a hidden variable:
    xfa.host.messageBox("This is a message", "This is a title", 3, 1);
    The help file sets out the four different options for the last two parameters (which can be used in any combination).
    xfa.host.messageBox("This messageBox uses:\n\nParameter 3 = 1 (Warning) and Parameter 4 = 1 (OK, Cancel)", "Hello World!", 1, 1);
    The "\n" will insert a return (new line).
    Scripting for additional features within a dialogue window can be achieved using the Javascript Dialog Object; however this is getting quite advanced. The AcroDialog product from Windjack Solutions does make this process easier.
    The messageBox returns a number depending on which button the user clicks:
    Returns 1 if the user clicks OK;
    Returns 2 if the user clicks Cancel;
    Returns 3 if the user clicks No;
    Returns 4 if the user clicks Yes;
    On this basis you can script actions depending on which button the user clicks in your messageBox, by asigning the returning value to a variable and then looking at the value of the variable. For example in the click event of a button on the form:
    var nButton = xfa.host.messageBox("You are about to delete this row.\n\nDo you want to continue?", "DELETE ROW", 3, 2);
    if (nButton == 4) // Hitting the Yes button returns 4
         _dyndetail.removeInstance(this.parent.index); // proceed with delete
    The above deals with LiveCycle Designer. If you are scripting exclusively in Acrobat then you could use the app.alert(); method, to display your message.
    Hope this helps,
    Niall

  • Xfa.host.messageBox

    I am trying to get a message to appear if someone tries to enter enter data in a drop down list before entering in formation in a previous list.  I have two drop down lists: ServiceType[0] and Action[0]. I have this code set up in the change event:
    topmostSubform.Page2.Action[0]::change - (JavaScript, client)
     if  (topmostSubform.Page2.ServiceType[0].rawValue == null){
    xfa.host.messageBox("You must select a Service Type Value"
    , "Error", 3, 1);}
    When I select something from the Action[0] list, nothing happens when I have not selected anything in the ServiceType[0] list. What am I missing please?

    Hm,
    generally your scripts look fine.
    But, JavaScript does not support the instance accessor [0] you used, only FormCalc does.
    To use them in JavaScript you need the xfa.resolveNode method like xfa.resolveNode(" topmostSubform.Page2.ServiceType[0]").
    Also, to resolve the first instance of an object, which has always the accessor [0], you don't need to describe the accessor.
    So topmostSubform.Page2.ServiceType is the same as topmostSubform.Page2.ServiceType[0]
    Just a hint for your script in JavaScript.
    if (xfa.resolveNode("topmostSubform.Page2.ServiceType").rawValue == "" || xfa.resolveNode("topmostSubform.Page2.ServiceType").rawValue == null) then
         xfa.host.messageBox("You must select a Service Type Value", "Error", 3, 0)
         xfa.host.setFocus("topmostSubform.Page2.ServiceType")
         xfa.event.change = ""
    or in FormCalc.
    if (topmostSubform.Page2.ServiceType.rawValue == "" or topmostSubform.Page2.ServiceType.rawValue == null) then
         xfa.host.messageBox("You must select a Service Type Value", "Error", 3, 0)
         xfa.host.setFocus("topmostSubform.Page2.ServiceType")
         xfa.event.change = ""
    endif

  • How can I use the same "I Tunes" on two different computers

    I’m using two different kinds of Personal Computer: One is Desktop PC And the other one is Notebook .
    In each computer there are the same songs and when I get the new ones to the Desktop I want them to be placed on the Notebook or reverse.
    Where does the I Tunes save the playlist on the hard drive ?
    I have prepared a playlist on my Notebook and want it to be seen on the Desktop but I dont want to fallow the steps File > Library > Export Playlist on the Notebook. Is there any other way to make this issue instead of the mentioned steps.
    How can I see the same Playlists and songs on two different computers ( notebook and desktop) including the updating processes.
    Operating systems of the computers:
    Desktop: XP Pro
    Notebook: Vista Bussiness

    I use SyncToy 2.0 to keep two instances of my library in sync. SyncToy's preview will show which files it is about to update giving you a chance to spot unexpected changes and during the run only the changed files will be copied saving lots of time.
    As long as I sync after making updates at one instance of the library before making any updates at the other then everything works just fine. I periodically run iTunes Folder Watch to check for any orphaned entries or new items that haven't been imported into the active library. If your machines are regularly networked together this process is fairly straightfoward. Mine are in disparate locations so I use one of the (physically) small WD My Passport host powered drives which I take between home & work, synchronising at either end. This gives me three complete copies of my library so I'm covering backup & synchronisation in the same operation.
    When connecting my iPod at either location iTunes recognises itself as the "home" library for the iPod so I'm able to use the sync with selected playlists option without getting warning messages about the iPod being synced with a different library.
    tt2

  • Use one fpga vi to control two targets

    Hi,
    I have two fpga because I need more than 8 analogue output and analogue input.  I wonder if I can use one fpga vi to control two targets (the two FPGA boards I use are PCI-7833R) so that the outputs can be synchronized.  I think if it's possible it'll be easier to implement the synchronization between while loops,etc.  If it's not possible, how can I interface between between fpga.vi and make the synchronization possible and make two vi's talk to each other?  Thank you very much for your help!
    Thanks,
    Charles

    I have successfully ran the same code on two (2) different FPGA boards. The difference being that the host will use different Aliases to control the FPGA boards,
    Both FPGA Boards MUST be the same type ( I used PXI-7811s). 
    My program consisted of 6 individual communication portals and there was NO synchronization between boards
    Visualize the Solution
    CLA
    LabVIEW, LabVIEW FPGA

  • Is there any way to run a timer on the presentation screen during two consecutive presentations?

    I administer exams that require running two consecutive presentations and interact with the person being tested. With each candidate we use two different presentations, so I can't just make only one presentation.  Is there a way to have a timer display on the presentation screen through both presentations? Each person only has thirty minutes to get thru both presentations. If one only takes ten minutes, then they have twenty for the final one. I'd like to get away from using egg timers.

    take a look at this thread, you can find some useful info about running old and some new games on Booklet there.

  • Help needed in receiving  two consecutive msges from SIP Ser in UDP server!

    Hi everyone,
    I am Mitul Gogoi,from Assam,North-east part of India.
    I am writing a SIP proxy server,which is simly a UDP server and which will sit between the Client(X-Lite softphone) and Brekeke SIP Server and just receive and send messages.
    Client---------------->My UDP Server-------------------------->SIP Server (This is for requests)
    again,
    SIP Server---------->My UDP Server-------------------------->Client (This is for responses)
    (couldnot draw the arrows together)
    My server will receive any msg coming from Client in port 7000 from Client and My server will send the msg to SIP Server to its IP address and port 5060.So, I just wanted to change the port number to which Client will send msges;i.e. instead of earlier port 5060,it will now send to port 7000.
    The msg sending and receiving scenerio:
    1.The first msg from Client is received by My Server.
    2.My server sends the msg to SIP Server.
    3.My server then waits for response from SIP server.
    4.One msg comes to My server and received successfully. and it closes the socket.
    5.This msg is sent to Client.
    6.Second msg comes from SIP server to My server.But My server is unable to receive this second msg.maybe because My server closes the socket to receive the next msg.
    I am using ResponseHandler Thread in main which will listen to any msges that may come from SIP server to My server.
    My question is :
    Is it not possible to receive two consecutive msg from SIP server ?
    If one msg comes,it then closes the socket.
    My code for sending and receiving :
    udpClSocket = new DatagramSocket();
    packet = new DatagramPacket(buf, buf.length,InetAddress.getByName(server), port);
    udpClSocket.send(packet);//it will send to SIP Server as well as Client,by changing the server and port
    byte resbuf[] = new byte[msgSize];
    packet = new DatagramPacket(resbuf, resbuf.length);
    udpClSocket.receive(packet);//it will receive msg from SIP server only
    packet = null;
    udpClSocket.close();
    The first msg comes to My server successfully,but the second msg is not being received.
    I have tried in so many ways,such as taking two different ports :one for receiving for Client and My server ,and another port for My server and SIP server.
    If anyone can help me in this ,then I will be highly grateful.
    regards,
    Mitul

    Why? Throw all this code away, and use the NIST reference implementation of JAIN-SIP. They've done all the hard work for you. All you have to do to write a stateless proxy is a little mild header processing.
    Thank you ejp for your reply.Mine is a Outbound SIP proxy server,which uses a port other than default 5060 SIP server port.The client will REGISTER SIP server via my server.and moreover,I want to build my own server at least once for learning purpose.
    maybe because My server closes the socket to receive the next msg.
    Why?
    I donot know why.may be I am very new to network programming or did not do much research in networking.But,my code should work;couldn't find out any fault.
    Here is my code:
    package com.ef;
    import java.net.DatagramPacket;
    import java.net.DatagramSocket;
    import java.net.InetAddress;
    import java.util.Date;
    * It sends UDP packets to following destinations-
    * 1. SIP Server
    * 2. SIP UACs
    public class OBUDPClient extends Thread {
         private DatagramSocket udpClSocket;
         private DatagramPacket packet;
         private String server = "192.168.1.2";//IP of Brekeke SIP server
         private int port = 5060;
    //SIP Message Size
         private int msgSize = 2048;
         private byte buf[];
         private boolean serFlag = true;
         private OBMessage m;
         * Send Request to SIP Server
         * @param in_packet
         * @throws Exception
         public OBUDPClient(DatagramPacket in_packet) throws Exception{
              super("Client-"+String.valueOf((new Date()).getTime()));
              this.buf = in_packet.getData();
              m = new OBMessage();
              * Keep track of IP and Port of the source of this packet. Response
              * from SIP Server will be redirected to this IP and Port
              m.setTargetIP(in_packet.getAddress().getHostAddress());
              m.setTargetPort(in_packet.getPort());
              start();
         * Send Request to SIP UAC (). This constructor gets call from OBResponseHandler.java
         * @param server
         * @param port
         * @param buf
         * @throws Exception
         public OBUDPClient(String server, int port, byte buf[]) throws Exception{
              super(String.valueOf((new Date()).getTime()));
              this.server = server;
              this.port = port;
              this.buf = buf;
              serFlag = false;
              start();
         public void run(){
              try{
              System.out.println("OBUDPClient Redirecting packet");
              udpClSocket = new DatagramSocket();
              //Send Request
              packet = new DatagramPacket(buf, buf.length,InetAddress.getByName(server), port);
              udpClSocket.send(packet);
              //Receive Response
              byte resbuf[] = new byte[msgSize];
              packet = new DatagramPacket(resbuf, resbuf.length);
              udpClSocket.receive(packet); //could not receive two consecutive msg from SIP server
              if(serFlag){
              * If request is sent to SIP Server we are interested for the
              * response otherwise not
              System.out.println("<----------------Handle Response----------------->");
         System.out.println("++++++++++++++++++++++++++++++++++++++++++++++++++");
         System.out.println("Response from SIP Server: "+new String(packet.getData()).trim());
         System.out.println("++++++++++++++++++++++++++++++++++++++++++++++++++");
         //Read SIP reseponse sent by SIP Server
         m.setMessage(new String(packet.getData()).trim());
         //Store the Response message in Queue
         OBMain.q.push(m);
         }catch(Exception ex){
         ex.printStackTrace();
         packet = null;
         udpClSocket.close();
    Note:Everything starts from the Client.First,Client makes a REGISTER request;it is passed through Outbound server to SIP server.Then,SIP server responds with 100 Trying;this is received successfully by my outbound server and sent to Client.Then,again,SIP server responds with 200 OK;this is not received by my outbound server;hence cannot reach Client,as a result of which Registration fails.
    regards,
    mitul

  • Xfa.host.SetFocus question.

    I have a code on Exit event of the field that checks if 5 digit US ZIP code, 5 digit US ZIP code + 4, and 6 digit alphanumeric Canadian Postal Code.
    If user enters valid 5 digits code, then I set focus to specific field-FField1. Code is simple and it works. What does not work is, if I tab out , without entering anyting in the Zip code, the focus is set to some other field, not FField1. How can I force it with the code that focus is set to FField1 all the time.
    Code is simple:
    var regExpDate = /^\^\d{5}-\d{4}|\d{5}|[A-Z]\d[A-Z] \d[A-Z]\d$ $/;
    var vMatched = this.rawValue.match(regExpDate);
    if (!vMatched){
    this.rawValue=null;
    xfa.host.messageBox("Enter the following format: 99999 or 99999-9999 or A9A 9A9 );
    xfa.host.setFocus(this);
    else
    xfa.host.setFocus(form1.subform1.FField1);

    Hi again 1996,
    You can use setFocus multiple times in the exit event, and the last one that is called is where you end up. I would suggest putting the 'default' tab before all of your logic, to ensure that it's the one that gets called when the field is valid:
    i.e.:
    xfa.host.setFocus(form1.subform1.FField1);
    var regExpDate = /^\^\d{5}-\d{4}|\d{5}|[A-Z]\d[A-Z] \d[A-Z]\d$ $/;
    var vMatched = this.rawValue.match(regExpDate);
    if (!vMatched){
    this.rawValue=null;
    xfa.host.messageBox("Enter the following format: 99999 or 99999-9999 or A9A 9A9 );
    xfa.host.setFocus(this);
    This way, unless vMatched is true and the second setFocus is called to override the first, your user should always be sent to FField1.
    I know that this isn't a part of your question, but I'd like to suggest avoiding the 'thou shalt not pass until...' situations. What if your user doesn't know the postal/zip code, and wants to fill in the rest of the form before finding it? They could enter dummy data to get past your requirement, but then there's a chance that they'll forget to replace it with the real value. Altogether, I think it's better to check for invalid data in the pre-save/pre-submit events, and warn them of the required fields then.
    Also, consider only calling setFocus for when the user is tabbing away from fields. If you manually call setFocus to control the tab order from all fields (I do this for all of my forms, as I find that dynamic forms don't play nice with the tab order) then use:
    if (xfa.event.commitKey == 3) then
         xfa.host.setFocus("$.parent.NextFieldName");
    endif
    This way, if the user clicks on another field that they want to fill next, they won't be redirected to the one you chose for them.
    Sorry for the unsolicited advice... These were just some of the things that I've had to deal with in the past.
    - Scott

Maybe you are looking for