Asking too much and getting a "stack over flow error"

I’m having AS3 create 12 random var (play1, play2, etc) and then I ask it to average the 12 vars (numbers) until I get a specific average number. When I run this in AS2 I get the “script time error, keep running?” question. I tell it to keep running and eventually AS2 finds the right set of 12 numbers to equal a specific average number. In AS3 I get a “stack over flow error”. I know that all my AS3 swf needs is just more time to find it.
Any ideas for a fix?

// set AvgLenght if it is undefined
if (!AvgLenght) {
    var AvgLenght:Number = 4.5;
    ShowAvgLenght.text = String(AvgLenght);
// build play lengths//
var Hteamplay1:int = Math.random() * 5;
var Hteamplay2:int = Math.random() * 5;
var Hteamplay3:int = Math.random() * 5;
var Hteamplay4:int = Math.random() * 5;
var Hteamplay5:int = Math.random() * 10;
var Hteamplay6:int = Math.random() * 10;
var Hteamplay7:int = Math.random() * 10;
var Hteamplay8:int = Math.random() * 10;
var Hteamplay9:int = Math.random() * 20;
var Hteamplay10:int = Math.random() * 20;
var Hteamplay11:int = Math.random() * 50;
var Hteamplay12:int = Math.random() * 100;
trace("12 play sets", Hteamplay1, Hteamplay2, Hteamplay3, Hteamplay4, Hteamplay5, Hteamplay6, Hteamplay7, Hteamplay8, Hteamplay9, Hteamplay10, Hteamplay11, Hteamplay12);
var playsum:Number = (Hteamplay1 + Hteamplay2 + Hteamplay3 + Hteamplay4 + Hteamplay5 + Hteamplay6 + Hteamplay7 + Hteamplay8 + Hteamplay9 + Hteamplay10 + Hteamplay11 + Hteamplay12);
var PlaySets:Number = playsum / 12;
trace ("Average of all plays:", PlaySets)
if (PlaySets >= AvgLenght && PlaySets <= AvgLenght + .1) {
    gotoAndStop("Equals target avg");
    ShowAvgLenght.text = String(AvgLenght);
} else
nextFrame();
// The next frame "goes to and plays this frame
// ShowAvgLenght.text = String(AvgLenght);
trace("AvgLenght:", AvgLenght);
the code work with higher "AvgLenght",a lower "AvgLenght" takes longer and I get the below error:
output:
12 play sets 2 2 2 1 0 3 0 7 16 16 25 17
Average of all plays: 7.583333333333333
AvgLenght: 2
tried: 3489
12 play sets 0 4 4 0 3 4 1 2 19 9 10 30
Average of all plays: 7.166666666666667
AvgLenght: 2
Error: Error #1023: Stack overflow occurred.
tried: 3490
Error: Error #1023: Stack overflow occurred.
Error: Error #1023: Stack overflow occurred.

Similar Messages

  • Stack over flow error

    hi all,
    we had an outage , when I checked the logs there was a java.lang.stackoverflow error, and the weblogic server shut down, is this possisible ? for a stack overflow error to pull down a server, we had to restart the server , and now it works fine, please throw some light.
    Thanks
    Pradeep

        public class Main extends JPanel
            private PanelA a = new PanelA();
            private PanelB b = new PanelB();
            Main()
                a.setPanelB(b);
                b.setPanelA(a);
        public class PanelA extends JPanel
            private PanelB b;
            void setPanelB(PanelB b)
                this.b = b;
        public class PanelB extends JPanel
            void setPanelA(PanelA a)
                this.a = a;
            private PanelA a;

  • Arg, stack over flow...

    I'm working on a equation parser (using recursion).
    I'm getting a stack over flow error on the first recursive call by making with parameters consiting of only:
    1) 1 TreeNode containing a very short string
    2) 1 ArrayList containing only 1 element at that time.
    Now I'm confused about how stack overflow works, doesn't it only happen when you try to use too much memory. (ie a recursion that goes too deep)
    So can someone tell me why this is causing a stack overflow and clear up for me what really behind stack overflow errors in general? thanks

    Now I'm confused about how stack overflow works,
    doesn't it only happen when you try to use too much
    memory. (ie a recursion that goes too deep)Yes.
    So can someone tell me why this is causing a stack
    overflow Not easy without the code.
    What are the termination conditions for the recursive method with the given inputs?
    Pete

  • Contact sheets. Am I asking too much from LR

    In my workflow I need to get 'printed' contact sheets out ASAP for public to look at, note file numbers, then view on screen > hopefully purchase.
    I have produced a contact template 16up and on average we print 10-18 sheets at a time.
    The time it takes to print is not viable (anything from 2 minutes (rare) - 20 minutes, average 15 mins +)
    I have set to draft mode printing, increased my RAM to 12GB (from 4)
    and the average file is about 3000 pixels.
    I have set the Activity Monitor (Mac 10.8.4) to watch and there seems to be no 'page outs'
    and the CPU and free space seem to be within their limits.
    I have also tried to PDF and to Jpeg file, but this seems to take as long.
    Also tried on LR3, LR4.4 & LR5 Trial, no difference.
    Am I asking too much of my OS or LR.
    Any input appreciated
    Thanks
    P.S.
    saw 1 or 2 other posts suggesting Draft Mode made a massive difference even to big files, but not to mine.
    Pages seem to load fairly quick at first, then hang.
    May be my imagination, but the time to print seems to be increasing

    After much searching I think I may have found the solution ?
    We were creating 1:1 previews by editing the photos before printing to contact sheets.
    The 1:1 Previews is what seemed to be causing the hold up.
    So to remedy this
    In Library > Library Menu > Previews > Discard 1:1 Previews > All photos
    It then printed out the contact sheets at a fair rate of knots.
    (I believe once you go back to loupe and zoom in, it then creates the 1:1 Preview again)
    22 pages with 349 images ave. 3,500 pixels per photo = 12 seconds (compared to 20 mins to never),
    obviously + printing time.
    Quick silly question though ??
    I take it if I have minimal preview settings this will not infringe the quality of the larger printed copies ?
    (I take it, it is just that, a preview ?)
    I would also have thought that LR would have found a solution to this before now
    or at least provided some sort of info / tutorial / remedy.
    Looking at the results from people having problems with this goes way back to LR2/LR3.

  • Am I asking too much of the Cisco DX 650 phone?

    At the beginning of the week, I had high hopes for the DX 650.  I set up this device with the hopes that it would not be a Cius 2.0 device.  However, when trying to setup some of the non-standard calling features, the device seems to bog down and become painful to use.  Here is what I setup, or tired to setup:
    External 24" monitor
    Logitech C930 camera
    Bluetooth wireless keyboard and mouse
    Proximity via Bluetooth to my iPhone
    VMWare Horizon client
    I have to say, the Bluetooth connectivity is poor and clunky.  The iPhone would not stay connected, and the DX 650 would rarely show my phone as a second device for calling.  Contacts were synced sometimes, and if I left the room and came back, it would not connect again.  In addition, having the Bluetooth keyboard and mouse were slow when everything was connected.  The keyboard and mouse would connect, sometimes.  Before anyone judges me, I am not using the WiFi at all.
    The Horizon View client is OK, but when you are in a video call, it is horribly slow.  I ultimately disconnected the Bluetooth and went back to a wired keyboard and mouse.  I also disconnected the external Logitech camera.  With all the other devices disconnected, the video calling and Horizon View client were usable, but not great.
    If I reboot the phone, it is OK for a while.....  
    Am I asking too much of this device?  It has potential, but how can I recommend this as an all-in-one solution to my customers?  Will it get better?  I still want to test the VPN connectivity on top of all I mentioned above, but I am afraid it will be disappointing at best....
    Thanks
    Jesse

    hi Jesse,
    have you tried the latest dx650 firmware? cmterm-dx650.10-2-2-23.cop.sgn
    Cisco has done a huge improvement compared to old firmwares. I can understand your experience, but i was surprised, when i´ve done an upgrade the latest Software Version of the DX.
    Best regards
    Simo

  • Always one annoying click too much to get to image...

    For my Nokia 5800, as a frequent viewer of images, I'd like to get to that folder quickly. There is a button with an image symbol on the choices after clicking the "shortcut to media functions" (the small arrow-like button to the right above the screen) but when clicking it, you actually get to the Gallery menu, where the image folder is only one of several choices, including music and videos, although those already have separate buttons on the "shortcut to media functions" menu.
    Therefore, I tried to make a shortcut to the image folder directly on the home screen instead, but the Nokia team appears to have forgotten to include that folder in the list of available shortcuts. The closest you can get is to the Gallery menu, which still is one annoying click too much to get to the image folder.
    Does anyone know how to create an actual shortcut to the image folder?
    Solved!
    Go to Solution.

     No worries. As for Nokia photo browser, I don't understand how it is still in the experimental phase considering it has been around for a couple of years now. I would love to see it make it to final release or even implemented into the firmware. It works great on Symbian^3.
    All the best.
    Ray

  • IMAP Mac Mail on Multiple Computers - Asking too much?

    I'm trying to set up Mac Mail for someone who uses a different Mac at the office than they do at home. Yes, they could use webmail via a web browser, but can't Mac Mail be set up for this?
    I tried to set them up using Mac Mail in IMAP mode so that all of their mail (inbox, sent, drafts, trash, etc.) are stored on the server but it's simply not working. Deleted mail just disappears. Trying to save a draft gives me an error message. Copies of sent messages are not being saved locally or on the server. Synchronizing the mailbox doesn't seem to work. Am I asking too much or am I just doing something wrong?
    (They are not using a .Mac account, but their provider supports IMAP protocol.)

    You’re welcome. Here’s an explanation of how mailboxes are supposed to appear in Mail that I’ve posted in other cases and that you may find useful as well. Let me know if there is still something you cannot figure out after reading it:
    1. Instead of grouping mailboxes by account, Mail groups mailboxes by purpose first, regardless of whether they are stored locally or on the server, then groups by account the mailboxes that don’t serve a specific purpose in Mail. If you have more than one mail account, each has its own Inbox, Drafts, Sent, Trash and Junk mailboxes, which appear under the respective group showing the account name instead of the real name of the associated mailbox in the filesystem.
    This has the advantage of letting you choose at any time, and independently for each mailbox, whether you want to look at your Inbox, Sent, Trash, etc. mailboxes as if you had just one of them shared by all accounts (i.e. an aggregate), or look at each of the corresponding individual mailboxes separately.
    2. Each mailbox under a pre-defined group is associated with a mailbox in the filesystem whose name may or may not be exactly the same as the name of the corresponding mailbox group. By default, the name of the actual mailboxes in the filesystem associated with Sent and Trash, for example, would be Sent Messages and Deleted Messages, respectively.
    3. The association between a mailbox in a pre-defined group and the actual mailbox in the filesystem is fixed for POP accounts, but can be changed for IMAP accounts by means of Mailbox > Use This Mailbox For or the corresponding Preferences > Accounts > Mailbox Behaviors > Store messages on the server setting.
    4. Mail may defer the creation of a pre-defined mailbox until actually needed to store messages there. Also, in some circumstances Mail may be unable to create or locate the actual mailbox in the filesystem (see #10 below for an example), but the association does still exist in those cases from a logical point of view, even though Mail may be unable to display or store messages there.
    5. Each and every mailbox appears once and only once in the mailbox list, be it (1) under one of the pre-defined groups with an icon that conveys its purpose and the name of the account it belongs to (if you have more than one mail account), or (2) with a generic folder icon and the real name of the associated mailbox in the filesystem if it serves no specific purpose as far as Mail goes. Under no circumstances can the same mailbox appear both ways; it’s either one or the other, depending solely on whether it serves a specific purpose in Mail or it’s treated by Mail as a generic mailbox like any other.
    6. By itself, the name of the mailbox is no indication of whether it serves a purpose in Mail. If it appears in Mail with a generic folder icon, then as far as Mail goes it’s a generic mailbox like any other, no matter what its name.
    7. For IMAP accounts, a mailbox with a generic folder icon can “disappear” and become associated with one of the pre-defined groups as a result of changing the corresponding Store messages on the server setting in Preferences > Accounts > Mailbox Behaviors or doing Mailbox > Use This Mailbox For on it (server-stored mailboxes only). This, in turn, would cause the mailbox being previously used for that purpose to become dissociated from the corresponding group and “appear” as a mailbox with a generic folder icon.
    8. In addition to the account-specific mailboxes that appear with the account name under each of the pre-defined groups, Trash and Junk may also have an “On My Mac” mailbox. This is where messages deleted or marked as junk are moved if they were previously stored in a custom “On My Mac” mailbox or in a locally stored mailbox associated with an IMAP account (i.e. a mailbox for which Store messages on the server has been turned OFF in Preferences > Accounts > Mailbox Behaviors).
    9. Generic mailboxes that don’t serve a specific purpose as far as Mail goes (i.e. mailboxes that appear in Mail with a generic folder icon), appear below the pre-defined groups. In principle, “On My Mac” mailboxes (i.e. locally stored custom mailboxes) would appear as top-level folders, whereas server-stored mailboxes would appear grouped under a globe icon for each IMAP or .Mac account. However, if there is no need to differentiate between “On My Mac” and server-stored mailboxes (e.g. because you only have one IMAP account and no custom “On My Mac” mailboxes), Mail will display the server-stored mailboxes as top-level folders instead, just as if they were “On My Mac” mailboxes.
    10. Some IMAP accounts use a NAMESPACE feature that Mail doesn’t handle properly and that causes server-stored mailboxes to appear as subfolders of the account’s Inbox, even though they really aren’t — see “Can't create folders, only subfolders of INBOX” in the Courier FAQ, for example. Those IMAP accounts require INBOX to be typed in Preferences > Accounts > Advanced > IMAP Path Prefix for Mail to handle them properly.

  • Can you please put me in touch with the support  for the trial copy of adobe acrobat XI pro which I had tried out on March 15 for 30 days. I have  been trying to cancel since the cost is too much and Acrobat Reader is OK for me. I can't find uninstaller.

    Can you please put me in touch with the support  for the trial copy of adobe acrobat XI pro which I had tried out on March 15 for 30 days. I have  been trying to cancel since the cost is too much and Acrobat Reader is OK for me. I can't find uninstaller.
    I have had to erase my disk since then with trouble with Apple Store not recognising my machine and the reload from Time Machine has given complications . Can you please cancel my trial and return my Trial money.

    If you paid for what you used then it was not a trial.
    Look thru the following links and use the chat option if required for your situation:
    Cancel your membership or subscription | Creative Cloud
    https://helpx.adobe.com/x-productkb/policy-pricing/cancel-membership-subscription.html
    https://forums.adobe.com/thread/1703848
    Chat support - For the link below click the Still Need Help? option in the blue area at the bottom and choose the chat option...
    Creative Cloud support (all Creative Cloud customer service issues)
    http://helpx.adobe.com/x-productkb/global/service-ccm.html ( http://adobe.ly/19llvMN )
    Phone support | Orders, returns exchanges
    http://helpx.adobe.com/x-productkb/global/phone-support-orders.html

  • Will all my music transfer from the mac to my macbook air? I don't want it to because there is too much and the air will not hold it.

    will all my music transfer from the mac to my macbook air? I don't want it to because there is too much and the air will not hold it.

    Welcome to Apple Support Communities
    First, when you are going to turn off or restart your Mac, you will see a box called "Reopen windows when logging back in" in the shutdown or restart window. Untick this box and see if the App Store opens automatically in the next startup.
    If it starts, open System Preferences > Users and Groups > Login Items, and see if the App Store shows up. If so, remove it from this list

  • In Safari, my iMac sometimes zooms way too much and will not zoom back.  I have a wireless mouse set to zoom in and out on double tap, but the excessive zooms happen with no taps.

    In Safari, my iMac sometimes zooms way too much and will not zoom back.  I have a wireless mouse set to zoom in and out on double tap, but the excessive zooms happen with no taps.  A page zooms in so less than 1/4 of the page is visible and nothing I do will zoom back out, command minus doesn't do it, double tap on mouse does not zoom out, and the window will not scroll to show any of the rest of the page.  reloading the page does not help.  Loading a different page gives me a normal view again.

    If it were a tweaked setting, it should happen less randomly.  And there should be no settings that could override the zoom setting in unversal Access and the Mouse zoom preferences. 
    In addition, this only happens in Safari 6, and seems to happen more fredquently on some websites and not on others.  That suggests some sort of conflict in the site code with Safari and Apple wireless mouse code.  It does not happen in Mail, Word, Excel, Photoshop, Illustrator, or other software as far as I can tell.

  • HOW CAN I REMOVE "ASK" SEARCH BAR AND GET BACK FIREFOX SEARCH BAR?

    for last few dyas, when i click on firefox icon, i get the "ASK" search bar. i want to remove 'ASK' search bar, and get back firefox search bar

    If this is the Ask.com toolbar, you can remove it by following these instructions: '''[http://about.ask.com/apn/toolbar/docs/default/faq/en/ff/index.html#na4 How do I uninstall the Toolbar?]'''
    You may also be able to '''[[Uninstalling add-ons|disable or uninstall the add-on using the Firefox add-on manager]]'''.

  • If i buy an unlocked iphone4s in america and get it shipped over will it work in ireland? Im meteor btw.

    If i buy an unlocked iphone4s in america and get it shipped over will it work in ireland? Im meteor btw.

    Keep in mind that you're going to have to have somone order it for you and have it shipped to themselves, then ship it to you. The unlocked 4S can't currently be purchased at retail in the US and apple.com will only accept a US credit card with a US billing/shipping address.
    Meteor is listed as a supported carrier, so you shouldn't have any problems on that point.

  • Trying to relink video clips and getting "import reporting a generic error" using Premiere Pro CC 2014 on a Mac

    Moving a project over to another computer and I was trying to relink video clips and getting "import reporting a generic error" message.

    Did you find a solution? I'm having this same problem.

  • When playing my ipod on an ipod dock the vocals are very faint. It is fine when doing through the headphones. I am trying to sync for updates and getting the message "An unknown error occured (-1)" - help

    When playing my ipod on an ipod dock the vocals are very faint. It is fine when doing through the headphones. I am trying to sync for updates and getting the message "An unknown error occured (-1)" - help

    Error -1
    Attempt to restore your iOS device two more times. If the issue is still unresolved, the device may need service.
    The "device may need service" means a hardware problem. In that case make an appointment at the Genius Bar of an Apple store.
    Apple Retail Store - Genius Bar
    Also see:
    -1 error
    -1 error too

  • I am trying to download a movie and get the message: "An unknown error occured (5002).  There was an error in the iTunes Store.  Please try again later."  Waited a day and still get the message.  Have downloaded movies before.

    I am trying to download a movie and get the message: "An unknown error occured (5002).  There was an error in the iTunes Store.  Please try again later."  Waited a day and still get the message.  Have downloaded movies before.

    Did you ever get an answer?

Maybe you are looking for

  • VFX3 issue in SAP FICA

    Hi Gurus, The invoice is stuck in VFX3 due to "Invoice 84037755: Cannot match 95,145.00- USD of BP/GL items for PrCtr 212100" Diagnosis While determining the item grouping key (DFKKOPK-PSGRP) for the business partner and general ledger items of invoi

  • How can I bind a component to ADF?

    Hi all! I'm really new to OOP, Java, and JDeveloper. I managed to create a small ADF Swing application successfully through the wizards, help files, and examples. I want to incorporate the components of SwingX into it, specifically having auto-comple

  • Bug report iMovie '11 Title, Picture, Transitions Location Duration bug

    In iMovie '11 version 9.0.1 (1095) there is a very annoying bug if you use Norwegian or Dutch. I presume in other languages as well, but in English I can't repeat the bug. Set System Preferences > Language & Text to Nederlands or something else (not

  • SAP JCO 3 - Not recognizing ABAP_DEBUG and USE_SAPGUI

    We are in the process of converting a Java application to use JCO 3.0 in order for it to work on the Intel based Macs.  The code conversion has gone well so far and I have successfully been able to connect to a SAP system using the new connection met

  • Powerbook G$ won't recognize external HDs

    I recently purchased a Hitachi HD for an enclosure to use for a backup HD. I hooked it up and it immediately started clicking. I hooked it up to a PowerPC G5 and it recognizes it. Another guy in our office has a different kind of enclosure that he us