Conditional "time function" to play timeline

Hello everyone:
I'm having trouble doing something I thought would be simpler. I have done this in AS/Flash but it doesn't seem to work in Edge. I have a small animation in the timeline (1s animation of alpha 0 to alpha 100 of group of objets) and I would like it to play specifically at a given time.
I created a funcion called updateClock() that checks the system time and gets hours and minutes and I call this function every second so it updates with setTimeout. I have a conditional to play the animation at a given time (you might need to change this line) that starts at frame 1000, or else, that it freezes the timeline at that very same frame. Finally I call the function.
Right now this code is in .compositionReady, but I also tried a trigger at 1000 ms. Any help with this would be appreciated. At 1000 ms the trigger sym.stop() works. Right now not even that works and the animation plays by itself.
function updateClock() {
    var now = new Date(); // current date
            var m = d.getMinutes();
            var h = d.getHours();
    // call this function again in 1000ms
    setTimeout(updateClock, 1000);
    if(h== 20 && m== 56) {
//run the animation
sym.play(1000);
  else {
  sym.stop(1000);
updateClock(); // initial call
Thank you in advance for any help you can provide.

You have to use a global variable (sym.updateClock). Here is a case.
1) compositionReady panel:
function updateClock() {
  var now = new Date();
  var m = now.getMinutes();
  var h = now.getHours();
  console.log(h,":",m);
  sym.updateClock = setTimeout(updateClock,1000);
updateClock();
2) With a click event or a trigger:
clearTimeout(sym.updateClock);

Similar Messages

  • How can I fix the long delay (15 min  ) between the time I select a song to the time it begins playing?

    How can I fix the lond delay (15 min.) between the time I select a song to the time it begins playing?

    Hi Ben,
    This is a common issue that NI LabVIEW does not address.
    The good news is that OpenG provides a function to do just what you need.
    See this article: Resize Front Panel to largest decoration
    The way to get the OpenG functions is to use the JKI VI Package Manager (VIPM).
    In addition to the OpenG functions there are several other community provided tools avaliable through VIPM.
    For a quick test, I'm attaching these files (LV version 2010 sp1):
    Fit VI window to Largest Dec__ogtk.vi and the required sub vi Current VIs Parents Ref__ogtk.vi.
    You should really use VIPM to get the full OpenG library - there are many gems in there.
    steve
    Help the forum when you get help. Click the "Solution?" icon on the reply that answers your
    question. Give "Kudos" to replies that help.
    Attachments:
    Fit VI window to Largest Dec__ogtk.vi ‏29 KB
    Current VIs Parents Ref__ogtk.vi ‏9 KB

  • Set start time for symbols on timeline?

    Hi
    I built several buttons - made as symbols - that animate onto the screen, and would like to stagger the start times slightly for effect.
    I thought I would be able to simply drag the symbols onto the stage and set the start times by clicking/dragging them on the timeline, but that doesn't seem to be working. I see the "Playback" and a + button but regardless of what I try I can't seem to delay the start of the symbol.
    Any ideas?
    Many thanks, I'm getting stuck between old Flash programming, Captivate development and After Effects... whew!
    Rich

    First turn autoplay off in each button. Then tell us how you want these buttons- are they supposed to appear at different time or just play at different times?
    If you want to show them at different times and then play them turn their display on where you want them and it will turm off before automatically.
    Autoplay if OFF on this picture. It has a checkmark when it is ON.

  • A function to play offline / downloaded songs and playlists from Spotify on Sonos is missing!

    A function to play offline / downloaded songs and playlists from Spotify on Sonos is missing!
    Since my internet connection is a bit shaky at home I need to use my downloaded content and playlists with Spotify! 
    However this functionallity is not available together with Sonos which is a really big problem. 
    I hope you plan to work together with Sonos to introduce this functionallity really soon.
    Also this is already available with Google Play Music together with Sonos and it would really be a shame to leave Spotify just to solve this problem. 
     

    Would be great to have some way of getting offline play lists on Sonos for when my internet connection dies, and also to reduce the amount of data i download repetatitivly... i must have streamed the same songs hundreds and hundreds of times over the last few years playing spotify over sonos, massive waste of bandwidth and download capacity. Maybe we could point spotify to a network drive for spotify on sonos to use for storage of offline playlists.

  • Orphan Menu Start Playing Timeline First Chapter

    Hi All,
    My Problem is i cant figure out where i am doing wrong.
    I have single timeline in my dvd project I import menu
    from the Encore Library did not set any action (mean the menu
    is orphan)when ever i preview from here it start playing timeline
    from the first chapter after 2 seconds.
    I tried several menues from the library but having same
    problem. when i check the project it shows error "orpahn menu"
    which is correct as i did not do any routing to any menu.
    (I am doing it with the help of Total Training Video step by step)
    Did anyone else have the similar problem.
    Thanks in advance.

    Mujeeb,
    Lets forget about Preview for a moment. Well get back to it, but not until youve done what follows. I want to make sure that I know what you have, what youve done and what you want with your DVD.
    Tell me if I am correct:
    1.) You have a DV-AVI file that you Imported (either as a Timeline, or created a Timeline from it). It was done/Imported first. This will automatically place it as Play First in the Flowchart.
    2.) You have a Menu that you Imported as Menu from either the Library or from elsewhere on your system. It has one Button. It now appears in the orphanage in the Flowchart.
    Right now, in the Flowchart Panel, you have the Disc icon (DVD Project, or whatever new name you gave it) with a black line going to the Timeline. You also have your Menu in the orphanage. Is this correct?
    You want this Menu to Play First, and then after a point in time to go automatically to your Timeline, or if the user pushes that one Button to go immediately to that Timeline. Is this correct?
    If so, hover your mouse cursor over the Disc icon. It will turn into the Pickwhip (little curleque icon). Drag this down to your Menu in the orphanage. It will replace your Timeline as Play First. There will be a little box below your Menu and it will say Button 1 (unless you changed its name). From this little box below your menu (remember, we are still in the Flowchart Panel), when you hover the mouse cursor over it, youll get the Pickwhip again. Drag it to your Timeline.
    Now, in your Flowchart, dbl-click on your Menu. Open the Properties Tab and look down to Duration (third line down). Set it to the length of time* that you want the Menu to be visible (unless the user hits the button). Uncheck Hold Forever. Loop Point should be set to None.
    Your Flowchart should now have the Disc icon with a black line to your Menu. There should be one blue line from the Menu Button 1 to the Timeline. This is what you want.
    Now, Preview the Project. I usually do this from the File>Preview on the Menu Bar at the top of the workspace. Alt-Ctrl-Spacebar will also do it. Your Preview should show the Menu, which will automatically go to the Timeline after the length of time you specified in the Properties Panel, unless you hit this Button before that time. Does this work?
    * Duration is Hours:Minutes:Seconds:Frames
    Hope I have been clear and that I am correct. If not, please tell me where I went off.
    Good luck,
    Hunt

  • Every time that I play a tune from my itunes the file duplicates itself into my 'MyDocuments' folder. If I delete this the song is erased from itunes totally. Ideas??

    Everything worked fine for the last two years but now every time that I play a tune from my itunes the file duplicates itself into my 'MyDocuments' folder. If I delete this the song is erased from itunes totally. Ideas??

    You are of course deleting the tunes from within the iTunes interface.
    The settings that I am referring to are your device settings for the iPad. It should show in the left column of iTunes when your iPad is plugged in.
    Go through your playlists and make sure that the tunes(s) are removed from any playlist. You can prevent the sync as noted above then do a sync and the iPad should update with the content from you Mac.
    MJ

  • Movies taking long time to start playing!

    I like watching movies in Front Row but I have a problem, Whenever I try watching a full length movie it takes really long time to start playing.
    The screen is black for like 2-3min and nothing responds (Pressing ESC, or pressing menu etc...) after that it starts playing normal.
    Smaller movies (30 min episodes) load up normally.

    you need more ram it will go faster. You should have at least 2 GB to go faster.

  • HT204406 Hello,  I have songs that show they are "Waiting" for download from the cloud but they are greyed out.  Some songs in one album are done others in the same album will not download. It is not a time function because i have been working on this for

    Hello,  I have songs that show they are "Waiting" for download from the cloud but they are greyed out.  Some songs in one album are done others in the same album will not download. It is not a time function because i have been working on this for weeks. I have allowed my compter to run for days and the songs are still not accessible.  I have a Match subscription and Match is working.  If I click on the "Genre" link the greyed out songs show that they are ready for download from the cloud but I cannot download them.  I have downloaded over 1500 other songs, so I am trying to understand what is going on here. I would appreciate any help anyone can give me.
    Thanks

    I did think about that and if I have to I will do that, however there are about 50 songs. I have closed and reopened iTunes several times and I am sure that I have the latest version. It fails right away but I can click on the cloud download icon and download the song that it failed on ... therefore it is not that song "or any one song" causing the issue. Any ideas?

  • How to use elapsed time function with state machine in Lab VIEW

    Hello
    I've been trying to use state machine with elapsed time function in order to sequentially start and stop my code. The arrangement is to start the code for 1 minute then stop for 5 minutes. I've attached the code, the problem is when I place the elapsed time function out of the while loop it doesn't work, on the other hand when I place it inside the loop it does work but it doesn't give the true  signal to move to the next state. 
    Could you please have a look to my code and help me to solve this issue.
    Regards 
    Rajab
    Solved!
    Go to Solution.
    Attachments:
    daq assistance thermocouple(sate machine raj).vi ‏436 KB

    Rajab84 wrote:
    Thanks apok for your help
    even with pressing start it keeps running on wait case 
    could you please explain the code for me, the use of Boolean crossing, increment , and equal functions 
    Best Regards 
    Rajab 
    OK..I modded the example to stop after 2 cycles. Also recommend taking the free online LabVIEW tutorials.
    run vi. case statement goes to "initialize", shift registers are initialized to their constants. goto "wait"
    "start"= false, stay in current state. If true, transition to "1 min" case
    reset elapsed timer with True from shift register(counter starts at zero)."time has elapsed"=false, stay in current state(1 min). If true, goto "5min" case
    reset elapsed timer with True from shift register of previous case(counter starts at zero)."time has elapsed"=false, stay in current state(5 min). If true, goto "1min" case. Also, bool crossing is looking for "true-false" from "5 min" compare function to add cycle count.
    Once cycle count reaches 2, stop while loop.... 
    Attachments:
    Untitled%202[1].vi ‏42 KB

  • I am looking for an app that can unmute my iphone after a preset time, eg 1 or 2 hours. Does anybody know an app with this feature?? The apps I have found are linked to a calendar or a place, I just need the timer function..

    I am looking for an app that can unmute my iphone after a preset time, eg 1 or 2 hours. Does anybody know an app with this feature?? The apps I have found are linked to a calendar or a place, I just need the timer function..

    thanks. yes i am aware of the VoiceOver feature but it is NOT the solution to my problem. as you said, it is a solution to a different set of issues. i want the text to speech ability because i there are books i need to read but do not have the time to sit down and read them and have become used to listening to them read to me either by a professional human reader or with the text to speech software on the Kindle.
    I think Apple makes the best audio devices but i am really disappointed in this inexplainable shortcoming. if apple can give us siri they ought to be able to design a nice little button that i can push to turn on text to speech while i am in a document, book, magazine or webpage. clearly it is possible as apple has added the "reader" button in safari to have web pages dropped into the reader format.
    thanks for your suggestion though, it is what everyone suggests but it does not address the issue.

  • Using time() function in multithreaded application

    I am using time() function in a multithreaded application with NULL argument for getting current time.
    Some time it's observed that we get a time one minute earlier than current time (3600 seconds).
    Is there a problem in the usage of the function?
    I am using expression : currenttime = time(NULL);
    I had seen some people using following way - time(&currenttime );
    Will above two behaves differently in multithreaded environment?
    [I  am using  Sun C++ 5.5 compiler on Solaris 8]

    How do you compare actual time against the time seen by your threads? If your threads are printing the value from time(2) to stdout, it's possible that you're seeing an artifact of thread scheduling and/or output buffering.
    I really doubt that you have a concurrency problem, but anyway make sure that you include the -mt option on your compile line:
    CC -mt blahblahblah...

  • I need a timer function to ping the server every 5 secs??using threads.

    I need a timer function to ping the server every 5 secs??
    using threads...i have to use a thread coz i cant use Timer and Timer Task coz clients r on the JDK1.2 version.I have created a thread which keeps checking th ping msg & any server msg is pings 4 the1st time properly but then it just waits to read the response from server but it doesnt but the server shows that it has send the msgs to client???PLEASE HELP URGENT

    Few things are not clear from your post, like, are you using sockets and if you are, how are u reading writing to them (ur sample code would help)...
    Anyways if you are, are you doing accept on your socket in a while(true) loop or just once... If you do it only once you will get the first ping message but none afterwards if the other side closes and opens new sockets for every send... What I am suggesting is something like the following:
    ss = new ServerSocket(port);
    while(true)
         s = ss.accept();
         is = s.getInputStream();
         os = s.getOutputStream();
         reader = new BufferedReader(new InputStreamReader(is));
         writer = new BufferedWriter(new OutputStreamWriter(os));
         String in = reader.readLine();
            // do something with this string
            s.close();
            // put some check here to break out of this infinite loop
    }// end of While

  • MULTIPLE LEAD TIME FUNCTIONALITY

    Hi Guys,
    can anyone explain about "Multiple lead time functionality in SAP".
    whether its related to any particular modules.pls provide any inputs or send some link were i can get this requirements,

    hi
    please refer to this document
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/e0901cba-f49e-2910-748c-d7ce4c0c4c1c
    you may find it helpful
    regards
    Aakash Banga

  • How to implement the function "Slow Play" using MPMoviePlayerController?

    Does anybody have idea to implement the function "Slow Play" using MPMoviePlayerController or some other indirect solutions? Thanks. Kevin.

    You can use the changeSelection(...) method to change the cell with focus.

  • In the numbers app, using the "date and time" function, is it possible to remove the time? I need to put together a list of dates, but I don't need or want times.

    In the numbers app, using the "date and time" function, is it possible to remove the time? I need to put together a list of dates, but I don't need or want times.

    When formatting your column to date/time, pick Date & time, and then pick the letter i in the circle to the right. Then scroll down and pick "No time"
    Jason

Maybe you are looking for