Help needed with Timer class

Hi there, could any body tell me if this is a bug with AS3
Timer class? Right now I'm developing a player with slow motion
capability using AS3, streaming from FMS3. Basically I used an
instance of Timer class to toggle play/pause at different
intervals. However, after doing some stress test (click slow then
play repeatedly fast), the flash player goes into a state in which
the video streams keeps going at slow motion and cannot be stopped
even with ns.close(). I called Timer.stop() whenever switching out
of slowmo and even removed the event. However as I was tracing it,
at the non-stoppable state, something is still calling the timer
and its handling function while Timer.running and
Timer.hasEventListener both returns false. I'm quite sure there's
nothing else that calls this specific timer handler.
Moreover, just out of curiosity, I changed my code and used
setInterval() method instead and the problem's gone. Would anybody
tell me if there's a bug with the Timer class or a bug in my own
code? I'm reluctant to go with setInterval() for good since Timer
class looks more elegant.
Thanks a lot!

Thanks, kglad! That was exactly my first thought. I made sure
I only used 1 timer object. Also, the strange thing is, the player
USUALLY works fine. It only breaks down after a a stress test I
described before. Any other suggestion on what I should do? Is
there a way to check who's dispatching the timer event?

Similar Messages

  • Help needed with timer codes

    i have tried to do a countdown timer but can't debug it.. can anyone help me with it or can anyone provide me with the correct coding for countdown timer..
    import java.awt.*;
    import java.Swing.*;
    import java.util.*;
    import java.awt.*;
    import java.Swing.*;
    import java.util.*;
    public class timer
         public static void main (String [] args)
              double sec = 150;
              countDown(sec);
         private Thread countDown(double seconds)
            final double time = seconds;
            Runnable runnable(){
                   public void run(){
                  try{
                    Thread.sleep(time * 1000);
                  }catch(Exception e){}
            return new Thread(runnable);
         public  void displayCountDown(){
           int seconds = 22;
           for(int i = 0; i < seconds; i++){
             Thread trd = countDown(i);
             trd.start(){
             while(trd.isAlive()){
               ; // wait
             System.out.print('\r');
             System.out.print(i);
    }

    I would suggest using javax.swing.Timer or java.util.Timer instead of implementing it yourself.

  • Help needed with Time Machine multiple drives set up

    Hello, I need help in finding out if what I want to do is possible.
    I upgraded to Mountain Lion today as I understood it can handle multiple back up drives. I see how to add a 2nd back up drive, however I do not see a way to put different folders onto different drives.
    iMac - backed to a 3TB DRIVE A via the time machine
    iPhoto Library original file - already on the 3TB DRIVE A - so no back up for now!
    What I'd like to do is to also back up only the iPhotoLibrary file to a 2nd drive - lets call it 3TB DRIVE B
    Can it be done with Mountain Lion or not really? I don't even seem to be able to exclude files from an External Disk actually.
    Any other software I could use that would do the trick?
    Or do I have to rearrange our already messy set up? I've put the iPhoto Library on the DRIVE A as its a faster drive. but I guess the solution would be to put the iPhoto Library original file onto the slower Drive B and only keep the iPhoto file on it?
    Hmm any help or tips greatly appreciated.
    Thank you in advance.
    Marta

    Sharlo wrote:
    So here's my question: After reinstalling system TM started normal back-up procedure and I get message not enough space on external disk. I use 200Gb for around 100Gb that I have on my computer (I know not so much but works well for me). What I do not get is why does TM need around 30% more space compared to the space I'm using (wants to back-up 130Gb) and why is it not backing-up the system I've just installed but tries to back-up everything from scratch? Is there a procedure to back-up only changed files since the last version?
    Ordinarily, that's exactly what TM does. But this situation isn't ordinary. Everything you restored is considered "*new to that disk"* and will be backed-up again. See #14 in the Frequently Asked Questions *User Tip* at the top of this forum, and http://support.apple.com/kb/TS1338
    The 30% you ask about is actually 20%; the initial estimate of the space needed might be low, and TM needs workspace on the TM disk, so it adds 20% (see #7 in the FAQ Tip.)

  • Help needed with collection classes

    Howdie all,
    I'm new to Java, and for the most part, I can do it.
    I'm stuck on how to do the following:
    I have to write a program that simulates a deck of cards, including shuffling (involving cards are re-collected), dealing cards. I have to create 52 objects of the card class. The only things that I can use involve some of the collection classes (arrays, dynamic lists, vectors, dictionaries), queues/stacks
    I dont know:
    ** what to use. should i use a dyn list or a vector
    **how the heck would i shuffle the cards?
    ** for dealing the cards, i figued i would just use a loop to draw a set of cards (face and suit)
    i am not asking for code on how to do it (though pseudo-code/alogorithm may help). i just dont know where to start..i am totally stuck.
    thanks a bunch!

    I would suggest you to use the LinkedList class for the deck representation.
    To create the cards you could use
    for i = 0 to 51
    new Card(i);
    In Card constructor do something like
    int colour = i/13+1; // (1-4, one for each colour)
    int value = i%13+1; // (1-13, ace-king)
    To shuffle you could
    for i = 0 to 100
    j = radom(52)
    k = random(52)
    swap(card#j, card#k)
    This will swap 2 random cards 100 times.
    To draw cards
    Card c = cards.remove(0)
    or
    Card c = cards.remove(radom(cards.size()))
    In the later, the shuffle part is not really needed.
    thought about this some more and now i have another
    question:
    when using a dyn linked library, i am not even sure
    how to create the 52 objects. previously when doing
    project like this, i just used a random function to
    generate the cards, and used switch statements for the
    non-numbered cards and for the suite. how would i do
    accomplish this when using a collection class?
    Howdie all,
    I'm new to Java, and for the most part, I can do it.
    I'm stuck on how to do the following:
    I have to write a program that simulates a deck of
    cards, including shuffling (involving cards are
    re-collected), dealing cards. I have to create 52
    objects of the card class. The only things that Ican
    use involve some of the collection classes (arrays,
    dynamic lists, vectors, dictionaries),queues/stacks
    I dont know:
    ** what to use. should i use a dyn list or avector
    **how the heck would i shuffle the cards?
    ** for dealing the cards, i figued i would just usea
    loop to draw a set of cards (face and suit)
    i am not asking for code on how to do it (though
    pseudo-code/alogorithm may help). i just dont know
    where to start..i am totally stuck.
    thanks a bunch!

  • Help needed with time capsule

    I have a 3tb Time capsule and Mac set up with Virgin Hub
    Back ups work fine but most times i try to acces anything on the time capsule it comes up with not available
    It works if i restart or boot through airport utilty
    I have the data file with a music sub folder and have a 1 drive plugged to usb both of which seem to be a little to illusive
    can you help
    Thanks
    n

    This is a bug on Lion and 7.6 firmware and greater on the TC..
    There is no fix.. Ring applecare and ask why it does that.
    I suspect Apple will have no idea. Although we have plenty of posts here with the same issue.
    I can suggest a bunch of stuff.. nothing from what I gather is a cure.. but it might help.. perhaps this will be auto fixed in ML.
    I stick with SL as it has decent networking btw.. and no issues.. !! If you are still on SL you should not have issues if you go back to 7.5.2 firmware on the TC.
    First off, tell us a bit more.
    Is the TC part of the network, bridged or router or setup independently of the network. Not sure what the virgin hub is.. but please describe the network a bit more.
    Try going back to 7.5.2 firmware.  Apparently can be very difficult for the most recent versions of TC but if you run lion you should also try it.. download the 5.6 airport utility if not already using that, and try to go back to earlier firmware.
    Other things..
    Reset the TC and use short no spaces names for TC and wireless. Pure alphanumeric.. no special characters. Is the TC main router.. ?? set the dhcp server to short lease time. Like 10min.. if the virgin hub is the router do the same in that.
    Are you connecting by wireless.. ?? Lock the wireless channels and use different name for 5ghz from 2.4ghz to prevent wireless clients jumping around.
    When you lose the TC next time.. open terminal and ping it.. by name and ip address.. tell me what happens.

  • Help needed with Time Machine

    I've installed Boot Camp because I wanted to play an old game. I understood eventually that laptops are not made for that purpose (my one year old MBP was heating too often and I didn't like that). Unfortunately even during that period I've started experiencing some oddness when switching to Snow Leopard 10.6.2. Eventually I've decided to uninstall Windows and after three hours playing with Snow Leopard in order to make it as it was before I understood I'm not qualified enough to mess with plists and I do not know what else, so brut force solution - reinstalling entire system from the Time Machine.
    Everything now works very fast, very nice, I've saved time doing that (soooo happy TM saved my life ... again).
    So here's my question: After reinstalling system TM started normal back-up procedure and I get message not enough space on external disk. I use 200Gb for around 100Gb that I have on my computer (I know not so much but works well for me). What I do not get is why does TM need around 30% more space compared to the space I'm using (wants to back-up 130Gb) and why is it not backing-up the system I've just installed but tries to back-up everything from scratch? Is there a procedure to back-up only changed files since the last version?
    What I'm doing know is just saving old back-up on a second external drive (just in case if something goes wrong) and I'll "clean" my primary TM disk and then install again ... of course if somebody knows how to force TM to back-up only the files that changed ...
    Thanks in advance and cheers,
    Sharlo

    Sharlo wrote:
    So here's my question: After reinstalling system TM started normal back-up procedure and I get message not enough space on external disk. I use 200Gb for around 100Gb that I have on my computer (I know not so much but works well for me). What I do not get is why does TM need around 30% more space compared to the space I'm using (wants to back-up 130Gb) and why is it not backing-up the system I've just installed but tries to back-up everything from scratch? Is there a procedure to back-up only changed files since the last version?
    Ordinarily, that's exactly what TM does. But this situation isn't ordinary. Everything you restored is considered "*new to that disk"* and will be backed-up again. See #14 in the Frequently Asked Questions *User Tip* at the top of this forum, and http://support.apple.com/kb/TS1338
    The 30% you ask about is actually 20%; the initial estimate of the space needed might be low, and TM needs workspace on the TM disk, so it adds 20% (see #7 in the FAQ Tip.)

  • Help needed with "Time Machine could not complete the backup" because it is too large

    I'm receiving "Time Machine could not complete the backup" because it is too large for the backup disk. I have a 500 GB Time Capsule 802.11n (2nd Gen) and a MacBook Pro running on 10.6.8. I just replaced my laptop's original hard drive with a new 1 TB and restored that with what was on my Time Capsule. Now, I have no backups on my Time Capsule prior to the new hard drive. When I click get info on my hard drive, it states only 296 GB of the 1 TB is used. However, the Time Machine error message states that the backup requires 315 GB but only 221 GB are available. It has deleted all of my old backups, so I would think my Time Capsule should have plenty of room to backup the 296 GB on my computer. Is my old backup from my prior hard drive stuck on the Time Capsule and instead of Time Machine trying to just update those files, it is preserving the old hard drive backup separately and trying to make a new backup of my new hard drive using the remaining space? If so, how do I fix this? Any advice greatly appreciated.

    Have you read for possible solutions over in the "More Like This" thread over here?----------------------->
    Research TM Knowledge Base Articles?

  • Help needed with SimpleDateFormat class

    I am trying to do this:
    try {
    SimpleDateFormat df = new SimpleDateFormat("MM/dd/yyyy");
    expirationDate = df.parse(expirationDateStr);
    }catch (ParseException e)
    The problem I am having is it takes in dates like 15/6/2004 and converts it into 3/6/2005. Doesn't java provide validation for that? Do I need to do the validation myself for months and dates?
    Your help is appreciated. Thanks!

    Cool Thank you..That worked..

  • Help needed with runtime class

    i m trying to execute some script by calling the exe to execute it through runtime.exec. it works fine when the script that does not use any library, but if it is using any then it will returns null.
    Example:
    public static void main(String args[])
    Runtime r=Runtime.getRuntime();
    p=r.exec(new String[]{"c:/perl/bin/perl.exe","c:/try.pl"});     
    BufferedReader d= new BufferedReader(new InputStreamReader(p.getInputStream()));
    System.out.println(d.readLine());
    if try.pl is as following then it prints hello world
    print "hello world"
    but if it is as following then it prints null
    require "cgi-lib.pl"
    print "hello world"     
    so how can i execute scripts with libraries?????????

    I don't know Perl but I guess that "require" means the Perl program has to look somewhere else to find another script, or something like that. You know Perl... where does it look? If your answer is that it looks in the current directory, then why haven't you set the current directory?

  • Help needed with java

    Hello everyone
    I'm a Student and new to java and I have been given a question which I have to go through. I have come across a problem with one of the questions and am stuck, so I was wondering if you guys could help me out.
    here is my code so far:
    A Class that maintains Information about a book
    This might form part of a larger application such
    as a library system, for example.
    @author (your name)
    *@version (a version number or a date)*
    public class Book
    // instance variables or fields
    private String author;
    private String title;
    Set the author and title when the book object is constructed
    public Book(String bookAuthor, String bookTitle)
    author = bookAuthor;
    title = bookTitle;
    Return The name of the author.
    public String getAuthor()
    return author;
    Return The name of the title.
    public String getTitle()
    return title;
    and below are the questions that I need to complete. they just want me to add codes to my current one, but the problem is I don't know where to put them and how I should word them, if that makes sense.
    Add a further instance variable/field pages to the Book class to store the number of pages in the book.
    This should be of type int and should be set to 0 in the Constructor.
    Add a second Constructor with signature
    public Book(String bookAuthor, String bookTitle, int noPages) so it has a third parameter passed to it as well as the author and title;
    this parameter is used - obviously?? - to initialise the number of pages.
    Note: This is easiest done by making a copy of the existing Constructor and adding the parameter.
    Add a getPages() accessor method that returns the number of pages in the book.
    Add a method printDetails() to your Book class. This should print out the Author title and number of pages to the Terminal Window. It is your choice as to how the data is formatted, perhaps all on one line, perhaps on three, and with or without explanatory text. For instance you could print out in the format:
    Title: Robinson Crusoe, Author: Daniel Defoe, Pages:226
    Add a further instance variable/field refNumber() to your Book class. This stores the Library's reference number. It should be of type String and be initialised to the empty String "" in the constructor, as its initial value is not passed in as a parameter. Instead a public mutator method with the signature:
    public void setRefNumber(String ref) should be created. The body of this method should assign the value of the method parameter ref to the refNumber.
    Add a corresponding getRefNumber() accessor method to your class so you can check that the mutator works correctly
    Modify your printDetails() method to include printing the reference number of the book.
    However the method should print the reference number only if it has been set - that is the refNumber has a non-zero length.
    If it has not been set, print "ZZZ" instead.
    Hint Use a conditional statement whose test calls the length() method of the refNumber String and gives a result like:
    Title: Jane Eyre, Author: Charlotte Bronte, Pages:226, RefNo: CB479 or, if the reference number is not set:
    Title: Robinson Crusoe, Author: Daniel Defoe, Pages:347, RefNo: ZZZ
    Modify your setRefNumber() method so that it sets the refNumber field only if the parameter is a string of at least three characters. If it is less than three, then print an error message (which must contain the word error) and leave the field unchanged
    Add a further integer variable/field borrowed to the Book class, to keep a count of the number of times a book has been borrowed. It should (obviously??) be set to 0 in the constructor.
    Add a mutator method borrow() to the class. This should increment (add 1 to) the value of borrowed each time it is called.
    Include an accessor method getBorrowed() that returns the value of borrowed
    Modify Print Details so that it includes the value of the borrowed field along with some explanatory text
    PS. sorry it looks so messey

    1. In the future, please use a more meaningful subject. "Help needed with java" contains no information. The very fact that you're posting here tells us you need help with Java. The point of the subject is to give the forum an idea of what kind of problem you're having, so that individuals can decide if they're interested and qualified to help.
    2. You need to ask a specific question. If you have no idea where to start, then start here: [http://home.earthlink.net/~patricia_shanahan/beginner.html]
    3. When you post code, use code tags. Copy the code from the original source in your editor (NOT from an earlier post here, where it will already have lost all formatting), paste it in here, highlight it, and click the CODE button.

  • HELP NEEDED WITH ADDAPTER-DVI TO VGA.

    PLEASE ...HELP NEEDED WITH WIRING CROSS OVER....CAN YOU HELP WITH BACK OF PLUG CONNECTIONS...I SORTA UNDERSTAND THE PINOUTS BUT CANT MAKE AN EXACT MACH...WOULD LIKE TO BE 100% SURE...
    ......THIS ENSURES NO SMOKE!!!                                                                                           
    THE CARD IS AN ATI RADEON RX9250-DUAL HEAD-.........ADDAPTER IS DVI(ANALOG)MALE TO VGA(ANALOG)FEMALE.
    ANY HELP VERY MUCH APPRECIATED........ SEEMS YOU NEED TO BE ROCKET SCI TO ATTACH A BLOODY PICTURE...SO THIS HAS BEEN BIG WASTE OF FING TIME!

    Quote from: BOBHIGH on 17-December-05, 09:21:31
    Get over it mate !
    I find it easy t read CAPS...and if you dont like it ...DONT READ IT!
    And why bother to reply...some people have nothing better to do.
    Yes there chep and easy to come by...Ive already got a new one.
    All I wanted was to make a diagram of whats inside the bloody thing...it was a simple question and required a simple answer.
    NO NEED TO A WANKA !!
    I feel a bann comming up.
    Have you tryed Google ? really.. your question is inrelevant. No need to reply indeed.
    Why do you come here asking this question anyway ? is it becouse you have a MSI gfx card ? and the adapter has nothing to do with this ?
    You think you can come in here yelling.. thinking we have to put up with it and accept your style of posting. This is not a MSI tech center.. it's a user to user center.. Your question has nothing to do with MSI relavant things anyway's.
    Google = your friend.
    Quote from: BOBHIGH on 17-December-05, 09:21:31
    it was a simple question and required a simple answer
    Simple for who ? you (buying a new one) ? me ? we ?   .really...........
    Quote from: Dynamike on 16-December-05, 04:11:48
    1: There are allot of diffrent types of those adapters.
    If any of the mods have a problem about my reply.. please pm me.

  • Help needed with itunes

    help needed with itunes please tryed to move my itunes libary to my external hard drive itunes move ok and runs fin but i have none of my music or apps or anything all my stuff is in the itunes folder on my external hard drive but there is nothing on ituns how do i get it back help,please

    (Make sure the Music (top left) library is selected before beginning this.)
    If you have bad song links in your library, hilite them and hit the delete button. Then locate the folder(s) where your music is located and drag and drop into the large library window in iTunes ( where your tracks show up). This will force the tunes into iTunes. Before you start, check your preferences in iTunes specifically under the"Advanced" tab, general settings. I prefer that the 1st 2 boxes are unchecked. (Keep iTunes Music folder organized & Copy files to iTunes Music folder when adding to library). They are designed to let iTunes manage your library. I prefer to manage it myself. Suit yourself. If there is a way for iTunes to restore broken links other than locating one song at a time I haven't found it yet. (I wish Apple would fix this, as I have used that feature in other apps.) This is the way I do it and I have approx. 25,000 songs and podcasts and videos at present. Hope this helps.

  • Help needed with Elements 5.0

    Trying to Edit photos.  Click on Edit icon and I get the Message " Attempt to Access invalid address".  Click OK get message "Unable to connect to editor application.
    What is the problem?   I have unenstalled to program and reinstalled, I have tried repairing from CD.  Nothing works.  Please help.

    I have the disc and re-installed a couple of time. No positive result. PSE 09 which I bought thereafter is giving a lot of problems also!!!
    Date: Wed, 8 Jun 2011 10:31:24 -0600
    From: [email protected]
    To: [email protected]
    Subject: Help needed with Elements 5.0
    Doesn't really help either of us very much but I'm also having the same problem with Elements 5. I downloaded the program so I don't have disks to reinstall. And it seems from the other reply that Adobe has given up with the "old program," which incidentally was working fine until two days ago. Maybe I'll have to think about PSE9!
    >

  • Help needed with BBDM 5.0.1 IP Modem

    Hi I was happily connecting thru the Net via the IP Modem in BBDM ver 5.0.1 all this while. Only this happened yesterday. Accidentally during the connection, my 9500 was disconnected from the USB cable. From that moment on, I cannot access the Net using the IP Modem feature. Tried to reboot the laptop as well as the 9500 but now all I get is the connecting message and then a pop up saying there is a hardware failure in the connecting device (or modem) ie the BB 9500.
    I even uninstalled BBDM 5.0.1 and reinstalled ver 5.0 and also updated back to 5.0.1 - same story. I can still access the Net via the BB browser etc
    Advise please thanks in advance

    I have the disc and re-installed a couple of time. No positive result. PSE 09 which I bought thereafter is giving a lot of problems also!!!
    Date: Wed, 8 Jun 2011 10:31:24 -0600
    From: [email protected]
    To: [email protected]
    Subject: Help needed with Elements 5.0
    Doesn't really help either of us very much but I'm also having the same problem with Elements 5. I downloaded the program so I don't have disks to reinstall. And it seems from the other reply that Adobe has given up with the "old program," which incidentally was working fine until two days ago. Maybe I'll have to think about PSE9!
    >

  • Help needed with Vista 64 Ultimate

    "Help needed with Vista 64 UltimateI I need some help in getting XFI Dolby digital to work
    Okay so i went out and I bought a yamaha 630BL reciever, a digital coaxial s/pdif, and a 3.5mm phono plug to fit perfectly to my XFI Extreme Music
    -The audio plays fine and reports as a PCM stream when I play it normally, but I can't get dolby digital or DTS to enable for some reason eventhough I bought the DDL & DTS Connect Pack for $4.72
    When I click dolby digital li've in DDL it jumps back up to off and has this [The operation was unsuccessful. Please try again or reinstall the application].
    Message Edited by Fuzion64 on 03-06-2009 05:33 AMS/PDIF I/O was enabled under speakers in control panel/sound, but S/PDIF Out function was totally disabled
    once I set this to enabled Dolby and DTS went acti've.
    I also have a question on 5. and Vista 64
    -When I game I normally use headphones in game mode or 2. with my headphones, the reason for this is if I set it on 5. I get sounds coming out of all of the wrong channels.
    Now when I watch movies or listen to music I switch to 5. sound in entertainment mode, but to make this work properly I have to open CMSS-3D. I then change it from xpand to stereo and put the slider at even center for 50%. If I use the default xpand mode the audio is way off coming out of all of the wrong channels.
    How do I make 5. render properly on vista

    We ended up getting iTunes cleanly uninstalled and were able to re-install without issue.  All is now mostly well.
    Peace...

Maybe you are looking for

  • Slow System reset

    I have been running a system reset for over 4 hours now and it's still on 7%. What do I do? It's a hp envy core i7....kindly help

  • AS2 SSL Error

    Hi Experts, Has anyone encountered this error before? SEEBURGER AS2: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection? # Regards,

  • CSS won't do what it's supposed to

    I'm doing the David Powers tutorial and everything was fine except at the very end. At the bottom of the page there are 3 columns that are stacked and the idea is to move them side by side. I followed the instructions and the result should have been

  • My final cut keep on shutting off..please help!

    Hi, Everytime I open my final cut it asks for a registration and then it shuts off. I own the program, but, I can't get back into it. Please help. Thank you! Renee

  • Safari, app store, messenger and mail all not working on mavericks

    None of these will connect with the exception of mail connecting sometimes. Ive tried restarting, chaning the DNS go 8.8.8.8. and a few other things and nothing has workd. Im typing this from chrome which works totally fine and my other computers wor