Variable are carried over from one function to the other?

I have a button that runs a check before triggering a function submitMe(), that I created a mouseUp event.  During this audit, var aResult is defined.  SubmitMe() triggers then, this.mailDoc with aResult in the body.

It works very well, which shows that a variable defined in a mouseUp event is passed to a function I created.

So I decided to pass the audit at the level of the document in function creation verifyMe() and activation as before with the same mouseUp event.

But now, during the submitMe() console tells me that aResult isn't code.

The question is therefore, change something that submitMe() is now a function inside a function and it does not prevent aResult to postpone?

function verifyMe()

{

var aResult = aDefault.join("\n\t");

If (aResult! = "") {}
var cResponse = app.alert (ermsg + "\t" + aResult + "\n\n" + "Dou you want to submit?")
If (cResponse == '4') {}

submitMe();

}

}

}

Since the app.alert is triggered and displays the correct result, aResult is defined!

function submitMe()
{
Variables
var Sub = this.getField("OPE028.1.EVEN.NO").value;
var emailSij = "xxxx@xxxx";
var emailMat = "xxxx@xxxxx";
cbody var = "* test * \r\t"+ aResult;»

this.mailDoc ({bUI: false, cTo: emailSij, bCc: emailMat, bassujetti: Sub, CMSG: cbody});

this.closeDoc (true);
}

Of course you can. You can find more details here: http://www.w3schools.com/js/js_functions.asp

or with any other decent JavaScript reference.

Tags: Acrobat

Similar Questions

  • How to pass values from one function to the other

    Hello

    I am a school teacher and a beginner in Flash Actionscript. I am creating a countdown for use in my classroom during testing. The beginning and break according to need, but not the pause button functions. When I click on the pause button, the timer is reset to 0:00:00. Help, please. Here is the code that I had written so far:

    var Subject1timeLeftHr;

    var Subject1timeLeftMin;

    var Subject1timeLeftSec;

    Subject1start_btn._visible = true;

    Subject1pause_btn._visible = false;

    Subject1rotor_mc.gotoAndStop (1);

    Subject1rotor_mc._visible = false;

    Subject1durationHr_txt. Text = "0";

    Subject1durationMin_txt. Text = "00";

    Subject1durationSec_txt. Text = "00";

    Selection.setFocus (Subject1durationHr_txt);

    function SubjectdurationHr (SubjectxdurationHr_txt, SubjectxdurationMin_txt)

    {

    if (SubjectxdurationHr_txt.length == 1)

    {

    Selection.setFocus (SubjectxdurationMin_txt);

    }

    }

    function SubjectdurationMin (SubjectxdurationMin_txt, SubjectxdurationSec_txt)

    {

    if (SubjectxdurationMin_txt.length == 2)

    {

    Selection.setFocus (SubjectxdurationSec_txt);

    }

    }

    function SubjectdurationSec (SubjectxdurationSec_txt, SubjectxdurationHr_txt)

    {

    if (SubjectxdurationSec_txt.length == 2)

    {

    Selection.setFocus (SubjectxdurationHr_txt);

    }

    }

    Subject1durationHr_txt. OnChanged = function()

    {

    SubjectdurationHr (Subject1durationHr_txt, Subject1durationMin_txt);

    };

    Subject1durationMin_txt. OnChanged = function()

    {

    SubjectdurationMin (Subject1durationMin_txt, Subject1durationSec_txt);

    };

    Subject1durationSec_txt. OnChanged = function()

    {

    SubjectdurationSec (Subject1durationSec_txt, Subject1durationHr_txt);

    };

    function startcountdown (SubjectxdurationLeft, SubjectxdurationHr, SubjectxdurationHr_txt, SubjectxdurationMin, SubjectxdurationMin_txt, SubjectxdurationSec, SubjectxdurationSec_txt, Subjectxduration, SubjectxstartTime, SubjectxendTime, Subjectxtimer_mc, Subjectxpause_btn, Subjectxstart_btn, Subjectxrotor_mc, SubjectxtimeLeft, SubjectxtimeLeftHr, SubjectxtimeLeftMin, SubjectxtimeLeftSec, SubjectxtimeLeftHr_txt, SubjectxtimeLeftMin_txt, SubjectxtimeLeftSec_txt)

    {

    delete SubjectxdurationLeft;

    delete SubjectxdurationHr;

    delete SubjectxdurationMin;

    delete SubjectxdurationSec;

    delete Subjectxduration;

    delete SubjectxdurationHr_txt.text;

    delete SubjectxdurationMin_txt.text;

    delete SubjectxdurationSec_txt.text;

    SubjectxstartTime = getTimer();

    Subjectxtimer_mc.onEnterFrame = function()

    {

    if (SubjectxdurationHr_txt.text == Nan |) SubjectxdurationMin_txt.text == Nan | SubjectxdurationSec_txt.text is Nan)

    {

    }

    else

    {

    SubjectxdurationHr = 60 * 60 * 1000 * Number (SubjectxdurationHr_txt.text).

    SubjectxdurationMin = 60 * 1000 * Number (SubjectxdurationMin_txt.text).

    SubjectxdurationSec = 1000 * Number (SubjectxdurationSec_txt.text).

    Subjectxduration = SubjectxdurationHr + SubjectxdurationMin + SubjectxdurationSec;

    SubjectxendTime = SubjectxstartTime + Subjectxduration;

    SubjectxdurationLeft = SubjectxendTime - getTimer();

    if (SubjectxdurationLeft > 0)

    {

    SubjectxdurationHr_txt._visible = false;

    SubjectxdurationMin_txt._visible = false;

    SubjectxdurationSec_txt._visible = false;

    Subjectxpause_btn._visible = true;

    Subjectxstart_btn._visible = false;

    Subjectxrotor_mc._visible = true;

    Subjectxrotor_mc.play ();

    SubjectxtimeLeft = SubjectxdurationLeft / (1000 * 60 * 60);

    SubjectxtimeLeftHr = Math.floor (SubjectxtimeLeft);

    SubjectxtimeLeftMin = Math.floor ((SubjectxtimeLeft-SubjectxtimeLeftHr) * 60);

    SubjectxtimeLeftSec = Math.floor (((SubjectxtimeLeft-SubjectxtimeLeftHr) * 60 - SubjectxtimeLeftMin) * 60);

    SubjectxtimeLeftHr_txt.text = String (SubjectxtimeLeftHr);

    if (SubjectxtimeLeftHr_txt.length < 1)

    {

    SubjectxtimeLeftHr_txt.text = '0' + SubjectxtimeLeftHr_txt.text;

    }

    SubjectxtimeLeftMin_txt.text = String (SubjectxtimeLeftMin);

    if (SubjectxtimeLeftMin_txt.length < 2)

    {

    SubjectxtimeLeftMin_txt.text = '0' + SubjectxtimeLeftMin_txt.text;

    }

    SubjectxtimeLeftSec_txt.text = String (SubjectxtimeLeftSec);

    if (SubjectxtimeLeftSec_txt.length < 2)

    {

    SubjectxtimeLeftSec_txt.text = '0' + SubjectxtimeLeftSec_txt.text;

    }

    }

    else

    {

    delete Subjectxtimer_mc.onEnterFrame;

    SubjectxtimeLeftHr_txt.text = "";

    SubjectxtimeLeftMin_txt.text = "";

    SubjectxtimeLeftSec_txt.text = "";

    SubjectxdurationHr_txt._visible = true;

    SubjectxdurationMin_txt._visible = true;

    SubjectxdurationSec_txt._visible = true;

    Subjectxrotor_mc.gotoAndStop (1);

    Subjectxrotor_mc._visible = false;

    SubjectxdurationHr_txt.text = '0 '.

    SubjectxdurationMin_txt.text = "00";

    SubjectxdurationSec_txt.text = "00";

    Subjectxpause_btn._visible = false;

    Subjectxstart_btn._visible = true;

    Selection.setFocus (SubjectxdurationHr_txt);

    }

    }

    };

    }

    function pausecountdown (SubjectxdurationHr_txt, SubjectxtimeLeftHr, SubjectxdurationMin_txt, SubjectxtimeLeftMin, SubjectxdurationSec_txt, SubjectxtimeLeftSec, Subjectxstart_btn, Subjectxpause_btn, Subjectxrotor_mc)

    {

    delete Subjectxtimer_mc.onEnterFrame;

    SubjectxdurationHr_txt.text = String (SubjectxtimeLeftHr);

    SubjectxdurationMin_txt.text = String (SubjectxtimeLeftMin);

    SubjectxdurationSec_txt.text = String (SubjectxtimeLeftSec);

    Subjectxstart_btn._visible = true;

    Subjectxpause_btn._visible = false;

    Subjectxrotor_mc.stop ();

    }

    Subject1pause_btn.onRelease = function()

    {

    pausecountdown (Subject1durationHr_txt, Subject1timeLeftHr, Subject1durationMin_txt, Subject1t, imeLeftMin, Subject1durationSec_txt, Subject1timeLeftSec, Subject1start_btn, Subject1pause_btn, Subject1rotor_mc);

    };

    Subject1start_btn.onRelease = function()

    {

    startcountdown (Subject1durationLeft, Subject1durationHr, Subject1durationHr_txt, Subject1dura, tionMin, Subject1durationMin_txt, Subject1durationSec, Subject1durationSec_txt, Subject1durati, Subject1startTime, Subject1endTime, Subject1timer_mc, Subject1pause_btn, Subject1start_btn, Subject1rotor_mc, Subject1timeLeft, Subject1timeLeftHr, Subject1timeLeftMin, Subject1timeLeftS ec, Subject1timeLeftHr_txt, Subject1timeLeftMin_txt, Subject1timeLeftSec_txt);

    };

    Subject1cancel_btn.onRelease = function()

    {

    Subject1timeLeftHr_txt.text = "";

    Subject1timeLeftMin_txt.text = "";

    Subject1timeLeftSec_txt.text = "";

    Subject1durationHr_txt._visible = true;

    Subject1durationMin_txt._visible = true;

    Subject1durationSec_txt._visible = true;

    Subject1durationHr_txt.text = '0 '.

    Subject1durationMin_txt.text = "00";

    Subject1durationSec_txt.text = "00";

    Subject1timeLeftHr_txt._visible = true;

    Subject1timeLeftMin_txt._visible = true;

    Subject1timeLeftSec_txt._visible = true;

    Subject1pause_btn._visible = false;

    Subject1start_btn._visible = true;

    Subject1rotor_mc._visible = false;

    Subject1rotor_mc.gotoAndStop (1);

    delete Subject1timer_mc.onEnterFrame;

    delete Subject1durationLeft;

    delete Subject1duration;

    delete Subject1durationHr_txt.text;

    delete Subject1durationMin_txt.text;

    delete Subject1durationSec_txt.text;

    };

    I think you need to spend time by reducing your code at a practical level.  You seem to be any passage in the book in each function and I think that probably none of this is necessary.  If you have declared these variables at the beginning, then you don't need to transfer them to any function, because they are gobally available to one of the functions/code that follows.  Similarly, if you have some textfields on stage, it is pointless to pass those in all functions for the same reason.

    I see you doing the overuse of 'delete' (and possibly errant use as well).  Is probably the only thing you might want or need to use...

    delete Subjectxtimer_mc.onEnterFrame;

    Which stops the enterframe trigger activity, which I think is used to update the textfields which indicate the time.

    And that conditional uses == Nan is not likely to do anything except wonder what is a Nan.  TextFields hold the strings, which are cited.  SO unless you have a variable named Nan somewhere that has a value of string assigned to her, this condition will do nothing for you.  You probably don't need it at all if you get this working properly.

  • Problem: Build a VI to display a string in the table of the lights. Each letter must be posted in a separate table and letters must move from one table to the other in the direction from left to right.

    Hi all

    Problem: Build a VI to display a string in the table of the lights. Each letter must be posted in a separate table and letters must move from one table to the other in the direction from left to right.

    I did program mentioned above but it does not work. Can you tell me what is the problem?

    There is no error is indicated in the program. If someone knows about it please try to find solutions and help me out of this problem.

    I have attached my program with this message.

    Thank you in advance!

    (1) FOR loops are your friend here.  You can make a slight restructuring using loops, and then you will have less mess to deal with, the inner loop through tunnels of autoindexing to make it even simpler.

    (2) I would only treat the numeric values of the characters.  So go terminal of control of the chain, the capital letters and byte array to before the outer loop.  You can use a size of Board over there to tell how many times the outer loop to iterate.

    (3) the Index table is extensible.  So you only need over the index of the first, and it will increment itself, as it develops.

    (4) you need to finish the lookup table (table 3D)

  • I tried many combinations of the different pc in order to transfer files from one pc to the other and only max speed I have is from 4 to 10 Mbps.

    Hello

    I tried many combinations of the different pc in order to transfer files from one pc to the other and only max speed I have is from 4 to 10 Mbps.

    I use the switch/cat6 cables only the router is capable of 100 Mbps.

    Also, I connect the pc directly with cable and still the same speed.

    Win7 will get more than that and how?

    I read the other posts on this topic, but all patches are not applicable to me.

    I used various cables and switches and PCs in order to eliminate the possibility of a defective unit.

    Can you please help?

    Thank you

    Andreas

    Hello Andreas,

    The question you posted would be better suited in the TechNet Forums. I would recommend posting your query in the TechNet Forums.

    Forum TechNet Windows 7

    TechNet Windows Server Forum

    Hope this information helps.

  • Transfer CS6 creative suites from one computer to the other.

    I recently transferred my CS6 Creative Suites from one computer to the other, but now it tells me that it cannot extract the files.  What should I do?

    cancellation/uninstall everything that is "transferred".

    Run the vacuum cleaner by http://www.adobe.com/support/contact/cscleanertool.html

    Restart your computer and install it correctly the cs6 files using your serial number and installation files.

    Available downloadable Setup files:

    Download and installation help links Adobe

    Help download and installation to Prodesigntools links can be found on the most linked pages.  They are essential; especially steps 1, 2 and 3.  If you click on a link that does not have these listed steps, open a second window by using the link to Lightroom 3 to see these "important Instructions".

  • Is there a way to copy / transfer / export existing assets from one site to the other?

    Is there a way to copy / transfer / export existing assets from one site to the other?

    I have like 20 + documents in one of my sites that I need to transfer to another site... What is a quick way to do without re - upload all my new Web site?

    Anyway, you would still re - download.

    If they are both sites of Muse you can open sites in Muse and copy and paste the desired content moved above.

  • Transfer files and to develop guidelines from one House to the other.

    I have a House on both sides and PC in every home where I installed CC.  I want to have the same files on each computer.  How can I transfer files from one PC to the other so that all the "setting instructions" are transferred with files.  I have a portable hard drive. Export, move, copy, save or import them.  I know how to get the original files not adjusted from one to the other, but I want to make sure that (the ' development' 'instructions') adjustments are transferred too.  I don't want to take the PC all from East to West in order to migrate.

    You must move the file catalog to computer 2 and ensure that the hierarchy of folders for the photos is EXACTLY the same on the 2nd computer as it is on the first computer.

    There is no export or import. If you export or import, you're doing it wrong.

    More details: http://www.lightroomqueen.com/how-move-lightroom-to-new-computer/

  • I want to move eBooks from one computer to the other.

    I want to move eBooks from one computer to the other.  Both have Digital Editions installed.  Older a 2.0 worm has installed books.  Latest is ver 3.0 no installed books.  The two are allowed with the user id.  What I have to download it from an older machine to the edge of clouds?  How do I do that?  Do I have to manually transfer files?  How do I do that?  Can I get shown in the directions online somewhere?

    Figured it out.  Copy files to new computer and add the library to digital additions.  duh.  Why was it some much easier to understand the answer once I posted the question?

  • How to use artifacts from MDS repository from one domain to the other domain

    Hello

    I'm working on the Oracle SOA MDS repository. I created the Databased MDS repository to the local server's domain. Now, I want to use artifacts from local area MDS repository same in the other domain server (domain of Dev).
    I created the composite soa for it and tried to use artifacts from local area MDS repository and deploy soa composite in the field of the Dev. But I am not able to use repository artifacts MDS from one domain to the other domain.

    Please help me

    SOA 11 g: 11.1.1.5

    Published by: 850198 on July 4, 2012 02:26

    Hello

    You can specify where to look for MDS in adf - config.xml present in *\.adf\META-INF*.

    Change the section in the file above to your Local MDS Server.

              
                
                  
                  
                  
                  
                
              
    

    Kind regards
    Neeraj Sehgal

  • Passing the value from one page to the other page

    Hi gurus,

    I need to pass the value from one page to the other page and two pages use different AMs.
    In the first page I have sellers results region table where the $vendor_name column is a hyperlink that navigates to the page Vendor_Sites. Now after accessing the second page, I want to excute the VendorSitesVO in PR of CO based on the value passed to VendorsVO (vendor_id) of first page.

    can someone help me on this?

    Thank you
    Vincent.

    Published by: user4933347 on December 4, 2009 12:19 AM

    You can set parameters of Pagecontext and transmit values through them. These values can be passed between pages, even if the AMs are different.

    Try:
    pageContext.putParameter ("Parameter1", value1);
    pagecontext.setForwardURL (second page)

    Concerning
    Sumit

  • How to move from one screen to the other applications?

    In order to organize some screens after installing several applications, how can we move them from one screen to the other?
    I found it possible to place them in the bottom bar and then replace them in the necessary form, but it is very slow...
    Another way?

    Also, is it possible to place the apps where we want to and not automatically bring reorganized (empty filled)?
    Thank you

    DUPE: https://support.mozilla.org/en-US/forums/firefox-os-english-forum/709563

  • I'll copy Mozilla firefox from one computer to the other. I don't want to download from the internet, I caught the virus of "Babylon" in this way.

    (1) you really have to make it easier to contact support. Get rid of password requirements!
    (2) I would copy safely Firefox from one computer to the other. I don't want to download from the internet. Really, we love and use firefox. I had to remove firefox because it came with the virus of Babylon.

    If you have been Babylon when you installed Firefox you may have installed it from an authoritative source (the only official place and secure to download Firefox from www.getfirefox.comEast). Please, never download Firefox from anywhere else.

    So, for your computers, be sure to download Firefox from www.getfirefox.comand you download the version official, convenient and safe.

    If you get Babylon on your computer, you can remove it easily without having to remove Firefox by reading How to remove the toolbar of Babylon, home page and search engine (Please note that Babylon is not affiliated with Firefox and we actively seek to solve these problems).

  • Why display started moving, as shaking from one side to the other?

    suddenly the screen has started to move from one side to the other, she stop for 2 seconds, and then continue to move, as shaking.

    Hello

    (1) what is the brand and model of your computer?

    (2) remember to make changes to the computer before the show?

    I would suggest trying the following methods and check if it helps.

    Method 1: Troubleshoot monitor and video card

    http://Windows.Microsoft.com/en-us/Windows-Vista/troubleshoot-monitor-and-video-card-problems

    Method 2: Flickering of the Correct monitor (refresh rate)

    http://Windows.Microsoft.com/en-us/Windows-Vista/correct-monitor-flicker-refresh-rate

    I would say as you reset the settings of the monitor to factory settings and check if that helps.

    Please consult the manual of your monitor to perform the steps.

    You can also try to connect an external monitor to the computer to check if the monitor is defective.

    It will be useful.
  • Is it possible to easily just change the first part of the path from one channel to the other?

    Due to a disk failure, the first part of the path to the library changed and disconnected so many photos that I've been using photoshop for more than 8 years. I am running windows 7 with photoshop elements 14. An example is the original path was 3 28 \\dualdisk02\bobk\myphotos\2010 and now the path is 3 28 \\dualdisk03\latk\myphotos\2010 is it possible to easily just change the first part of the path from one channel to the other?

    Go to the forum of elements

  • When I try to duplicate a layer from one file to the other why appears a window of "displacement"?

    When I try to duplicate a layer from one file to the other why appears a window of "displacement"? What should I do?

    Never seemed this before.

    Thank you

    I can't reproduce this. The layer as you try to duplicate a smart object and there a displacement map? Looks like you might need to reset your preferences.

Maybe you are looking for

  • External display on HDMI overheating my Mac and drains the battery badly

    Hey guys. I am using a MBP retina 2012 15 inches with an external monitor, a generic LCD 1080 p via HDMI without problems. And recently updated for Sierra. The question starts immediately when I plug it into the screen. The Macbook seems to overheat

  • iPad 9.7 enough hot Pro

    Unboxed a new iPad 9.7 Pro about an hour ago. When you hold it in portrait mode, the right side of the bottom of the iPad feels much hotter than the other sections. Others know about this?

  • address bar in Windows explore does not accept changes (CLOSED)

    My address bar stopped responding to paste... everything what I paste or type is quickly replaced by the address of previous folder I tried to re-opening and closing the file. I also ran SFC. I use Windows XP SP3. CLOSED: I used the SFC, REBOOT with

  • Speech recognition will not start and continue to run

    I am running vista 32-bit Home Premium edition. I finished the speech recognition session setting the microphone. I finished the tutorial.  However, no voice recognition program continues to run. When I run the program of recognition (or when it is s

  • Cannot print the Vista Home Premium laptop on printer Epson Workforce 610 wireless

    Tried to implement printing wireless since our Toshiba laptop under Vista Home Premium to an Epson Workforce 610 printer. I have already implemented printing wireless this printer to my desktop under XP Home SP3 without problem and continue to be abl