SetInterval complications when interacted by buttons: Mac 10.4, CS3, AS2

I have a slideshow I've built that uses setInterval to pause at each image. At each paused keyframe, a short animation plays (the animation is contained within an object which only exists at the single keyframe).
The problem I used to have was that after the first time around (all images shown), the slideshow begins increasing in speed (not pausing for the full duration),  and eventually begins sparadically skipping pauses all-together. I rearranged the code, and fixed the speed-up/skipping problem, but now my advance and goBack buttons don't work right, and they cause skipping.
My old code, which had working buttons but sped-up/skipped, is as follows:
//code at each keyframe
var myInterval = setInterval (pause_fnc, 5000);
function pause_fnc () {     
     if (_currentframe !== _totalframes) {
          gotoAndPlay (_currentframe + 1);
     } else {
          gotoAndPlay (2);
     clearInterval (myInterval);
//Code on the advance button
on (release) {
     clearInterval(myInterval);
     backup = false;
     gotoAndPlay (_currentframe +1);
But as i said, the previous code, would skip and speed up after the first time through the full project.
So I rewrote the code as such:
//Code at initial Keyframe.
//Each keyframe that needs to pause, from then on uses wait();
function wait() {
     clearInterval(myInterval);
     stop();
     var myInterval = setInterval(function () {
          gotoAndPlay(_currentframe + 1);
          clearInterval(myInterval);
          }, pauseTime);
wait();
But now, like i said, I don't know what code to put on my buttons. I don't know how to clear the interval of a nested function.
Please help,
Jeff

don't nest your setInterval() functions and clear each before setting.

Similar Messages

  • Detecting when Interactive Download button is pressed

    My company wants me to trap and log when users click on the Interactive DownLoad button. Is there a way to know when this happens?
    I checked usage stats, the dbug log. I also checked possible Dynamic event options.
    Thanks

    this should be in 8.2
    Harold Timmis
    [email protected]
    Orlando,Fl
    *Kudos always welcome
    Attachments:
    RandomNumberSubVI.vi ‏8 KB
    savefilewhenselected.vi ‏11 KB
    f.txt ‏1 KB

  • My Wireless mac keypad has stopped properly working. The keys sometime do not correspond to the result, or a a simultaneous duel actio, for example when the delete button is pressed the. Ursor does go backwards, but it also turns the sound up. Any ideas?

    My Wireless mac keypad has stopped properly working. The keys sometime do not correspond to the result, or a a simultaneous duel actio, for example when the delete button is pressed the. Ursor does go backwards, but it also turns the sound up. The keyboard is properly connected to the computer, and the battery life is up in the nineties.
    Help please !!!!

    Hi, thankyou for your response. Can I just confirm that you mean turning the computer on and off again, or re-booting the whole system. If it is the first I have already turned the system on and off, with no luck.
    Regards

  • HT1310 when i starst my mac i get a flashing folder with a question mark. i tried rebooting and holding the option button then i get 2 boxes, one with a refresh arrow and one with a forward arrow neither of them seem to do anything. now what

    when i starst my mac i get a flashing folder with a question mark. i tried rebooting and holding the option button then i get 2 boxes, one with a refresh arrow and one with a forward arrow neither of them seem to do anything. now what

    Here is an article that describes what it is supposed to do:
    Startup Manager: How to select a startup volume
    If no Volumes are shown, it is telling you there are no potentailly bootable Volumes attached. That means your boot drive has died or the bootable image on it is unrecognizable.
    What Mac Pro ? by year, GHz, number of processors, screen size?
    What Mac OS X ?

  • I solve my problem of black screen when starting up my Mac pro, namely by the button lighting and then i saw the login screen. Hopefully it works for you too.

    I solve my problem of black screen when starting up my Mac pro, namely by using the lighting button and then i saw the login screen. Hopefully it works for you.

    It was the PRAM.

  • When I start my mac book pro the screen flashes on and off and then a blue color before it open to the log in screen. Sometime a program will shot down buy it's self without me clicking the quit button. Help?!

    When I start my mac book pro the screen flashes on and off and then a blue color before it open to the log in screen. Sometime a program will shot down buy it's self without me clicking the quit button. Help?!

    If you keep getting a 'red' message it means that the HDD is faulty and will have to be replaced.  You will have to format the new HDD in Disk Utility>Erase and then install the OSX and your data from Time Machine.
    Ciao.

  • When I started my Mac the screen was white with the Apple logo and power motion icon running.  I attempted to turn off Mac then a message stating "Debugger called:  Button SCI . Also "Waiting for remote debugger connection."  What is my next step?

    When I started my Mac the screen was white with the Apple logo and power motion icon running.  I attempted to turn off Mac then a message stating "Debugger called:  <Button SCI>. Also "Waiting for remote debugger connection."  What is my next step?

    Hi , and a warm welcome to the forums!
    Could be many things, we should start with this...
    "Try Disk Utility
    1. Insert the Mac OS X Install disc, then restart the computer while holding the C key.
    2. When your computer finishes starting up from the disc, choose Disk Utility from the Installer menu at top of the screen. (In Mac OS X 10.4 or later, you must select your language first.)
    *Important: Do not click Continue in the first screen of the Installer. If you do, you must restart from the disc again to access Disk Utility.*
    3. Click the First Aid tab.
    4. Select your Mac OS X volume.
    5. Click Repair Disk, (not Repair Permissions). Disk Utility checks and repairs the disk."
    http://docs.info.apple.com/article.html?artnum=106214
    Then try a Safe Boot, (holding Shift key down at bootup), run Disk Utility in Applications>Utilities, then highlight your drive, click on Repair Permissions, reboot when it completes.
    (Safe boot may stay on the gray radian for a long time, let it go, it's trying to repair the Hard Drive.)
    If perchance you can't find your install Disc, at least try it from the Safe Boot part onward.
    If 10.7.0 or later...
    Bootup holding CMD+r, or the Option/alt key to boot from the Restore partition & use Disk Utility from there to Repair the Disk, then Repair Permissions.
    And sorry to report that OSX is more Widows like than ever, but….
    If that doesn't help Reinstall the OS.

  • Iphoto gives message "no images were selected" when hit print button.  Yet the the images are clearly selected in the print window.  I've printed hundreds of images without a problem before.  Iphoto 6.0.6, MAC 10.5.8

    Iphoto gives message "no images were selected" when hit print button.  Yet the the images are clearly selected in the print window.  I've printed hundreds of images without a problem before.  Iphoto 6.0.6, MAC 10.5.8, Suggestions?

    I have recently started having this problem in PSE8. The Adobe workaround
    did work, but I don't fancy having to re register each time I use it.
    What I have discovered is that it's nothing to do with the image metadata as it occurs before any image is opened.
    It SEEMS to only occur if you use file/open with to open an image in the editor - IE start PSE with that command.
    If you close elements down, and start it using programs/PSE/Elements (or your desktop shortcut) - the panorama feature magically works.
    Each time I've opened the editor 'automatically' using image/open with, it seems to create the problem.
    Hope this helps

  • My mini ipod appears off and not respond to any commands when pressed the buttons to reset, apple logo appeared and then the apple support site and it shuts down. already tried all the steps, but none worked, and when I plug it into my computer it does no

    My mini ipod appears off and not respond to any commands when pressed the buttons to reset, apple logo appeared and then the apple support site and it shuts down. already tried all the steps, but none worked, and when I plug it into my computer it does not appear in the iTunes bar. what do I do?

    If MacKeeper corrupted the Recovery partition then even I underestimated its potential for damage. Garbage "cleaning" apps will cause misery but I have not found that the Recovery partition to have been affected by using MacKeeper or anything like it. I doubt that it did so, but I have learned not to underestimate the potential for such things to result in system corruption.
    Before concluding your Mac has a hardware failure, try booting OS X Internet Recovery by holding command option r on startup (three fingers). That will force your iMac to bypass the Recovery partition altogether, and convey the ability to create a new one.
    An Internet connection will be required (wired or wireless).
    At the Mac OS X Utilities screen, select Disk Utility. Select your startup volume (usually named "Macintosh HD") and click the Repair Disk button. Describe any errors it reports in red. If Disk Utility reports "The volume Macintosh HD appears to be OK" in green then you can be reasonably (though not completely) assured your hard disk is in good working order.
    Assuming the HD remains usable you can then use Disk Utility to erase it. Reinstall OS X, restore your essential software and other files, and don't reinstall the junk.

  • When i active my mac pro all i get is a white screen and  it loading .. and when it fully loaded it turns off and the same thing keep on happening again

    when i active my mac pro all i get is a white screen and  it loading and when it fully load its turn off , and it keep on doing the same thing for hours

    Hi Shahenaz,
    It's a little difficult to understand exactly what's going on with your mac based on the description you gave. Is there anything else you could add? Is it stuck in a reboot loop? Or is it just showing a white screen forever?
    I had pretty much the same problem a few days ago, and was worried my mac was screwed permanently, but I got it fixed up no problem!
    Follow these steps to try and troubleshoot/fix the problem.
    1. Boot into OSX Recovery Mode
    First, turn off your Mac. If it isn't responding, or is stuck in a reboot loop, just hold down the power button until it turns off, and you hear the fans stop. Then boot it while holding the Command and R keys. If it successfully boots into OSX Recovery Mode, continue with this step. If not, skip to step two. (My Mac couldn't successfully boot into the recovery mode, so I had to go to step 2)
    Select "Disk Utility" from the list of options, and find your built in hard drive from the list on the left. Usually there are two listings/names for your drive. The first should be something like "500GB longchainoflettersnumbers Media". Then the one below will be a little easier on the eyes, named Macintosh HD, if you haven't changed its name. That's the one you want, click it.
    Now go to the "First Aid" tab. Click on the "Verify Disk" button in the bottom right corner, and let it do its thing. Once that's done, hit repair disk, also in the bottom right corner. If your disk is corrupted, you may need to run the repair process several times, before it comes up completely clean.
    Once this is done, select Shut Down from the Apple menu and, once your Mac is completely off, turn it back on like normal. If it works, great. If not, proceed to step two.
    2. SafeBoot
    Sometimes, when a mac is acting up and doesn't want to start, all it takes is a safe boot, followed by a regular restart. Or maybe you recently installed a program that either has malicious or errored coding that's causing your troubles. This is where Safe Boot comes in.
    Turn off your mac, and reboot it while holding Shift. (If you want to see the process that's going on in the background, boot while holding Shift, Command, and V. This will enter something called Verbose Mode).
    If it boots successfully into Safe Mode, great. If you believe that there's a particular program that you recently downloaded that might be causing your trouble, now's the time to delete it. If not, just reboot normally and see if it works! If it doesn't, or if your Mac didn't even Safe Boot like mine, proceed to step 3.
    3. Fsck!
    For this step, you're going to be booting your mac into Single User Mode. I'm not going to go into details as to what this step does, but it works for some people. Here are the steps.
    Turn off your mac, and reboot it while holding Command and S. The screen should go black, and you'll see some white text run across the screen, wait a few seconds, until you see the command prompt. Now type
    fsck -fy
    and hit the Enter key. This will run a series of system checks, which could take a few minutes. Be patient on this part. Once it's done, it will show one of two messages:
    1. "The volume (your Mac) appears to be OK
    or
    2. "File System Was Modified"
    If you got message 1, type reboot and press Return. Hopefully your computer works after this - if not, proceed to step 4.
    If you got message 2, run the same command again until you get message 1. If it doesn't seem to be working, turn off your system and proceed to step 4.
    If you couldn't even boot into Single User Mode in the first place (like me), go to step 4 anyways.
    Step 4: Reset the NVRAM
    The NVRAM is another kind of RAM that stores data like the computer volume you had set before you turned it off, or the screen brightness, resolution etc. This memory is saved, unlike with regular RAM. Resetting it isn't harmful to your system, it will just put your screen brightness, volume, etc. to defaults.
    Turn off your Mac, and reboot while holding Command, Option, P, and R, and continue holding them down until you hear the computer restart again.
    I can't really explain why to do this step, I just know it works for some people, and seems to be what unbricked my MacBook Pro. If none of these steps, fixed your Mac, well the situation is looking pretty grim. Try setting up a meeting with a Mac Genius at your local Apple store. However, I know that many other people with these symptoms ended up having a logic board failure. Apple can swap out your logic board for a new one, but the price is pretty hefty, somewhere around $300 I believe.
    Well I wish you luck, I hope this helped you!

  • Why my screen is keeping black screen when i leave the mac book with few hr

    when i leave the mac book pro on a few hours, it kept black screen. i try to press any key and open button, it kept no response. after 3 mins, i press open button again. the mac book appear off. so i press the open button again , it open.
    do i need to change a new mac book pro in this situation? because this is my new computer, i can change a new one within 10 days.
    plz give me some suggestion, thank you!!!

    In actual fact this seems a bigger problem than I thought. Linking the two computers via the Thundernolt cable and selecting cmd F2 no longer shares the screen at all and Apple say it may not be able too in Mointain Lion - What are they playing at, hundreds of customers link computers together and share the screens - Lets hope they are wrong and tell us what we need to do other than move back to Windows.

  • Macbook pro not opening when press power button

    my mac book pro not opening when press power button even battery is full.

    I already tried with the Battery in and without but no luck. I'm sure it's not that kind of problem unfortunally

  • When I got my Mac I set up an iChat account and now i want to make a new one.  Does anyone know how to do this?

    When I got my Mac I set up an iChat account and now I want to make another one.  Does anyone know how to change it?  F

    Hi,
    After creating a  Screen Name or User ID with the relevant service you can enter this in iChat
    With iChat Open go to the iChat Menu > Preferences >Accounts
    Use the + button at the bottom of the List
    Chose from the top item whether the Account (Screen Name) you are adding is going to be AIM, (inlcuding Apple variants), Jabber (including Google variant) or in iChat 6 a Yahoo account.
    Add details as required.
    Click Done.
    10:22 PM      Thursday; December 15, 2011
    Please, if posting Logs, do not post any Log info after the line "Binary Images for iChat"
      iMac 2.5Ghz 5i 2011 (Lion 10.7.2)
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb (Snow Leopard 10.6.8)
     Mac OS X (10.6.8),
    "Limit the Logs to the Bits above Binary Images."  No, Seriously

  • When I got my Mac I set up an iChat account and now I want to make another one.  Does anyone know how to change it?  F

    When I got my Mac I set up an iChat account and now I want to make another one.  Does anyone know how to change it?  F

    HI,
    You can create and add another Screen Name to iChat.
    From iChat 4 you can have as many AIM Logins and Jabber Logins as you want.
    "AIM" in this case includes the Apple IDs (@mac.com and @me.com ending names) that also work as Valid AIM Screen Names as well as AIM registered Names.
    "Jabber Names" includes using Google Mail IDs and Facebook IDs as well as any registration with any other Jabber server.
    If you are not happy with the one you have you can delete and stop using it.
    Both Adding and Deleting are done in iChat > Preferences> Accounts.
    Highlight an Account/Name and then the minus button to delete.
    Using the Plus button show you the Add Screen.
    8:00 PM      Sunday; December 11, 2011
    Please, if posting Logs, do not post any Log info after the line "Binary Images for iChat"
      iMac 2.5Ghz 5i 2011 (Lion 10.7.2)
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb (Snow Leopard 10.6.8)
     Mac OS X (10.6.8),
    "Limit the Logs to the Bits above Binary Images."  No, Seriously

  • I have a new keyboard and two of the keys are inverted when I use my Mac -- but not on the Mac at the Apple store. The @ is where the should be and visa-versa. That is, when I type the @ I get and when I type the I get @. I am in Français numérique.

    I have a new keyboard and two of the keys are inverted when I use my Mac -- but not when they put that keyboard on the Mac at the Apple Store. The @ is where the < should be and visa-versa. That is, when I type the @ I get < and when I type the < I get @. I am in Français numérique. Thanks

    Try a SMC reset, please do it 2-3 times.
    SMC RESET
    Shut down the computer.
    Unplug the computer's power cord and all peripherals.
    Press and hold the power button for 5 seconds.
    Release the power button.
    Attach the computers power cable.
    Press the power button to turn on the computer.
    PRAM RESET
    Shut down the computer.
    Locate the following keys on the keyboard: Command, Option, P, and R. You will need to hold these keys down simultaneously in step 4.
    Turn on the computer.
    Press and hold the Command-Option-P-R keys. You must press this key combination before the gray screen appears.
    Hold the keys down until the computer restarts and you hear the startup sound for the second time.
    Release the keys.

Maybe you are looking for

  • Can anyone tell me what a refurbished ipod is?

    Something caught my eye, the refurbished ipod costs less. What is it? Is it brand new, I mean intact? And can you personalize that thing? I don't know which is a good idea to buy, a refurbished one or the normal versions... I am planning to buy the i

  • Report 9i crashes after slight changes in PL/SQL's SQL statement

    Hi, I'm using Oracle 9i Report Builder. In my Data Model I have an object (formula column) which I use PL/SQL to get a value. In the PLSQL i have 9 SQL statements which I open. It was working ok until I add the 10th stment. So, I'm wondering if there

  • Flashing question mark on startup Mac Pro 1,1

    hi everybody, I have an issue with my Mac Pro 1,1. I bought this computer last week. Occasionally, at the start up, the screen show a flashing question mark inside a folder. I know this is a HD problem. Since it doesn't show the question mark every t

  • 2 day old MacBook Pro at 98% battery capacity

    I'm a little bit concerned about the lifespan of my new MacBook Pro's battery. When i recieved the machine i performed a battery calibration as Apple recommends. I then charged and discharged again. I was concerned when Coconut battery (not always ac

  • Tuxedo compatibility with MF Cobol

    Hi, I would like to know the version of Tuxedo(6.5 or later) which will be compatible with Micro Focus Cobol v5.1 on AIX 6 and Oracle 10g. Currently we are running Tuxedo 6.5 on AIX 5, also please advise if we can continue using the same version of T