Code to wait until one event is finished before starting another?

Hi all,
Coding isn't my strong point but I have a basic understanding of how functions etc work.
I've been learning about referencing symbol timelines with the awesome tutorial from the Adobe Blog, included below.
http://blogs.adobe.com/edge/2012/07/18/tutorial-leveraging-independent-symbol-timelines/
I've been able to get my symbol to play from a certain part of it's timeline depending on whether the mouse is rolling in or out but now I'm a little bit stuck.
The mouseover event triggers an animation and the mouseout triggers another animation that starts from the same frame that the mouseover animation ends with.
The problem is this. If I move the mouse quickly over the buttons, the first animation will play halfway through and when the mouseout triggers the second animation, the first animation will seemingly "skip" to the ending and move straight to the first frame of the second animation.
I know enough to code it so that the second animation will check if the first animation is still playing before starting by using an else/if statement. Using this method I only know how to skip the second animation if the first is playing but that isn't really what I'm looking to do.
Here comes the question; can anyone explain to me how to create a wait loop in Edge Animate?
When I say wait loop, I am talking about code that will check a variable and perform an action if the variable is true OR loop back to the start of the function if the variable is false (to check the variable again).
The behavior I am trying to achieve is somewhat like queuing the second animation so that it will "wait" until the first animation is played before beginning the second animation.
Any ideas?

Ok Mr Doon,
Clearly, I read to quickly
The behavior I am trying to achieve is somewhat like queuing the second animation so that it will "wait" until the first animation is played before beginning the second animation.
So, say the anima symbol is a 2s animation and has autoPlay set to false. There are two instances anima-1 and anima-2 on stage.
The event handler anima-1.mouseover starts the first animation :
We select Stage in the code panel and place before the first Symbol.bind… the declaration for two symbol (stage) variables :
Inside the anima timeline, click the top left bullet+curly brackets icon and select complete : when the animation is complete, we set the boolean variable (what is not very clean here is that this is done for the two instances anima-1 and anima-2) :
The event handler anima-2.mouseover starts the wait loop, by calling a function defined at the stage level :
More precisely, the function is defined in the document.compositionready handler. It defines (and stores in variable waitLoop in order to be able to remove when finished) an interval, that is the repeated call, every 10 ms, of an inner anonymous function.
The latter simply tests the boolean and when its true
- starts the second animation ;
- clears the interval.
You can download the example here : https://www.box.com/s/6yxjfmrqd0b5zbhmd3lx
You can hover over the left rounded rectangle, and immediately after over the second one. Subsequent rollovers are not handled, but it gives you a possible logic to adapt to your particuliar problem (that I still do not understand completely : it's hard without seeing).
Gil

Similar Messages

  • How can you take a photo from one event and put it in another, without dragging to desktop and dragging back into iPhoto and moving it to the event folder I want it in.

    As the title says I need help on how to take a photo from one event and put it in another, without dragging to desktop and dragging back into iPhoto and moving it to the event folder I want it in. Right now when I want to move a picture from one event to another I drag it to my desktop then delete it from iPhoto then I drag it back into iPhoto and put where I want it.An example would be taking a photo from the Christmas event and add it to a specific person event.  Can I do that within the events section without all the dragging. Also is there anyway I can remove duplicates from iPhoto without going through each and every file. Any help would be greatly appreciated.

    Apple doesn't make it easy to do what you want.  However, here's how I do it. 
    Select the photo you want to move and create a new Event for it via the Event ➙ Create Event menu option.
    In the Event mode select the new Event with the one picture and drag it onto the Event you want to move the photo to.

  • 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.

  • Waiting until a gui frame finishes.

    Hi, I'm trying to implement something like JOptionPane or JFileChooser, where if you invoke methods of those classes to show GUI windows your program stops executing until the user click OK or something like that. I've been trying to implement this sort of functionality, but I'm getting nowhere at all with this. I'd like to implement something like this so that I wouldn't have to create call back methods in my program to be used by the GUI window when it's done, since that's a dirty way of doing it. Any help would be appreciated. Thanks.

    Use a modal JDialog. Read the JDialog API for more info.

  • How do I get the X-Y GRID INSPECTION.VI to wait until data collection is complete before it starts moving?

    I am using a PCI-7344 card with LabView to control a 3-axis servo motor motion system in conjunction with a data acquisition system. The intent is to collect data at each grid point of an X-Y grid.
    Using the X-Y Grid Inspection (Template).vi as a starting point, I programmed my data acquisition vi to start when the Check Blend Complete Status.vi returned a value of TRUE. I expected the while loop to complete once the data acquisition was complete, but the system starts moving at the same time the data acquisition starts.
    Is there a way to force the motion system to wait for the data acquisition to complete prior to moving to the next waypoint?

    If you enter a positive value into the blend factor control (period in ms), the board will wait this amount of time until it starts the next move.
    The Check for Blend Complete.flx function returns TRUE when this wait period is finished. Thus you will see the bahvior you have described.
    There are three options I can think of:
    1. Check the move complete status in order to start your measurement after the move has come to a stop.
    This method might be not the ideal solution as you need to be sure that your measurement doesn't take longer than the wait period you have entered as blend factor. Of course you can make this period very long but then your overall test time will increase.
    2. To avoid the disadvantage of 1. don't use blending at all. Instead start a
    move to the desired position, wait for move complete, do your measurement and start the next move. This method makes sure that you don't waste time.
    3. This might be the smartest and fastest method but there are a few additional requirements:
    - The time for your measurement is fixed
    - You can use an external trigger or scanclock to start your measurement.
    If these requirements are met you could combine the x-y grid example with a breakpoint example.
    You could program your board to generate a breakpoint (trigger) at each target position. The Breakpoint output of your 7344 is connected to the trigger or scanclock or whatever input of your measurement device. Now each time your axes reach the next target position the 7344 fires a trigger and your measurement device acquires data.
    Best regards,
    Jochen Klier
    National Instruments Germany

  • Finished product in one plant and finished product in another plant

    Hi ,
      In one plant client is manufacturing a finished and he is selling from the same plant and this product he is doing stock transport (sto) to another plant where he is using it as semifinished in the assembly.
    Ex.Bike handle is manufacturing in one plant and selling it from the same plant to the customer.Here this product is a finished good.Where as same material is used as during the assembly of Bike in other plant where this product is used as semifinished.
    Please guide how to make the same material code as finished in one plant and as semifinished in other plant.
    Regards,
    vr

    Hello
    As per my knowldge, it is not possible to maintain same material code in this scenario.
    All you can do is to make 2 matrial codes for finished and semifinshed material and at the time of STO betweem the plants, Do material to material transfer (movement type 309) either before issuing for STO from plant 1 or after receiving in plant 2.
    Will explain the steps:
    Material code M0001- finished good (handle) in plant A.
    Material code M0002- Semifinished goods (handle) to be maintained in plant A and plant B.
    STO (material code M0002) for stock to be transferred from Pant A to Plant B.
    Material to material transfer (M0001 to M0002)in plant A using movement type 309.
    GI (Material M0002) from Plant A against STO.
    GR (Material M0002) at Plant B.
    Hope it is clear.
    Regards

  • How do i get my ipod touch to download more than one app at a time, can i make it toware i dont have to wait for one app to download before it starts downloading another,

    my ipod will only download one app at a time and runs extremely slow. i was wondering if there is some way that i can make it download more than one app at a time and how can i make the app start downloading again after i have left my wi-fi zone and then went back in. im really confused.

    Download everything on your computer in iTunes, then sync your iPod to iTunes.
    You should be syncing (backing up) to iTunes and your photo app regurally, anyway.

  • Cannot copy pics from one event and paste them in another...not sure why?

    Anyone know a solution?  It's almost like the event album is locked or something...

    What if a user wants the same photo in two separate events?
    In my case I have an event for a movie project and I want to take a movie from my 2012 spring event. I do not want to cut it from the 2012 spring event and put it ONLY in the movie project event. I want to COPY it so I have it in TWO SEPARATE EVENTS.
    Why is this not possible?

  • How can I wait until a Swing.Timer has finished?

    I have a Swing.Timer runing which displays some animated text (more precisely it fades out a text with a delay of 50 until all characters are erased.
    Afterwards a time consuming operation shall begin. How can I achieve that this operation waits to start until the text has been faded out? The time to fade out the text depends on the length of the text, of course.
    So, how can I make the operation waiting until the Timer has finished its work?
    Thanks,
    Dirk

    dirku wrote:
    I have a Swing.Timer runing which displays some animated text (more precisely it fades out a text with a delay of 50 until all characters are erased.
    Afterwards a time consuming operation shall begin. How can I achieve that this operation waits to start until the text has been faded out? The time to fade out the text depends on the length of the text, of course.
    So, how can I make the operation waiting until the Timer has finished its work?I gave you an answer to this with sample code yesterday:
    [http://forum.java.sun.com/thread.jspa?threadID=5294087&messageID=10244564#10244564|http://forum.java.sun.com/thread.jspa?threadID=5294087&messageID=10244564#10244564]
            public void actionPerformed(ActionEvent e)
                if (sb.length() > 0)
                    sb.deleteCharAt(0);
                    label.setText(sb.toString());
                else
                    label.setForeground(color);
                    label.setText(text);
                    Timer timer = (Timer)e.getSource();
                    timer.stop();
                    // ***** start process here ***
            }The timer here continues until a condition is satisfied (here it's where the Stringbuffer that holds the text that is sent to the JLabel is empty). So all you have to do is place any code that needs to happen when the Timer ends in the else block. It's so simple as to be trivial.

  • Halt VI when Wait Untill Done.VI is waiting

    This program is for digitally triggered analog acquisition - N samples,
    N channels.
    There are 2 loops, one for the acquisition and one for user controls
    for the graphs. When the user presses the STOP button the VI will not
    stop because the WaitUntilDone VI is still waiting for the next
    trigger.(Therefore it will only stop after the next trigger) Is there
    anyway to interupt the wait until done and halt the VI?
    Another question: When I stop this VI using the STOP button(The one I
    have put) and then run the VI again the 2nd loop(controls for the
    graphs) does not execute!
    I am attaching the 3 VIs used. The main VI is skeletonv4.1. The other 2
    are used as sub VIs.
    Thanks!
    Attachments:
    skeletonv4.1.vi ‏286 KB
    8_channel_splitter.vi ‏56 KB
    formula.vi ‏42 KB

    Loop 1 sets a local variable (X) to TRUE when it quits.
    Loop 2 sees X = TRUE and quits.
    You start the program again - BUT X IS STILL TRUE.
    Loop 2 finishes before loop 1, sees X = TRUE and quits.
    Loop 1 finishes, sets X = FALSE, but it's too late.
    You need to set X FALSE, before either loop starts.
    You are using code to set X.Visible to FALSE, you can do the same thing by popping up on the X terminal and choosing HIDE INDICATOR - you don't need code to do it.
    Steve Bird
    Culverson Software - Elegant software that is a pleasure to use.
    Culverson.com
    Blog for (mostly LabVIEW) programmers: Tips And Tricks

  • Time until next Event loop

    I'm making a class that will load some data, and fire an
    event when it's finished loading... and I'm just not sure how to
    set it up so that people won't miss the event trigger when it's
    asked to load an extremely small amount of data.
    My first version started the load in the constructor, but I'm
    worried it will finish loading before execution returns to the next
    line of actionscript, i.e. before the user can assign an event
    listener for the 'complete' event, in which case the event handler
    will never be called.... however, there are examples in the flash
    docs that function exactly like that, so maybe I'm
    misunderstanding?
    Do all events wait until all functions have finished running
    before firing? Or should objects that risk firing events extremely
    soon after their construction be used in such a way to manually
    check if any events were missed on the way to assigning the
    handler?

    OK, that's what I thought...
    But in the case of the XML example, what other way is there
    to do this? It seems like the URLLoader object begins loading as
    soon as it's constructed... is it a better idea to go
    var myLoader:URLLoader;
    myLoader.addEventListener("complete", xmlLoaded);
    myLoader = new URLLoader(myXMLURL);
    or would the writing of a new object into that variable
    overwrite any 'listener' connections in it? (If that's how that
    works?)

  • How to have DDL "wait" until the lock is free in 10g

    I saw this for 11g: http://www.scribd.com/doc/247954/Oracle-11g-DDL-Wait-Option-feature
    Moving to 11g is not an option. I have code that does partition maintenance (adds a new partition and drops an old one) at night. However, sql loader may be running and the table may be locked. This happened already. Is there anyway to get my code to wait until the lock is released?

    The is no DDL option on the partition operations that I know of to tell the DDL to wait if it cannot get a lock. You will have to implement a procedural fix such as updating a row with a value to indicate the sqlldr job is running or if the sqlldr task is controled via a external table take a user lock then execute the partition operations via stored code that checks the user lock first.
    HTH -- Mark D Powell --

  • How can i get program to wait until file is loaded?

    Hi all,
    I keep getting a null pointer exception error thrown when it shouldn't. I'm 99% certain that its being generated because the program speed is faster than the load file time. Is there any way to make the program wait until the file is finished loading? I know you can set up a for loop that will take up some time but I wanted it to be more accurate so that no errors will occur on any machine. Here is the code
    RunMainProg();
              String[] TempHolder = new String[HowMany*2];
              try
                  BufferedReader readerOne = new BufferedReader(new FileReader("TempMDLFile.txt")); // file just save from RunMainProg()
                  String lineOne;
                  int i=0;
                       while ((lineOne = readerOne.readLine()) != null)
                            if(i>=TempHolder.length)
                            break;
                             TempHolder=lineOne;
                             i++;
              readerOne.close();
                   catch (IOException f)
                        MakeDialog ErrorDialog = new MakeDialog(TopWindow, "Load Error", "Error - The file you entered does not exist", "Error", "OK", "OK", 0, 0);
                   for(int i=0; i<TempHolder.length; i++)
                        if(TempHolder[i] == null)
                        i=0;
                   FormatData TestSequences = new FormatData(TempHolder); // problem occurs at this line
    I have looked all over and can't seem to find a way to verify if the file is loaded, or to get it to wait until it has. Any help would be much appreciated. Especially if you can supply some code snippets :)
    Much obliged
    Drb2k2

    okay, I added some test code that I was using to try and iron out the problem. Perhaps its best if I run through what happens.
    1. I get the data from the text box, and an external program is run which generates some text files. These files are then loaded and examined and some new data is appended to the old. This is the process
    FormatData TestSequences = new FormatData(TempHolder); Now every time its run first time around its fine.
    2. When I try and do exactly the same thing with the new appended set of data the null exception is thrown. Now Dr Clap, I thought exactly the same as you did, but... If i add the following bit of code before the FormatData call..
    for(int i=0; i<TempHolder.length; i++)
    System.out.println(TempHolder);
    It will produce the data without the appended info, and some null sequences.
    The size of TempHolder is adjusted depending on the amount of data submitted, so somewhere along the line its just not working.
    3. Now for the fun part, eventually if you put the call in a loop it will correct itself and produce the outcome, but needless to say i'd rather not have my program catching a load of nullpointerException errors.
    Finally as for the code
    for(int i=0; i<TempHolder.length; i++)               {                    if(TempHolder[i] == null)                    i=0;               }That was an attempt to stall the program until no null sequences were found. Sort of getting around the problem in 3.
    Dr Clap is a legend on these posts and his advice is well recieved but I have no idea how to view a stack trace or what benefit it has. Any tips on this would be great.
    Thanks for your help so far
    drb2k2

  • Return Code value using 'starting new task' and 'wait until'

    I'm having a minor issue with some return code values in my ABAP.
    This is what part of it used to look like before I modified it:
    With Code in version 1, the sy-subrc was not always zero, sometimes it would be 4.
    That was fine, and my abap would do something based on the non-zero RC.
    had a need to implement an RFC timeout, the only way I could see to do it was to use 'starting new task' etc as seen in Version 2.
    However, with my changes, sy-subrc is always zero.
    The ABAP runs fine but I know that sy-subrc should sometimes be 4, even when it returns within the allotted 60 seconds.
    Maybe I've coded it incorrectly.
    Can someone point me in the right direction?
    #>> Start of VERSION 1
      call function 'MY_FUNCTION_MODULE'
           destination RFCDEST
           tables
                orders_list          = t_orders_packet
                apo_orders_list      = t_apo_orders
                apo_resources        = t_apo_resources
           exceptions
                COMMUNICATION_FAILURE    = 1 MESSAGE MSG_TEXT
                SYSTEM_FAILURE           = 2 MESSAGE MSG_TEXT
                NO_ORDERS_SUPPLIED       = 3
                NO_PEGGED_ORDERS_FOUND   = 4
                ORDERID_CONVERSION_ERROR = 5
                OTHERS                   = 6.
    if sy-subrc is initial.
      * do some stuff as RC was 0
    else.
    * log non-zero return code etc
    endif.
    * << End of Version 1

    And now Version 2.
    I didn't put this into the 1st post as the formatting goes bonkers.
    #>> Start of VERSION 2
      call function 'MY_FUNCTION_MODULE'
           destination RFCDEST
           starting new task 'taskname'
           performing receive_result on end of task
           tables
                orders_list          = t_orders_packet
                apo_orders_list      = t_apo_orders
                apo_resources        = t_apo_resources
           exceptions
                COMMUNICATION_FAILURE    = 1 MESSAGE MSG_TEXT
                SYSTEM_FAILURE           = 2 MESSAGE MSG_TEXT
                NO_ORDERS_SUPPLIED       = 3
                NO_PEGGED_ORDERS_FOUND   = 4
                ORDERID_CONVERSION_ERROR = 5
                OTHERS                   = 6.
      WAIT UNTIL results_received = 'X' UP TO 60 SECONDS.
    if sy-subrc is initial.   << Now this is always ZERO
      * do some stuff as RC was 0
    else.
    * log non-zero return code etc
    endif.
    FORM receive_result USING iv_taskname.
      RECEIVE RESULTS FROM FUNCTION 'MY_FUNCTION_MODULE'
           tables
                orders_list          = t_orders_packet
                apo_orders_list      = t_apo_orders
                apo_resources        = t_apo_resources
           exceptions
                COMMUNICATION_FAILURE    = 1 MESSAGE MSG_TEXT
                SYSTEM_FAILURE           = 2 MESSAGE MSG_TEXT
                NO_ORDERS_SUPPLIED       = 3
                NO_PEGGED_ORDERS_FOUND   = 4
                ORDERID_CONVERSION_ERROR = 5
                OTHERS                   = 6.
      results_received = 'X'.
    endform.                    "receive_result
    * < End of Version 2

  • HT1923 HI...trying to uninstall iTunes components, but get the error that another program is trying to install..wait until it's finished then try to install. Install? I clicked UNinstall! Nothing is installing!?!?!?! HELP!

    Hi,
    Getting Runtime Error 6034. When I attepmt ot follow the suggetions to rectify this issue, I get the erroe message that anothe program is tryin to install. Wait until it's finish and try install again. 'Install'????? I clicked UNinstall!!! How can I find if something is trying to install? I am not installing anything. HELP!!!! PLEASE!!!!

    I get the erroe message that anothe program is tryin to install. Wait until it's finish and try install again.
    Restart the PC. Can you complete the uninstalls now, or do you still get the message?

Maybe you are looking for

  • Enhance screen for tcode FCH9

    I need to enhance the screen for tcode FCH9 to add more void reason. I do not want the check to be voided though. Is there is a user exit to enhance this screen or will have to create a custom transaction for this.

  • How can i set different number of iterations for different scenario profiles that we add to "AutoPilot" in load testing of OATS

    Hi, I have few set of load test scenarios, I would like to add each of these test scenarios to "AutoPilot" and run each different scenario profile at different number of iterations. As in Oracle Load Testing the "Set Up AutoPilot" tab I see  a sectio

  • My Faces can not output unescaped arabic chars?

    Hi All, We recently switched from the Reference Impl of JSF to the MyFaces impl and are disappointed to learn that it the response writer escapes all arabic characters when outputting in UTF-8, with no option of writing out unescaped arabic. We are u

  • Problem in  the picking up the file

    hi all, i am working on agile to sap, here PI has to pick .pdx (or) .axml files and thses files are zip files again, open these files winzip, then those can be extracted in xml files. now PI has to pick the .pdx file and put it as .pdx filein the rec

  • How to stop internal pricing changing in invoice.

    Dear All, I have taken internal price as an condition in Sale order. if material price changes before actual delivery, then the internal price also changes in invoice. how can i stop from hapenning this. Please help. regards, GHS. Please update. Edit