Set interval problem

I'm trying to generate an instance of a logo every two
seconds and have them remain persistent. This code creates a new
instance every two seconds but the earlier versions are deleted.
Any ideas of how to do this would be helpful.
function createLogo():Void {
var counter:Number;
counter++
var copy:MovieClip = attachMovie("logo", "newLogo" +
counter, counter);
["copy" + counter]_x = Math.floor(Math.random() * (0-650));
["copy" + counter]_y = -60;
var myInterval:Number = setInterval(createLogo, 2000);

Trace your counter value. I think you will see that it isn't
what you think!
There are probably several things wrong with this. First you
can't increment a value that doesn't already have a value. It used
to be that a variable without a value was assumed to be zero, but
now-a-days...
The next thing is that you really need to have the counter
variable be outside the function. You want it to persist from
function call to function call. But by having it declared as var
inside the function it is local to the function. So as soon as
createLogo is done counter goes away and isn't kept for the next
round.
Finally, this isn't specific to what you have asked, but it
is just advice. Generally there can be lots of counters in your
code. So it is just fine to name it counter when it is local to a
function. But once you move it out of a function (where it might
interfere with other counter(s). You might want to rename it to
something more identifiable. Like logoCount or some such.

Similar Messages

  • Set Interval Problems

    I am trying to have this function attach a movie clip and
    then after n seconds delete it. I am using the setInterval but
    after finding that I cannot get this to work properly I think it is
    the wrong code to use in this situation? correct? How can I
    accomplish this?

    well you're close but there are a few problems here.
    setInterval is the right way to go, but you have to target the
    correct instance to remove and you must always be sure to clear the
    interval or it will continue to run. so you need to do something
    more like the following:

  • My home button is working intermittantly. Have Restored setting. still problem. Any ideas?

    my home button is working intermittantly. Have Restored setting. still problem. Any ideas?

    Did you actually restore the iPad? Or just restore settings?
    If you haven't "restored" the iPad...
    iTunes: Backing up, updating, and restoring your iPhone, iPad, or iPod touch software
    If a restore doesn't work...  >   Apple - Support - iPad - Hardware Service

  • Oracle to Mysql character set conversion problem!!! PLZ IGNORE

    Hi Experts,
    I have created a database link from Oracle 10g to Mysql 5.
    I have installed Oracle Gateway 11g for this purpose.
    When i retreive the data from sql plus the text is displayed as question marks.
    Oracle 10g Database character set is WE8MSWIN1252
    Mysql character set --->latin1
    Character set of ODBC connector for mysql is  latin7
    Character set in the parameter file of HS folder is WE8MSWIN1252When i retrieve data from sql developer the text is fine(as i think it directly takes the character set of target) but
    when i login from sqlplus i get question marks!
    I have another post in Heterogeneous Connectivity forum
    Re: Oracle to Mysql character set conversion problem!!! PLZ HELP
    Kindly update your comments there,
    @@@@@@@@@@@@@@2
    Appreciate your help,
    regards
    Edited by: user10243788 on Apr 21, 2010 3:25 AM

    It is OK to post a globalization-related question in this forum in addition to the forum pertaining to the main technology. Not all experts follow all possible forums on OTN. Of course, you should cross-link the posts to let people merge the answers.
    Regarding the problem itself, make sure that SQL*Plus has the right NLS_LANG setting in the environment. On Windows, in the Command Prompt:
    C:\> set NLS_LANG=.WE8PC850
    C:\> sqlplus ...On Unix:
    $ setenv NLS_LANG .WE8ISO8859P1   (or NLS_LANG=.WE8ISO8859P1; export NLS_LANG)
    $ sqlplus ...-- Sergiusz

  • An odd set of problems - full re-install fail

    Hello helpful computer people
    I have a funny set of problems which has culminated in me wanting to fully reinstall operating software. I will explain why I want to do this in a minute, but the main problem is that I can't manage to do it! When I boot up my mac from the startup disk I get a messed up display. The information is obviously all there on the screen, but it's displayed in weird jagged lines. This means that I can't make out where to click to continue with the installation. I also though that the disk drive was being particularly clunky sounding, but could be imagining that.
    You can see what I mean here: http://www.flickr.com/photos/33449131@N02/7160853520/in/photostream
    The problems up to this point have been really odd, with applications one by one stopping responding and finder crashing. Also the computer will sometimes not go to sleep when closed and the fan will go a bit mad. I have had particular problems with browsers crashing and generally the computer grinding to a halt with nothing but the off button having any effect.
    I have tried loads of stff - reseting P ram, repairing disks, running cleanups on Onyx, removing programmes etc.
    I want to go back to square one because things are getting a bit messy, it won't let me reinstall Safari becuase it thinks it's already there, but It doesn't show up on search!
    I tried reinstalling Snow Leopard but realised that didn't really do much and am now going down the route of putting the original install disk in. I bought there computer second hand btw, so there is a possibility that the install disks are wrong, although unlikely because the guy was trustworthy.
    Thanks in advance for all your help
    Tim

    Yep.
    Just want to clear up the fact that the original problems encountered were not display related and it only happens when I try to do that one specific task. The computer is working ok now and I am writing this message from it.
    My display spec:
    NVIDIA GeForce 8600M GT:
      Chipset Model:    GeForce 8600M GT   
      Type:    GPU
      Bus:    PCIe
      PCIe Lane Width:    x16
      VRAM (Total):    128 MB
      Vendor:    NVIDIA (0x10de)
      Device ID:    0x0407
      Revision ID:    0x00a1
      ROM Revision:    3175
      Displays:
    Color LCD:
      Resolution:    1440 x 900
      Pixel Depth:    32-Bit Color (ARGB8888)
      Main Display:    Yes
      Mirror:    Off
      Online:    Yes
      Built-In:    Yes
    Display Connector:
      Status:    No Display Connected

  • Brand new IPad 3 out of the box - set up problem with Apple ID

    Brand new iPad 3 out of the box - set up problem. It says my Apple ID (email address) is already being used. I reset the password successfully but still says I need another Apple ID. Why won't the ID recornize me?

    Open current iTunes on your computer. Connect iPhone to the computer with the Lightning USB Cable. Hold both the Home and Power buttons for about 20 seconds until iTunes recognizes the iPhone in Recovery Mode. Click the Restore button of iTunes. If still problem, make Genius reservation or set up Sevice and take or send to Apple for resolution under Warranty.

  • Retry count & interval problem

    I am Using OSB R4 where My Scenario is i need to place the payloads in to the JMS Queue, and route them to the Endpoint URI webservice if the service is unavailable i need to sent the notification mail and rollback the payload back in to the Queue. My problem is i receiving hundreds of notification mail when the service is down instead of one. I configured the retry count to 1 and retry interval as 15 mins for the business service URI and implemented single thread consumer in work manager. Please help me in this.....

    I am Using OSB R4 where My Scenario is i need to place the payloads in to the JMS Queue, and route them to the Endpoint URI webservice if the service is unavailable i need to sent the notification mail and rollback the payload back in to >the Queue. My problem is i receiving hundreds of notification mail when the service is down instead of one.This is a classic case for using OSB SLA alerting instead of doing it in the message pipeline. Configure a sla alert set to trigger when there are 1 or more route errors in an aggrevation interal of 30 mins and set an email alert destination. This will make sure you will get only 1 mail for all errors in that period of 30 minutes.

  • Events won't run at set interval

    I have about a half dozen events that are supposed to run at set intervals. When I first register them, the ones for the node run (check disk space) and I get the notification. They only run the one time. To get them to run again, I have to deregister then register again. They run once then not again. The one for Data Guard status will not run. Shutdown OMS and disabled then enabled eventhandler, restarted OMS. Bounced agents. All to no avail. Does anyone have any ideas why these events won't run at their specified interval?

    Need a bit info here.
    What exactly are you talking about, database control, grid control, OEM 9i?
    I'm guessing its the last one? If so, if you have a check disk space alert and it fires saying you have only x amount of space left. When you clear the space on the disk, the event will clear itself. It will only 'alert' once, until you have fixed the problem. Does this make sense to you?
    Cheers,
    Bazza

  • Remote not working. network set up problem

    okay... The remote app is not working.
    I have installed it on my phone and successfully made it work both on my computer and on the computer in the mac store. So i know the iphone is not the problem. The problem is I had to set up a temporary network on my computer. I want to get the current network configured correctly to work with the iphone remote app.
    Here is what is happening:
    i open up remote, choose my library, the code comes up for me to enter. but itunes does not find my iphone.
    Both the phone and the comp are using a wi-fi network from my router. It is password protected, both have the password installed in them. When i check system prefs on both they are using the same network.
    When i went into the apple store, it instantly recognized my iphone and was able to set up the remote there.
    On my own computer I can set up a secondary network and it works there. To so that I went to the airport icon on the top right, the pull down menu has "create network" as an option. I created a new network and THAT network used the remote app. But when i restart the computer that network is deleted.
    What is configured incorrectly in my main wi-fi network that is not allowing the remote the be recognized?
    I know the questions are going to come up:
    i have itunes 8
    iphone firmware is updated.
    both have been reinstalled.
    in itunes i do have the "accept remote" button clicked. i tried resetting it but it said it could not remove remotes since none were recognized yet.
    I think that covers all the info i have on the problem. I really appreciate everyone's help on here. thanks!
    gjclimer is online now Report Post Edit/Delete Message

    I'm having this problem also and I'm in the process of reseting everything. I have tried turning iPod touch on/off, reinstalling the remote app and closing/opening iTunes.
    Two things to check:
    1. Go to View, Preferences, Sharing and make sure iTunes is set to share your library. Sometimes turning this on for the first time you connect the remote solves the problem and you can then turn it off again once it's working.
    2. Make sure your wireless devices (everything connected to your wireless router) are on the same network as the computer you are trying to connect to. I have a main wired router going into my PC and use Airport Express as a wireless extender (basically plugging it into the router to beam the internet access out to wifi devices) and originally the main router put my PC on one network (172.x.x.x) whilst my wireless devices were on a different one (255.x.x.x), so the two devices couldn't see eachother. The way to solve this problem is to tell your wireless router to act as a 'bridge' under the wireless router's settings, which will extend the network of your wired router, rather than create a whole new one.
    I'm not sure either of those will help but it's worth a go. I'll let you know if I solve the problem at my end and how I did it.

  • Using Calendar.set() method problem

    Hi all,
    First of all sorry to bother with such a trivial(?) matter but I cannot solve it by myself.
    I have a piece of code which I simply want to handle the current date with the GregorianCalendar object so that the date would be set to the Calendar.SUNDAY (of the current week). Simple enough?
    Code as follows:
    import java.util.*;
    import java.text.*;
    public class Foo
    public static void main(String[] args)
         Foo foo = new Foo();
         Date newdate = foo.bar();
    public Date bar()
         GregorianCalendar m_calendar = new GregorianCalendar(new Locale("fi","FI"));
         m_calendar.setFirstDayOfWeek(Calendar.MONDAY);
         Date newDate = null;
         try
              m_calendar.setTime(new Date());
              System.out.println("Calendar='" + m_calendar.toString() + "'");
              m_calendar.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY);
              SimpleDateFormat sdf = new SimpleDateFormat("yyyy.MM.dd");
              StringBuffer sb = new StringBuffer();
              sdf.format(m_calendar.getTime(), sb, new FieldPosition(0));
              System.out.println("Date in format (" + sdf.toPattern()          + ") = '" + sb.toString() + "'");
         catch(Exception e)
              e.printStackTrace();
         return m_calendar.getTime();
    This should work at least accoring to my understanding of the SDK documentation as follows with
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_01-b01)
    Java HotSpot(TM) Client VM (build 1.4.1_01-b01, mixed mode)
    Calendar='java.util.GregorianCalendar[time=1054636838494,areFieldsSet=true,areAllFieldsSet=true,lenient=true,zone=sun.util.calendar.ZoneInfo[id="Europe/Helsinki",offset=7200000,dstSavings=3600000,useDaylight=true,transitions=118,lastRule=java.util.SimpleTimeZone[id=Europe/Helsinki,offset=7200000,dstSavings=3600000,useDaylight=true,startYear=0,startMode=2,startMonth=2,startDay=-1,startDayOfWeek=1,startTime=3600000,startTimeMode=2,endMode=2,endMonth=9,endDay=-1,endDayOfWeek=1,endTime=3600000,endTimeMode=2]],firstDayOfWeek=2,minimalDaysInFirstWeek=4,ERA=1,YEAR=2003,MONTH=5,WEEK_OF_YEAR=23,WEEK_OF_MONTH=1,DAY_OF_MONTH=3,DAY_OF_YEAR=154,DAY_OF_WEEK=3,DAY_OF_WEEK_IN_MONTH=1,AM_PM=1,HOUR=1,HOUR_OF_DAY=13,MINUTE=40,SECOND=38,MILLISECOND=494,ZONE_OFFSET=7200000,DST_OFFSET=3600000]'
    Date in format (yyyy.MM.dd) = '2003.06.08'
    Which is the sunday of this week. But as I run the same code with:
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1.06-020625-14:20)
    Java HotSpot(TM) Server VM (build 1.3.1 1.3.1.06-JPSE_1.3.1.06_20020625 PA2.0, mixed mode)
    Calendar='java.util.GregorianCalendar[time=1054636630703,areFieldsSet=true,areAllFieldsSet=true,lenient=true,zone=java.util.SimpleTimeZone[id=Europe/Helsinki,offset=7200000,dstSavings=3600000,useDaylight=true,startYear=0,startMode=2,startMonth=2,startDay=-1,startDayOfWeek=1,startTime=3600000,startTimeMode=2,endMode=2,endMonth=9,endDay=-1,endDayOfWeek=1,endTime=3600000,endTimeMode=2],firstDayOfWeek=2,minimalDaysInFirstWeek=4,ERA=1,YEAR=2003,MONTH=5,WEEK_OF_YEAR=23,WEEK_OF_MONTH=1,DAY_OF_MONTH=3,DAY_OF_YEAR=154,DAY_OF_WEEK=3,DAY_OF_WEEK_IN_MONTH=1,AM_PM=1,HOUR=1,HOUR_OF_DAY=13,MINUTE=37,SECOND=10,MILLISECOND=703,ZONE_OFFSET=7200000,DST_OFFSET=3600000]'
    Date in format (yyyy.MM.dd) = '2003.06.01'
    Which is sunday of the previous week and incorrect in my opinion. The latter result is run on HP-UX B.11.11 U 9000/800 and first on NT.
    Any ideas why this is happening? Thanks in advance!
    Greets, Janne

    Thanks for your answer!
    The problem is that I have to work with this older SDK version. :) But I got it solved by using the roll method with the following syntax:
    int delta = [dayToSet] - m_calendar.get(Calendar.DAY_OF_WEEK);
    in which the delta is of course the difference (negative or positive to the current day of the week)
    and then using the roll call:
    m_calendar.roll(Calendar.DAY_OF_WEEK, delta);
    which doesn't alter the current week. So this works if someone else has a similar problem with the version 1.3.1
    Greets, Janne

  • Please help - Time Capsule Set up problems

    I bought a Time Capsule almost a year ago at the same time as my iMac, but have only tried to set it up in the last 3 weeks (so its the 6"x6"x1" version).  I followed the set up instructions numerous times but kept getting an error message in Airport Utility. I rebooted my broadband and tried the factory reset of the TC.
    Eventually I contacted Apple and after repeating everything whilst they were on the phone, they made an appointment for me at the Genius Bar to have the TC checked over. The Apple rep was able to access the TC using the internal Apple network and a normal port but had the same problem I did using the WAN connection so deemed the item faulty and replaced it.
    My new TC is exactly the same and this time Apple advised me to ask my BB provider if there were any firmware updates required or reasons why I would be having problems. They also checked that I had the latest iMac software and Airport Utility. BT (my BB provider) went through a series of tests and concluded that my BT Home Hub 3 was faulty and have replaced it.
    So now I have a new Home Hub 3 and another new TC and I've still got the same problem. I only want to use the TC for backing up my iMac with Time Machine but Id like to do it wirelessely. Can someone please tell me what I should do next as I can't believe its still down to faulty products.

    I have just been watching Internet traffic on my McAfee security software on my BB and it shows that my router and TC both have a green light for access through the firewall, until Airport Utility gets to the point in its routine where it shows 'joining to the TC' and then my router loses access to the Internet and gets a red light as connection lost. Is that normal, and/or does it help diagnose what the problem might be?

  • HP Officejet Pro 8620 - set up problem with MAC OSX version 10.7.5

    I have just bought a new Officejet Pro 8620 and all set up fine to a point. Problem is that when I try the HP Utility set-up and click on "Add Printer" and identify it as "Bonjour Malfunction" and select the printer from the pull down menu list, I receive the message:
    "The software for this printer is currently unavailable, please contact the printer's manufacturer for the latest software". 
    I have already downloaded the latest software from theHP website - but stil no resolution. 
    Any help please would be gratefully received.

    Hello @Kennynic!
    Thank you for posting on the HP Forums!
    I would be happy to provide some help regarding your Officejet 8620 and installing the software on the Mac.  The first thing I suggest is to ensure all the HP Software is removed from the Mac. I suggest uninstalling the HP Software.  After the software is uninstalled I recommend performing a "repair disk permissions" on your Mac. A repair disk permissions is a utility built in the Mac operating system designed to locate and resolve issues or errors that may cause complications when re-installing. After the repair disk permission is complete restart your Mac and try adding the printer again.
    To uninstall the HP Software click here: Uninstalling HP Software
    To perform a repair disk permission click here: Performing a Repair Disk Permission
    There is only software available for Mac 10.10.  Unfortunately there is no full feature software and driver available for Mac 10.7.  You should still be able to add the printer using the AirPrint drivers.  Go into System Preferences from the Apple icon and click on printer and scanner.  In the printer and scanner window click the add printer icon and you should be able to add the 8600 printer via Wi-Fi and AirPrint.
    I recommend checking for software updates on the Mac. To check for software updates click the "apple" icon at the to left and click on "software update".  Install any HP or printer updates. After any updates you should restart the computer. and try printing.
    Please post back and let me know how everything goes!
    Cbert
    I work on behalf of HP.
    Please click “Accept as Solution” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos, Thumbs Up" at the bottom of this post to say “Thanks” for helping!

  • Home Networking and Multiple Router Set up Problem

    Router 1 (Main Access Point)                   
            X               
    (Routers 1 and 2 connected via a wireless bridge)
    Router 2 (Wired Access Point)
        X       
    (Router 2 and 3 connected via a wired bridge)
    Router 3 (Wired & Wireless Access Point)    Note:broadcasting under a different SSID
             X   
    Problem:
    When I set up a wireless and wired bridge my Internet connection works perfectly and I can connect to the second SSID. If, however,  I close out of my browsing session and come back to my laptop several hours later and open a browser, I get the “webpage cannot be displayed” message.
    I suspect this has to do with IP addresses changing from the main router after a certain amount of time.
    What could be causing this?
    What can I do to stop this from happening?
    Thanks for any help
    EML

    Running multiple router behind router can be tricky and may be the cause of your dropouts if you don't have it configured properly.
    Cisco recommends using your best router as your primary router and DHCP server.
    The best way to setup for home networks, in my opinion, is to use only one router, and put the other router(s) in bridge mode.  Also, make sure your modem is not a router too.
    http://www6.nohold.net/Cisco2/GetArticle.aspx?docid=28cee6a2fb0d4176a2210942d1d5836c_Setting_up_the_...
    http://homecommunity.cisco.com/t5/Wireless-Routers/Guest-access-never-displays-password-prompt-on-EA...

  • Set type problem in sales order integrated into loyalty management

    Hi experts,
    I try to implement the sales order integrated into loyalty management. As notes said, I should use the set type REWARD_PRO_LOY to assign to a hierarchy for loyalty. But when I use this set type in hierarchy, I found I can only assign it when I choose "service" for product type. Then I find in the "REWARD_PRO_LOY" set type, there is a switch tab. In the tab, there is only "services". I don't understand this tab means. I want to assign this set type to "materials" type. I tried to created a new set type with the same attributes, but it seemed not to work. Is anybody can give me some advice to solve the problem?
    Thanks a lot,
    Best Regards,
    Molly Xin

    Hi Molly Xin,
    If you refer to your first screen print, its very evident that the product types with which products be created using this set type includes both "Materials" and Services".
    We have created similar scenario and were able to create products with product type "Materials".
    Pease let me know if you have any issues while creating products with product type "Materials".
    Regards

  • New mac set up problems with time machine

    Bought a new 21 inch mac yesterday and going through set up I tried to use my time machine disk at the appropriate point  (when it asked me) to copy the data. Now the mac refuses to move on, after it rebooted I get the apple sign and the swirling thing despite a pram reset and booting in safe mode.
    Any ideas on how I can force the mac to go back to original settings, it's literally just come out of the box and problems happened at the time machine part on set up.

    Startup your Mac while holding down the Option key.
    That should launch the Startup Manager window where you can select the startup disk then click Restart.
    If that doesn't work, startup your Mac while holding down the Command + R keys.
    From there you will have access to the built in utilities to restore OS X using OS X Recovery.
    There is an option to restore from a Time Machine backup using OS X Recovery, but in this case, just restore OS X first. Get your Mac working again before using Time Machine.

Maybe you are looking for