Wait until swf is completely loaded...

I am trying to load several swf files into various containers.  In one scene I have used the following:
createEmptyMovieClip("container1", 1);
loadMovie("MC.swf", "container1");
And I want to wait for it to load complete before moving to the next scene and doing the following one...
createEmptyMovieClip("container2", 2);
loadMovie("MC2.swf", "container2");
Can anyone please please save me?!
Thank you very much in advance,
Marc

If you want to know when loading is complete, use the MovieClipLoader class instead of the loadMovie method.  The MovieClipLoader class supports having listeners for loading events such as load completion.  It's been awhile, but I think if you look up the MovieClipLoader.addListener method there is a good example there that covers most of what needs to be done.

Similar Messages

  • Images are not progressively loading - waits for image to complete loading.

    Ever since I made my new PC, I have had a problem with all browsers not loading images progressively. That is to say, images wait until they are fully loaded until showing up. This is extremely annoying as it makes browsing slower on my already slow Australian net. I have tried going into firefox safe mode and disabling plugins such as nvidia 3D.
    Anyone have any ideas as to how I can fix this?

    Hello donosaur, try the next :
    # In the [[Location bar autocomplete|Location bar]], type '''about:config''' and press '''Enter'''. The about:config "''This might void your warranty!''" warning page may appear.
    # Click '''I'll be careful, I promise!''', to continue to the about:config page.
    # type/find (or copy paste from here) '''browser.display.show_image_placeholders'''
    # double-click on it to make it '''false'''.
    (If browser.display.show_image_placeholders is set to True(default) then image placeholders will be shown until images on a page are fully loaded. If is False, these are not shown, and this can provide a more "cleaner" look as pages loads the images.)
    thank you

  • File Adapter -- Picking has to wait untill it get fully loaded/write.

    Hi All,
    I need to pick the files from a folder and I need to pick the files only which has been written completely.
    I should not pick the file in the middle while writing, I need to wait untill it finishes the writing completely.
    Is there any setting I can put in Sender File adapter to do this?
    Thanks
    Seema

    Nithya,
    >> Try to increase the processing time in the sender communication channel, so that it allows you to completely load the file. Check the time which is needed to upload the file to the directory manually and correspondingly change the processing time.
    We do not know exactly at what time the file will be placed in the folder. It may be at any time. So I cannot put the processing time accurately.
    Aamir,
    >> If you are picking from FTP,MSecs wont work there.the sender program which writes the file must write the file in some temporary format like .dat etc and once the file is complete it should change the filename to .txt,configure the sender file adapter to pick only *.txt files.
    This is a good idea. But I don't think I can ask them to change at the other end as it is working previously with other middleware.
    Guys,
    Can you please advice which is the best thing we can do at this point of time.?
    Thanks
    Seema.

  • Java.lang.Process input stream waiting until process is complete to print

    I have tried to simplify this problem as much as possible. Basically, I have a java.lang.Process which executes a simple C program.
    test.c
    #include <stdio.h>
    #include <unistd.h>
    int main()
      printf("foo\n");
      sleep(2);
      printf("bar\n");
    ...The process has an input stream and error stream handler each on a separate thread. I have tried both buffered and unbuffered (BufferedReader, BufferedInputStream, InputStreamReader...) stream handlers. Both produce the same problem of waiting until the process has exited to receive anything from the process's streams.
    The only time this does not happen is when I call fflush(stdout); after each printf(). This can't be a solution because the real application calls a massive C application which would require thousands of fflush()'s to be added. What is causing this to happen? This doesn't happen when the C program is executed from the shell. Is there a way the InputStream can be forced to extract from the stream?

    hi.....
    I have closed the output stream of the process as you told me to do...
    The hitch is that, if my program contains only printf() statements,it works fine
    as soon as scanf() statement is encountered within the C code,it is totally neglected,and the output comes as if no scanf() statement existed in the C code.
    Consequently the thread doesnt wait for input which was bound for scanf() from the thread
    the code...
        public void run()
         try
             PrintWriter out = new PrintWriter(socket.getOutputStream(),true);
             BufferedReader in = new BufferedReader(
                            new InputStreamReader(
                            socket.getInputStream()));
             try
                     Process p;
              p=new ProcessBuilder("./a.out").start();
                     PrintWriter exOut=null;
                     BufferedReader exIn=null;
              exOut = new PrintWriter(p.getOutputStream(),true);
              exIn = new BufferedReader(
                           new InputStreamReader(
                           p.getInputStream()));
                  //String inputLine="", outputLine="";        
                  String str="";
                     int c;          
                  while(true)                   
                        //System.out.println("In While");
                  str="";exOut.close();                  
                        while((c=exIn.read())!=-1)
                                 str=str+(char)(c);
                                    System.out.print(str);
                        str=str+(char)(0);
                        System.out.print(str+"outside");
                        out.print(str);
                        sleep(100);
                        try
                            int x=p.exitValue();
                              out.print(str);
                   System.out.print("Bye 1");
                            String str1="Bye"+(char)(0);
                   out.println(str1);              
                   break;
                        catch(IllegalThreadStateException e)
                            //System.out.println("The Process has not ended yet");
                        //str=str+((char)-1);
                        //System.out.print(str+"Control reaches here too");
                        str="";
                        exOut = new PrintWriter(p.getOutputStream(),true);//I have tried to run the program without this also but the effect is the same
                        while((c=in.read())!=-1)
                            str=str+(char)(c);                                    
                        if(str.contentEquals(""))
                                System.out.print("Bye 2");
                                String str1="Bye"+(char)(0);
                                out.println(str1); 
                                p.destroy();
                                exOut.close();
                                exIn.close();
                                out.close();
                                in.close();        
                                socket.close();
                                break;
                        //str=str+(char)(0);
                  exOut.print(str);
                        try
                            int x=p.exitValue();
                            System.out.print("Bye 3");
                            String str1="Bye"+(char)(0);
                   out.println(str1);
                            break;
                        catch(IllegalThreadStateException e)
                            //System.out.println("The Process has not ended yet");
                  /*while ((inputLine = in.readLine()) != null)
                        exOut.println(inputLine);
                        outputLine=exIn.readLine();
                        //outputLine=inputLine;
                        //out.println(outputLine);}*/                   
             exOut.close();
             exIn.close();
             catch(IOException e)
                  System.err.println("Accept failed."+e);
             out.close();
             in.close();        
             socket.close();
         catch (Exception e)
             e.printStackTrace();
    }

  • Have system wait until GUI is completed

    I wrote a program to monitor a seniority list. If an odd last name, first name, etc is encountered, a gui opens to request the proper form of the name. The problem is that the program keeps running even though the gui has not yet been fililed out. How do I stop execution until the GUI is completed?
    Thanks
    Joe

    Make the dialog modal.

  • Schedule reports and wait until the report complete

    I have wrote a java program to call BO SDK to schedule several crystal reports (same report, run at once with different parameters) to an unmanage disk. The program run successfully and can generate the reports. I would like to add an email notification function once all the reports are generated. How can I know the status of all the reports is completed?
    Does anyone know the answer? Many thanks.

    Hi Grace,
    BO CMC has feature for e-mail notification
    goto CMC
    navigate to that report.
    rigth click>> Manage->>Default Settings-->>Notification. (Email Notification: )
    Email notification based on:
          A job has been run successfully .
                      Configure notification message
                                               Use the Job Server's defaults
                                               Set the values to be used here:
        A job has failed to run 
                       Configure notification message
                                            Use the Job Server's defaults
                                            Set the values to be used here:
    I dont know about doing all this through SDKs but you can try doing this step by step frist through CMC and then going for infovie and then your java program.
    See if this could achieve your reqiurements
    Thanks,
    Praveen.

  • URLLoader - how to wait until URL is loaded and then contine...

    Hello,
    I have litle problem because I don't know how to load
    external XML file, wait when loading is completed and after that
    continue with next code.
    Consider following situation. I have a function in
    actionscript, let's say, handleXML()
    function handleXML() {
    someURLRequest = new URLRequest("some XML file");
    someURLLoader.addEventListener("complete","LoadCompleted");
    someURLLoader.load(someURLRequest );
    Alert.show("Print Second")
    function LoadCompleted(event:Event) {
    someXML = XML(someURLLoader.data)
    Alert.Show("Print first")
    The problem is, when someURLLoader.load is called, Alert
    window with Print second is displayed and then "Print first" alert
    is displayed because flex perform action behind someURLLoader.load
    and then perform function LoadCompleted().
    I would like that first, when someURLLoader.load is called, flex
    wait until external XML is loaded, display "Prinf first" alert AND
    THEN continue with code and displat "Print second" alert.
    It is possible to do it someway??
    thanks for help

    Hi, thanks for answer, but I think it is the same:) So what
    happens if I change your code like this...
    srv = new HTTPService();
    srv.url = "some XML file";
    srv.resultFormat = "xml";
    srv.addEventListener( ResultEvent.RESULT, loadCompleted );
    srv.send();
    Alert.show("Print Second")
    function loadCompleted( event:ResultEvent ) : void
    someXML = XML(event.result);
    Alert.show("Print First")
    In this case, after calling srv.send(), next code in the
    fuction is performed, so the Alert "Print Second"" is dsplayed.
    After that, URL request is completed and "Print Second" appears. I
    think it is because data calls are asynchronous. Is it there a
    possibillity to wait after calling send() function, until the
    request is processed and then continue with code which the send()
    function was called from ? It means, first Alert.show("Print
    First") is executed and then Alert.show("Print Second").???

  • How to wait until setPage(number) is finished

    SR 3-8311228061
    When calling getStrings, found I need to iterate the pages of the doc/xls/etc
    However Autovue Support tells me that setPage() is asynchronous
    I asked how to wait until setPage() is complete, they suggested I post the question here
    Note, at the time its called the viewer (desktop version 20.2.2) is on the task tray, but not rendering the document
    Its only loaded to extract the text
    here is the blip of code
    for( curPage = 1; curPage <= pages; curPage++)
    vueBean.setPage( curPage ); //its necessary to call setPage even for page 1
    //If setpage fails stop (per Daniel/Oracle)
    int thisPage = vueBean.getPage();
    if( curPage != thisPage )
    //This message never shows up
    String msg = String.format("Pages[%d] thisPage[%d] curPage[%d] ", pages, thisPage, curPage);
    AdeptApplication.INSTANCE.publishEvent("file-event", msg,
    new SystemEvent(this.fileName, "GETTEXT_PAGEFAILED"));
    break;

    The code you have is to know whether changing pages succeeded or not, and unless you are trying to set a page number that is out of the page count it will always succeed
    So, yes, your test is the same as if (false)
    Now, page loading is done in an asynchronous manner
    1. you ensure that the page (the container for all the page artifacts) is created, synchronously
    2. the page content are streamed on another thread
    3. once the page is loaded, an event is sent VueEvent(VueEvent.FILEEVENT, VueEvent.ONPAGELOADED)
    So you should be able to query for info after you received the page loaded event
    Now, word documents are an special kind of documents, so you need to be aware of some specific issues.
    The same way ms-word does not know the total number of pages until the ENTIRE document is loaded, AutoVue will not be able to notify you either.
    And as Word, AutoVue allows you to display the pages that are already loaded, and you may query for some of its contents too.  BUT you can not query for page info when the page is been loaded (or obviously not yet loaded)
    The loading is a 2 phase one, part is done on the server (native code) and part is on the java side (display)
    So you will not be able to iterate
    for( curPage = 1; curPage <= pages; curPage++)
    simply because page count is not known.  You need to query doc info more than once.
    If page count = -1, you need to iterate for each page and then, test whether setPage() != getPage() and/or page count has been updated.

  • Calling an applescript inside a Javascript, waiting for it to complete before moving on.

    I've got a handly little applescript compiled as an app that performs an Adobe Illustrator action which exports the current file's artboard #1 to a specific location at 300ppi. I can even call it from a javascript... which is great because I want a javascript that will loop x times, changing text and exporting on each each loop. But, each loop will export a file with the same name... not a problem, I'll rename the file after each loop, and javascript will wait patiently for me the export to complete before moving on to the next step, right? Wrong! Javascript just keeps moving through the script.
    So, how do I get Javascript to wait until the AppleScript completes the export? I can't have it wait a specific amount of time...export might take between 2 and 180 seconds.
    My ideas:
    1) can the applescript fire some sort of event letting Javascript know to move on?
    2) Is there a Javascript equivalent to AppleScripts "do javavscript " command, which would allow me to move the Applescript code into my core javascript?
    3) I could kludge a stopwatch on the first loop, checking every 10 milliseconds to see if the exported jpg file has been written... then using that as a baseline timer to pause later loops (not great, because the file will exist while AI writes it, and JS may rename it and try to export the second loop before the first is done).
    for (z =0; z<copyArray.length; z++) {
    var jpgExt = "-01.jpg";
    var newExt = ([z] + jpgExt);
    var exportASfile = File('/Applications/Adobe Illustrator CS5.1/Presets.localized/en_US/Scripts/VCS_Specialty Scripts/StandardExport.app');
    exportASfile.execute();  // export the file
    renamedFile = new File(exportFile); //variable exportFile is a reference to the jpg being written by the export
    renamedFile.rename (exportFile.name.replace(jpgExt, newExt)   ); // replaces part of the filename with a new

    I'd love to stay in one language, but since we're stuck on CS5 here, I have to make do.
    My task for the script:
    1) pop up a window to collect: 1a) number of copies, 1b) custom text, 1c) choice of three radio buttons -- I can't figure out how to do this in AS besides popping up three separate dialogs, I have it working great in JS
    2) loop step 1, write a named text frame with an array value containing a concatenation of 1a, 1b, 1c  -- pretty easy in either
    3) loop step 2, export the file at a higher than 72ppi resolution with artboard -- currently controlled by an action, can't be done programmatically in either AS or JS using CS5
    4) loop step 3, rename the file to match what was written to the text frame -- again, pretty easy in either
    In CS5, neither JS or AS have the ability to control the resolution of a jpg when exporting.... just the scale. So an action is required.
    My window JS has some of the basic edittext, statictext, buttons, panels elements, not too tricky:
    var win = new Window ("dialog","Cover Copy Builder");
        win.orientation = "column";
        win.add ("statictext", undefined, "Copy and Format Instructions");
        var input = win.add('panel', [0,0,320,300],  undefined, {borderless:true} );
        win.add ("statictext", undefined, "Output Summary");
    etc.
    Is there an AS equivalent to this sort of window building construction?

  • How to wait until html page is completely rendered

    I use a JEditorPane to display HTML and i want to print it to an image. so i tried to load the page (JEditorPane.setPage(URL url)) and wait until the property "page" is fired. Then i printed the component to an image.
    My problem is that the page wasn't completely loaded (rendered?) when i tried to print it.
    Is there a way to be notified when the page is completely rendered?
    thx in advance
    ~elchaschab

    However, you might consider setting the document property for it to be
    loaded synchronously.i've already used my own HTMLEditorKit for synchronous document loading.
    class MyHTMLEditorKit
    extends HTMLEditorKit
    public Document createDefaultDocument()
    Document doc = super.createDefaultDocument();
    ((HTMLDocument)doc).setAsynchronousLoadPriority( -1);
    return doc;
    You probably already played around with calling repaint() and
    validate() before printing.i tried to call repaint and validate before printing but
    still it doen't work. :(
    As a last resort, you could experiment with calling the printing
    routine written as a thread passed to invokeLater(), although there is
    no obvious reason why this would make a difference. i don't understand what i should do with invokeLater().
    could you please give me a short example?
    thx,
    elchaschab

  • Second BW data load job waits for first to complete.

    Hi all,
    Iam manually loading data into my BW system , i have observed that if i try to load two data source together the system wait fror one to complete then only it will trigger the secnond load. eg if i run 2lis_11_vahdr and 2lis_13_Vdhdr together.
    The RSMo shows data records for 11_vahdr but for 13_vdhdr it is zero untill the the 11_vahdr finishes.
    I have 8 background processes are available both in Bw and R/3
    Please help.
    Regards,

    Hi,
    the case may not be like that...if one finishes then only the other one starts....
    When u start those 2 loads observe the background process in R/3 which starts with job name:BI_REQ*
    As per my guesses bcoz of ur 8 background processes when u start 2 loads at a time there will be 2 jobs trigerring in R/3 with job name given above....
    One job may be going into RELEASED state in R/3 and waits for the first  job to finish and after that finishes the previous one comes into ACTIVE state and start generating idoc's...
    by this we can say that this may be due to resorces avialability in R/3...
    u closely mnitor the jobs in R/3....
    rgds,
    nkr.

  • Creating a delay in labview until a c program completes in system exec.vi without using "wait until completeion"

    I want to run two related C programs. The second one reads a text file that the first created. So I need to wait until the first is completed.
    I use "system exec.vi" and I know I can set "wait until completeion" to true, but this way I won't see the screen and the C program announcments. Someone has an idea?

    Hi Dror,
    my idea: just wait for the text file created by the first C program. Check for the presence of this file (maybe using 'list directory') or check for the size of this file...
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Loading external swf  not complete

    Hi, I'm trying to load external swf (with more than one frame and actionscript 3 on every frame - I used there "timeline" coding) from my main swf.
    code for loading external swf into main swf:
    var loader01:Loader;
    function openGame1(evt:Event):void
    loader01 = new Loader();
    var requestSWF01:URLRequest = new URLRequest("game01.swf");
    loader01.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, processHandler);
    loader01.contentLoaderInfo.addEventListener(Event.INIT, initHandler);
    loader01.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);
    loader01.load(requestSWF01);
    addChild(loader01);
    function processHandler(evt:ProgressEvent):void
    var loaded:Number=evt.target.bytesLoaded;
    var total:Number=evt.target.bytesTotal;
    var stav:Number=loaded/total;
    loaded_txt.text=(Math.round(stav*100))+" %";
    function initHandler(evt:Event):void{
    loaded_txt.text="";
    function errorHandler(evt:IOErrorEvent):void
         trace ("Error: " + evt.text);
    I found out that this works only for loading swf, which has only one frame (and all actionscript on that frame)... It seems that if there are more frames, than it will not load complete swf (hmm maybe it is caused, because not all objects on frames are export in first frame). Preloading starts but after for example 20 % the event.INIT is fired and the external swf starts to play (and crashes..).
    You can see this here http://bvyborcik.xf.cz/  If you click on the blue building on the left with blinking text "Start hry" you will see what happens - preloading is not completed and after clicking on first floor btn, the swf crashes...
    Please is there a solution for this kind of problem?  Any help or pointing is welcome.
    regards Boris

    just curious, is the file you want to load the swf into set up exactly the same way with the same stage size, fps, and layers?

  • How to wait until an Entourage Schedule item completed

    I am trying to script the "Send & Receive All" operation in Entourage, and I have found that I can trigger the process off (from within my script) by:
    tell application "Microsoft Entourage"
    execute schedule "Send & Receive All"
    end tell
    However, the script continues to process while the scheduled actions take place.
    Is there any way to wait until the schedule actions complete and then process the rest of the script?
    Thanks
    Susan

    Glad to help, Susan
    I found out about "connection in progress" by looking at the properties of "application" in the Entourage dictionary:
    connection in progress boolean [r/o] -- Are there any network connections in progress?
    (In fact I searched through the dictionary for the phrase "connect".) The property is a boolean (true/false), and my script uses a "repeat while" loop to test for that boolean condition.
    As well as properties, the Entourage application object also has elements. These include "POP account", "IMAP account", "Exchange account" and "Hotmail account". These can be referred to "by numeric index, test". So if you pass a list of accounts to the "connect" command, Entourage will connect and download mail from those accounts. For example, if you have two POP accounts, this works:
    tell application "Microsoft Entourage" to connect to {POP account 1, POP account 2}
    AppleScript lists are contained in curly braces.
    But it's simpler (and less prone to error) to do this:
    tell application "Microsoft Entourage" to connect to every POP account
    Alternatively, the "test" lets you refer to individual accounts by name - a list isn't essential, despite what the dictionary says:
    tell application "Microsoft Entourage" to connect to POP account "My Account"
    There's many ways of skinning a cat.
    To answer your more general question, though, there is no one "user guide" for AppleScript. You can learn the about the basics of the language from the AppleScript Language Guide. But that will tell you nothing about how to script particular applications. This is because every developer, if they do implement AppleScript in their application (and lots don't), implements it in different ways.
    So as well as learning AS, for each application that you want to script you have to learn a slightly different set of commands. There's an awful lot of trial and error involved, but one way to learn is to look at scripts that others have written. There are good resources at Apple's own AppleScript page and at AppleScript Central among others. For specifically scripting Entourage, try Paul Berkowitz's scripts.
    Different people will also recommend different books. My recommendation is AppleScript: The Definitive Guide by Matt Neuberg, but again it's not application-specific.
    Hope this helps, at least to give you some pointers.
    H

  • Sand Box has stopped working error when using System Exec.vi with wait until completion is true

    I get the following error message in Windows 7 "Sand Box has stopped working" when using System Exec.vi with wait until completion set to true, if I set it to false there is no error message.

    Hello JJVerdi
    mmm well System Exec.vi simulates a DOS command window, can you run the sandbox from the cmd window using the same commands without any errors? 
    you may take a look to this KB, it may be related to your issue:
    http://digital.ni.com/public.nsf/websearch/2393462​BD57B854186256C4F007B706A?OpenDocument
    Regards
    Mart G

Maybe you are looking for