[JS CS3/4] Stop closing process problem (onEvent)

Hi,
I try to stop a closing operation through an event listener.
I used that :
#targetengine session
docEvt();
function docEvt()
    var myEventListener = app.eventListeners.add("beforeClose",myAddDocGlobalEvt, false);
function myAddDocGlobalEvt(myEvent)
    myEvent.stopPropagation();
    myEvent.preventDefault();
    alert('stop');
However, when I close the document...it's closed :-(
I get the 'stop' alert but the document window is no longer visible.
I would like to really stop the closing process. What do I do wrong ?
TIA Loic

Hi Loic,
Is beforeClose cancelable?
Try:
alert(myEvent.cancelable);
If false, you can't prevent default behavior.
@+
Marc

Similar Messages

  • Adobe Photoshop CS3 has stopped working: A problem caused the program to stop working correctly.

    I recently purchased a new desktop computer and installed Adobe CS3 Master Edition on it and I get the following error:
    Adobe Photoshop CS3 has stopped working: A problem caused the program to stop working correctly. Windows will close the program and notify you if a solution is available.
    Out of the entire suite of tools only Photoshop will not launch. The weird thing is i also had the same Adobe programs installed on my laptop and I have not made any installation updates to that machine and i am getting the same error. I have always installed the same software on my two home machines with no problem until now. Any help is appreciated.
    Thanks,
    Andy

    You'll probably going to have to uninstall, then re-install the application; but you need to provide a lot more information;
    BOILERPLATE TEXT:
    Note that this is boilerplate text.
    If you give complete and detailed information about your setup and the issue at hand,
    such as your platform (Mac or Win),
    exact versions of your OS, of Photoshop (not just "CS6", but something like CS6v.13.0.6) and of Bridge,
    your settings in Photoshop > Preference > Performance
    the type of file you were working on,
    machine specs, such as total installed RAM, scratch file HDs, total available HD space, video card specs, including total VRAM installed,
    what troubleshooting steps you have taken so far,
    what error message(s) you receive,
    if having issues opening raw files also the exact camera make and model that generated them,
    if you're having printing issues, indicate the exact make and model of your printer, paper size, image dimensions in pixels (so many pixels wide by so many pixels high). if going through a RIP, specify that too.
    etc.,
    someone may be able to help you (not necessarily this poster).
    a screen shot of your settings or of the image could be very helpful too.
    Please read this FAQ for advice on how to ask your questions correctly for quicker and better answers:
    http://forums.adobe.com/thread/419981?tstart=0
    Thanks!

  • Flash CS3 Play/Stop audio button problem

    I made a play/stop audio button with this youtube tutorial (youtube.com/watch?v=XU6oMEFUFF8) but after the sound is finished I want the play button to show up agian.
    Here is the actionscript:
    import flash.events.MouseEvent;
    play_btn.addEventListener(MouseEvent.CLICK,clickha ndler);
    stop_btn.addEventListener(MouseEvent.CLICK,clickha ndler);
    function clickhandler(event:MouseEvent):void{
    swapChildren(play_btn,stop_btn);
    what code should I add to my current code?
    I also can send you the Fla.

    You should consider using the Sound class. Here's a quick overview of it:
    http://help.adobe.com/en_US/as3/dev/WS5b3ccc516d4fbf351e63e3d118a9b90204-7d21.html
    You'll be able to add event listeners to the sound to know when it completes so you can execute more code, such as swapping the play and stop button. There is an example in that overview of listening for the SOUND_COMPLETE event (e.g. channel.addEventListener(Event.SOUND_COMPLETE, onPlaybackComplete);). It should contain everything you need.
    A basic example of what you'll end up with (there's many ways to do it) might look something like this:
    // just set up and wait for click
    var isPlaying:Boolean = false;
    var mySound:Sound = new MySoundInLibrary();
    var myChannel:SoundChannel = new SoundChannel();
    myChannel.addEventListener(Event.SOUND_COMPLETE, onPlaybackComplete);
    // buttons
    play_btn.addEventListener(MouseEvent.CLICK,clickhandler);
    stop_btn.addEventListener(MouseEvent.CLICK,clickhandler);
    function clickhandler(event:MouseEvent):void
              swapChildren(play_btn, stop_btn);
              if (isPlaying)
                        isPlaying = false;
                        myChannel.stop();
              else
                        isPlaying = true;
                        myChannel = mySound.play();
    function onPlaybackComplete(e:Event):void
              isPlaying = false;
              swapChildren(play_btn, stop_btn);
    The basic idea is keeping a flag if the audio is currently playing. If it isn't then assign the sound to a channel and play it while setting the flag (isPlaying) to true. If it's already playing, set the flag to false and stop playing the audio.
    The swapChildren is run in the onPlaybackComplete() method so when the audio completes the play button is swapped back in front.
    Rather than swapping the children I'd urge you to toggle the .visible property instead. It's easy to run commands in the wrong order and get desynched on depth.

  • "Program" CS3 has stopped working"-Has anybody had this issue before?

    When I launch any of my Adobe CS3 software, I get a message as follows:
    "Adobe Photoshop CS3 has stopped working
    A problem caused the program to stop working correctly. Windows will close the program and notify you if a solution is available."
    I tried resetting preferences, restoring my system to an earlier date, removing and reinstalling the software, and nothing has helped.
    I am running Windows Vista Home Premium.
    It is a licensed version of CS3.
    Please help. I am dead in the water here.

    Hi,
    Have you updated CS3?
    Go to help/Updates
    Try to run it in Administration mode
    Phillip

  • Unable to open PS Elements 11 once closed without Stopping the process in Task Manager

    Photoshop Elements 11 will not open once closed unless I either stop the Process in Task Manager or reboot the computer.  I have tried setting the program to run in Administrator mode but this did not work. I am running the program on a 64 bit Windows 7 laptop, the process I need to close each time is usually "Photoshop Elements Editor exe*32'?"
    Can anyone help me please?

    I have this problem intermittantly with Premiere Pro and have not been able to find a solution.

  • How to stop threads, process, streams when closing a (internal) JFrame?

    Dear all,
    I read a Javaworld article about Runtime.exec(), which will output the process outputs and error outputs to either a file or System.out. Now I want to practice it by outputing the process output/error to a Swing JTextArea. It works fine if the process ends successfully.
    My problem is that I want to stop all the output threads and clear all the streams when user click close JFrame button before the process finished. The code is shown below. Note that this frame is poped up by a click from another main frame. ( it is not exiting the main Swing application). This happened when I want to kill a process when it is running.
    I tried to implements a WindowListener and add
    public void windowClosing(WindowEvent e) to the JFrame.
    Inside this method I used process.destroy() and errorGobbler = null, outputGobbler = null, or outputGobbler.interrupt(), errorGobbler.interrupt(). But all these seems does not work. Sometimes thread was not stopped, sometimes process was not destroyed (because the stream was still print out something), sometimes the error stream was not successfully closed - by printing out interruptted by user error message.
    How can I make sure all the underlying streams and threads, including the PrintStream in StreamGobbler class are closed?
    Again this Frame could be a Dialog or InternalFrame, i.e, when I close the frame, the main frame does not exit!
    import java.util.*;
    import java.io.*;
    class StreamGobbler extends Thread
        InputStream is;
        String type;
        OutputStream os;
        StreamGobbler(InputStream is, String type, JTextArea out)
            this(is, type, null, out);
        StreamGobbler(InputStream is, String type, OutputStream redirect, JTextArea out)
            this.is = is;
            this.type = type;
            this.os = redirect;
        public void run()
            try
                PrintWriter pw = null;
                if (os != null)
                    pw = new PrintWriter(os);
                InputStreamReader isr = new InputStreamReader(is);
                BufferedReader br = new BufferedReader(isr);
                String line=null;
                while ( (line = br.readLine()) != null)
                    if (pw != null)
                        pw.println(line);
                    out.append(type + ">" + line);   
                if (pw != null)
                    pw.flush();
            } catch (IOException ioe)
                ioe.printStackTrace(); 
    public class Test extends JFrame
        private JTextArea output;
        private StreamGobbler outputGobbler;
        private StreamGobbler errorGobbler;
        public Test (String file)
            super();
            output = new JTextArea();
            try
                FileOutputStream fos = new FileOutputStream(file);
                Runtime rt = Runtime.getRuntime();
                Process proc = rt.exec("java jecho 'Hello World'");
                errorGobbler = new
                    StreamGobbler(proc.getErrorStream(), "ERROR", out);           
                outputGobbler = new
                    StreamGobbler(proc.getInputStream(), "OUTPUT", fos, out);
                errorGobbler.start();
                outputGobbler.start();
                int exitVal = proc.waitFor();
                output.append("ExitValue: " + exitVal);
                fos.flush();
                fos.close();       
            } catch (Throwable t)
                t.printStackTrace();
         setSize(400,400);
         show();
    }Thanks !

    Thread.interrupt() doesn't stop a thread. You'll have to read the API for more specifics. You could use something like interrupt to force interruption of the thread for the reason of checking the terminating case though. I believe you would want to use this in the case where operations can take a long time.
    Setting your reference to the thread to be null won't stop the thread since it's running. You just lose your reference to it.
    I believe once the thread stops running your streams will be closed, but possibly not cleanly. Someone who has more knowledge of threads might be able to answer this better, but I would generally say clean up after yourself especially if you are writting out data.

  • Problem in stopping the process for a while

    Hi all,
    I am facing problem in stopping the process when i call *.exe from java. here i am explaning my problem in detail.
    main(){
    m1();
    m2();
    m1(){
    Runtime r=Runtime.getRuntime();
    Process p=r.exec("solve1.exe");
    // this exe file will create a text file (temp.txt), and it is creating it with out any problem.
    m2(){
    using temp.txt here.
    problem is when i call m1() it will create temp.txt , but by the time i call m2() temp.txt is saving into the disk and m2() is not able to find the file.
    here what i need is there should be some time gap to before i call m2(); and i tried even with
    p.waitfor(); in m1() -if i use this the program is not exiting out of runtime??
    any one kindly hepl me
    bye.

    A test app(if you don't have sol, then pick another app)
    public class WaitForTest{
        private WaitForTest(){
            try {
                Process p = Runtime.getRuntime().exec("sol.exe");
                System.out.println("Waiting....");
                p.waitFor();
                System.out.println("Done waiting") ;             
            catch(Exception e)
                    e.printStackTrace();
            static public void main(String[] args){
                new WaitForTest();
    }

  • When starting to install they stop the process and say encountered many problems try re installing

    When starting to install they stop the process and say "encountered many problems try re installing" and system not modified

    Try this:
    1. Boot from your Panther Installer Disk. After the installer loads select Disk Utility from the Installer menu.
    2. After DU loads select your hard drive (this is the entry with the mfgr.'s ID and size) from the left side list. Click on the Partition tab in the DU main window.
    3. Set the number of partitions from the dropdown menu (use 1 partition unless you wish to make more.) Set the format type to Mac OS Extended (Journaled, if supported.) Click on the Partition button and wait until the volume(s) mount on the Desktop.
    4. Select the volume you just created (this is the sub-entry under the drive entry) from the left side list. Click on the Erase tab in the DU main window.
    5. Set the format type to Mac OS Extended (Journaled, if supported.) Click on the Options button, check the button for Zero Data and click on OK to return to the Erase window.
    6. Click on the Erase button. The format process will take 30 minutes to an hour or more depending upon the drive size.
    7. Once the formatting has completed quit DU to return to the installer. Proceed with the installation of Panther.

  • How do i stop two processes that are running in activity monitor

    how do i stop two processes that are running in Activity Monitor took one out of trash and it says preparing to move desktop still running with another one been running for hrs now want to stop these many thanks jen.

    Select each one and Force Quit it.
    But be careful there are many processes that are run by the OS that if quit will cause problems possibly even crash the system.
    regards

  • Windows 7   " Adobe Photoshop CS3 has stopped working "

    Okay let me stir up a whole new kettle of fish WINDOWS 7 VS CS3 PHOTOSHOP.
    I have Windows 7 Ultimate Edition 64bit. I am running (or trying) CS3 Master suite. Most all progams function except Photoshop. I try to load it and I get "Adobe Photoshop CS3 has stopped working" and then there is no fix and no help. Photoshop ran on Vista 64bit just fine.
    I'm curious if anyone else is having this same issue? If so have you found any clue as to the issue?
    I get the feeling this could be a conflict with a windows 7 update or something?
    Any fixes?

    Try right clicking on the PS CS3 icon and run as admin. I can tell you that people have a lot of problems in running PS CS3 in Windows 7 and had to download the Windows XP virtual and run CS3 in virtual mode.
    Anyways here is a link to the suite forums. They may have a better answer there for you.
    http://forums.adobe.com/community/creativesuites/creativesuites_windows

  • Help! CS3 has stopped working

    I get an error message from windows vista premiumm home.
    It just says: Adobe Photoshop CS3 has stopped working correctly. Windows will close the program and notify you if a solution is available. The only option is a box that says "close program". Once you close it everything goes away. It doesn't even give you a hint of what the problem could be. I installed creative suite 3 web premium on this brand new computer about 2 weeks ago. This is a first time install of this software, but when I called Adobe they said they don't offer free installation help anymore on cs3 because cs4 is out now. Anyone have a clue what I should do? I can't just uninstall photoshop, if I try it wants to uninstall all 8 programs.

    try resetting the preferences, per this FAQ:
    http://www.adobeforums.com/webx/.ef4a07f/1

  • HELP - Receiving error message "The file has not been processed. An error has occurred which stopped the processing of the PDF"

    Have been using Adobe CreatePDF for many months successfully.
    Only recently over the past few days I have been experiencing errors for periods between 3-5 hours on every attempt to convert/combine files. The error reads: "The file has not been processed. An error has occurred which stopped the processing of the PDF"
    It will stay like this and no amount of refreshing the cache, logging in and out will help. I'm running Firefox 34.0.5, windows 7 64bit. Only solution I've found is to wait until the next day and it seems to be working again. Only explanation i can think of is some unexplained maintenance adobe is running behind the scenes because I'm often working late between 12am - 4am.
    When this problem happens, no file types will convert/combine I've tested JPEG, PDF and word docs to PDF.
    I log in and out of my account, I've cleared my cache, I'm using Firefox 34.0.5 which has always worked in the past I just don't understand how this error is happening for such long periods. Starting to reconsider this product when there are free alternatives to simply combine my PDF docs! please help.
    Tom.

    I am still experiencing this problem. Customer service from Adobe has been abysmal!
    I called Adobe tech support at 2am Australian time ( >1 weeks ago) and got onto a help centre in India. I was walked through all the troubleshooting steps and they remotely accessed my PC and confirmed that It was not my PC that was at fault. They reset my password and dialed into my adobe account from their end to attempt a simple conversion and export to PDF which failed. I was told that this problem is not something they can fix, and is a result of something on the back end of their software.
    They advised me that the problem would be passed to a fixed within 12 hours and they would call and email me to confirm everything was OK. I gave my phone number with (area and country code) my email but have not had any communication back.
    I am extremely dissatisfied, and just want this software to function. Is that too much to ask?
    Note: This problem is happening always now, regardless of time being used.
    Tom

  • Automation of Closing Process

    Hello
    Our Client has a peculiar requirement of closing
    To extract Account Balances Profit Centrewise example
    Profit Centres                                                         P1                     P2                P3
    Expenses in Profit & Loss     Grand Total              Rs.                    Rs.              Rs.
    Rent                                         10,000                 2,000                  5,000          3,000
    Electricity                                 50,000                10,000               30,000         10,000
    Expenses above includes for Capital WIP also e.g. materials for buildings, etc (since business is construction of hotels, schools, etc)
    After above process to bifurcate Capital & Revenue expenses & common expenses(eg. salary paid to administrative staff) for both Capital & Revenue projects.
    Now the problems are following
    1. How can Capital, Revenue & Common expense at Cost Centre or WBS level be bifurcated while at the time of making expense entry.
    e.g. if we make rent expense entry, we can select Profit Centre, Cost Centre, WBS element but further require "whether it is for Capital Projects, Revenue Projects or Common Expenses".
    which fields can be used for these 3 criteria?
    2. Close all General Ledger Accounts at cost centre & wbs level & transfer to 2 accounts i.e. WIP & CWIP.
    can we automate this process & transer all the GL account values to WIP or CWIP?
    Since closing process takes upto 2-3 weeks. if it can be reduced, it would be commendable in SAP.
    Please if someone just gives hint for some latest functions/options not explored yet, it is a very good opportunity to scratch brain.
    Thanks & Regards

    Hello,
    Could you tell me how you created a java program to make the job, I am interested in knowing how it is possible?
    Thanks for your help
    Regards,
    Jérôme

  • How stop the process of a job program and no sent data to XI?

    People,
    I have a program that stop by a error message that I put after a select like this:
      IF sy-subrc <> 0.
        v_error2 = 'E'.
        MOVE 'No data found. REGUH'(e01) TO emsg.
        PERFORM call_error_function USING emsg.
        PERFORM call_log_function.
        MESSAGE: 'No data found. REGUH'(e01) TYPE 'E'.
      ENDIF.
    For example if not exist data on REGUH display a error message and the program stop but the problem is that some of this programs are executed by a job and when present the error the status of the program are presented like CANCELED and I need to change the status to FINISHED but in the log present the tables with the message that no have data or something like that.
    Other thing that I need is not sent the message to XI if no have data. I made that with the error message but now I don't know how!
    Help me with this please!
    Thanks!

    Hi,
    To send data from SAP to XI, you can use:
    IDoc
    RFC and Proxy.
    For IDoc if you have no data then the IDoc is not created and hence no error needs to be processed.
    For RFC and Proxy that you must be calling in your report:
    1. First option is to check for the data before making a call to RFC or Proxy. If there is no data don't make the call
    or if you don't get the data and you want to send a message that there is not data then you have to make another message and update this message and send it to SAP XI
    Regards
    Vijaya

  • Stop standard process in user exit (or badi) for ME21N.

    Hello,
    I have implemented a user exit (and also a BADI) for transaction code ME21N.
    The user exit is executed before saving the purchase order.
    In my user exit, I just check data and if they are wrong, I just want to stop the process displaying an error message.
    So, I've just used  'MESSAGE Exxx(xxxx)'.
    The problem is that the standard process catch the error and treat it in stead of stopping. The standard process treats the error and proposes the user to chose if he(she) wants to continue or to stop (within a popup).
    I just want to stop the process, displaying a error message.
    If someone has a idea about how I can realise that, please let me know.
    Giuseppe,

    Which Exit/Badi did you implement? And Error message should normally stop the process. Maybe you have implemented the wrong exit.

Maybe you are looking for