Can't get a concatenated new array to stop duplicating first element

Hi,
Am working on adapting a script for a simon-type animation, which now has 6 flashing lights/buttons on stage. The "light" sequence is stored in an array, playOrder and then playOrder.concat stores the repeatOrder.
No matter how I try to modify the arrays (shift, pop, slice, etc.), when the first flashing light is correctly clicked, the next sequence, which includes that first light, flashes it twice, before going on to flash the next light, and the next light...once. This (flashing the first light twice) only happens for the first try, after which the sequence correctly flashes each and every light, once.
Have gone over the AS3, over and over, tried setting counters and if/else, plus the array modifications (shift, pop, slice, etc.), but can't get the light flash sequence to "behave" correctly. (Can't search the array for duplicates and remove, since in the random light script, duplicates can be part of random selections.)
I'll post the latest script here in a text file, in the hope that someone can spot what I'm missing, suggest a fix: http://elearningprojects.com/AS3script.txt
Any help appreciated.
Regards,

there is nothing wrong with the array saratogacoach, I've got your code and will sort it out with you
and as for duplicating arrays
concat is apparently faster
http://swingpants.com/2009/03/12/fastest-way-to-copy-an-array-concat-or-slice0/

Similar Messages

  • I CAN'T GET THE "WHATS NEW" PAGE FROM COMMING UP FIRST. I CHANGED THE HOME PAGE IN THE PREFERENCES, IT DIDN'T HELP...

    I CAN'T GET THE "WHATS NEW" PAGE FROM COMING UP FIRST. I CHANGED THE HOME PAGE IN THE "GENERAL SETTING" IN PREFERNCES, I RESTORED THE "DEFAULT HOME PAGE" NOTHING HELPS.
    IF I CLICK IN ANY WEB LINK THE "WHATS NEW " PAGE KEEPS COMING UP FIRST. I THEN HAVE TO "X" IT OUT AND RE-CLICK ON THE WEB LINK FOR IT TO RELOAD. I HAVE TRIED EVERYTHING. WHAT THE HELL AM I DOING WRONG?

    See this article for some suggestions: [[Firefox has just updated tab shows each time you start Firefox]]
    See also http://kb.mozillazine.org/Preferences_not_saved and [[Preferences are not saved]]
    * [[How to set the home page]] - Firefox supports multiple home pages separated by '|' symbols

  • How can i get notification of new emails in Mail without having the application open?

    How can i get notification of new emails in Mail without having the application open?

    Leave Mail running, but close its window (click red dot or ⌘W).
    Right-click the Mail icon and use "Options" to enable "Open at Login".  In the "Login Items" tab of "Users & Groups" system preference, check the "Hide" box next to Mail so it doesn't open a window when starting.

  • I can't get my brand new mac mini to start up.

    The screen goes black after showing me the applie logo. It does talk to me, but without the screen, that's not much use. Any suggestions? I tried restarting several times, incl. while holding the ALT key down. Same [lack of] result.

    Kodos3000 wrote:
    I can't get my brand new MBP (OS 10.8.3) to out put 5.1 from either the Optical out or Mini-Display port to HDMI. Help .
    I've tried all suggestions and the MBP is not recognizing my Onkyo TX-SR705 which is only 3 or 4 years old.
    Could this be a HDCP problem ?
    You have 14 days to return the computer w/no questions asked.  Plus you have 90 days of FREE phone tech support on top of your standard 1 year warranty unless you also purchased AppleCare which gives you an additional 2 years of coverage plus FREE phone support.
    Strongly suggest that you take FULL advantage of the above before it runs out.  Let Apple deal w/the problems.

  • How can I get the AirPlay information box to stop floating around my screen while looking at photos?

    How can I get the AirPlay information box to stop floating around my screen while looking at photos?

    Thanks for answering
    Well, the CS2 was my 1st full program that now my son is using in his new Laptop...
    The CS4 Master Collection is my full program that I bought when I was in College course and now I use for my own works...
    Both came in their own serial numbers and discs ... I install both completely to each computer but at the end on the registration asked for this "Validation code" and the message says that I can't do it on-line nor by mail; so to call to this phone 1-800-833-6687 and in there have the message to come to the "support " Adobe website and do all this going around.
    Now I saw previously that page you send me... I really don't understand it ... I got CS2 installed but I just need the validation code to get rid of that 30 days message...
    Why I have to uninstall it??? Could you explain me please..

  • Can't get verizon community e-mail to stop...set preferences, don't work

    can't  get  verizon community e-mail to stop...set preferences, don't work...help

    Hello - can you describe which notifications that you're receiving that you'd like to stop? Also, please confirm that if you'd like to no email notifications whatsoever, every single radio button is set to "No"/"Never" on the "Your Preferences" page?
    Thanks

  • I bought a movie on iTunes and it plays half the movie and stops. I can not get it to play after it stops. What can I do to get it to play the rest of the movie?

    I bought a movie on iTunes and it plays half the movie and stops. I can not get it to play after it stops. What can I do to get it to play the rest of the movie?

    Hi, Jjenjen30. 
    Thanks for the question and I believe we have a solution.  The best option would be to delete the movie that is giving you an issue and redownload it via the iTunes store past purchase option.  I have included a couple articles that will show you how to process these steps.
    Deleting files from the iTunes library and your computer
    http://support.apple.com/kb/ht3842
    Downloading past purchases from the App Store, iBookstore, and iTunes Store
    http://support.apple.com/kb/ht2519
    If this does not resolve the issue, then iTunes might need to be notified to let them know there is a problem with the content.  I have included the steps on how to let them know.
    How to report an issue with your iTunes Store, App Store, Mac App Store, or iBookstore purchase
    http://support.apple.com/kb/HT1933
    Cheers,
    Jason H.

  • How can i get a brand new case for my iphone

    I NEED TO GET A BRAND NEW CASE FOR MY IPHONE BECAUSE MY IPHONE IS DENTED ON THE BACK AND SCRATCHES ALL OVER THE PHONE, IF SOMEONE CAN HELP ME I WILL APPRICIATED.

    You can start by not using all caps - using all caps on the internet is considered as SHOUTING and hopefully you didn't intend to be shouting at all those who read your post.
    When you say case, do you mean the iPhone casing itself?
    If so, you can contact AppleCare for a quote to repair this damage which won't be cheap. I believe there are some 3rd party repair facilities available that will do the same won't be cheap but maybe somewhat less than what Apple will charge.
    Or purchase a case for the iPhone to cover the dents and scratches and to protect it from additional damage with future drops.

  • How can I get a Brand New iPhone 3GS as a warranty replacement phone?

    4/26/2011
    Does anyone how I can get a brand new iPhone 3GS as a warranty  replacement for my iPhone 3GS? I already had the phone replaced once with a refurbished phone that has a problem with becoming frozen and unresponsive. This occurred ten times since I got the phone on 4/16/2011. I have tried doing a hard reset and have also restored the phone as a new device. I have an Apple Care plan. I am concerned that the refurbished phones will not be reliable due to my experience with the refurbished  one that I got as a replacement.
    Thanks!

    Thanks very much for your reply! I have a Genius Bar appointment today maybe they can test the phone to see if they can determine whether or not it is defective.
    Thanks Again!
    CS

  • Can't get internet with new Macbook pro

    As the title says I can't seem to get internet with my new Macbook Pro.  I get wifi fine, use the password on my router and that works, but I still can't get connected to the internet.  I know the router works, as I can use another laptop on it.  Any ideas on what to do? (other than call Apple which I'm doing when I get out of work.)

    iTunes: How to move [or copy] your music to a new computer [or another drive] - http://support.apple.com/kb/HT4527
    Quick answer if you use iTunes default preferences settings:  Copy the entire iTunes folder (and in doing so all its subfolders and files) intact to the other drive.  Start iTunes with the option (shift on Windows) key held down and guide it to the new location of the library.
    Do not confuse moving your whole folder and library with moving just media files as in
    iTunes for Mac: Moving your iTunes Media folder - http://support.apple.com/kb/HT1449
    which is what I think you did.

  • Where can i get/buy a new keyboard key retainer?

    i popped my keyboard key out so i could clean he depris underneath the keys and i accidentally snapped a tiny piece off of the white retainer....where can i get a new one?

    Try some of these sites.
    http://www.replacementlaptopkeys.com/?gclid=CIWswPPS9bkCFQ-g4AodNUMAfA
    http://www.laptopkey.com/?gclid=CNPR64vT9bkCFYWf4AodYGoAMw
    http://www.ebay.com/bhp/apple-keyboard-replacement-keys
    http://www.ifixit.com/Answers?search=key+replacement&csrf=1avmipjl4z

  • I Can't Get Apple Hot News RSS Screen Saver!

    I can't get Apple RSS screen saver! All I can get is the Wikipedia Recent Changes one and I DON'T CARE ABOUT THAT!!!!! Please help me get the Apple screen saver back like I used to have.

    I get the "Wikipedia Recent Changes (en)" screen saver instead of the Apple one.
    And when I click options, this happens:
    Now I would like some help with this if you can.

  • Can't get emails on new smartphone

    Note: This is wife's phone - I can get emails on MINE, but she can't get HER emails on HER phone (both Samsung Galaxy S5's)
    Email accounts set up automatically through phone setup (AT&T). I have put the phones side by side and made sure every setting is identical (except of course the account names, etc.)
    Her mail comes to her computer, but not to her phone.
    Strangely, I sent her a test email from my computer today, and it showed up ... but now it doesn't!
    Any ideas will be appreciated!
    Mike

    How do you check email on the computer? If you use a mail client like outlook, make sure it is set to leave mail on server. Can you see her email if you go to webmail? If webmail is empty something is removing the messages or the mail could be forwarded.

  • How can I get to my Homescreen if it stopped?

    How can I get my homescreen back if it's stopped? I tried getting to safe mode but couldn't. I changed some settings earlier. One for a magnifier and another for persons who couldn't read the screen well.

        Let's get your home screen back Vicswife! I understand that you made some changes to settings earlier. Try undoing those changes and set every back to where it was prior to the setting changes and test. Your phone may be working as designed. Keep us posted.
    AntonioC_VZW Follow us on Twitter at www.twitter.com/VZWSupport

  • How can I get Data in String Array from TABLE

    hi all
    I have table in MS Access databse called Login with two coulmn (User, Password),
    I want to get all the User Name in a string[] called USER,
    (LIKE USER = {"AA","BB","CC",........"zz"};
    i made somthing like this
    public class User_Name
    final String driver = Login_Dialog.T_driver.getSelectedItem().toString();
    final String url = Login_Dialog.T_URL.getSelectedItem().toString();
    final String user = Login_Dialog.T_User.getText().toString();
    final String password = new String(Login_Dialog.T_Password.getPassword());
    static Connection connection;
    static Statement statement;
    static String sql;
    static ResultSet rs = null;
    static String[] User ;
    public String User_Name()
    try
    //Load Driver
    Class.forName(driver);
    // Make Connection
    connection=DriverManager.getConnection(url,user,password);
    // Create Statement
    statement = connection.createStatement();
    sql = "SELECT User FROM Login" ;
    // Create Resultset
    rs = statement.executeQuery(sql);
    ResultSetMetaData MD = rs.getMetaData();
    int C_N = MD.getColumnCount();
    if(rs.next())
    for(int i = 2 ; i<=C_N ; i++)
    User = rs.getString(2);
    statement.close();
    rs.close();
    connection.close();
    return User;
    catch(ClassNotFoundException cnfex) {
    //show message
    JOptionPane.showMessageDialog((Component) null,
    "Failed to load driver..."+
    "\n"+cnfex.getMessage(),
    "Error...",
    JOptionPane.ERROR_MESSAGE,
    UserDatabase.Error_Icon);
    catch(SQLException sqlex){
    //show message
    JOptionPane.showMessageDialog((Component) null,
    "Unable to connect to Database..."+
    "\n"+sqlex.getMessage(),
    "Error...",
    JOptionPane.ERROR_MESSAGE,
    UserDatabase.Error_Icon);
    but i can get any thing so plz anybody send me a code for this one or help me out
    Thanx
    Regards
    Satinderjit

    in for loop, try;
    user[i] = rs.getString(2);

Maybe you are looking for