A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: How to Avoid the "Abort Script" error & Memory Usage Issues

  1. #1
    Junior Member
    Join Date
    Jan 2006
    Posts
    18

    How to Avoid the "Abort Script" error & Memory Usage Issues

    hi,

    i am workin on a game that loads levels. when a level is loaded, the items to be shown in the level are placed on stage by using (while/for) loops (i use alot of arrays in the process). Now the thing is that in some cases, my level has loads n loads of stuff in it and when my application gets on to placing them, i get the error "script in this movie is causing Flash Player to run slowly. If it continues to run, your computer may become unresponsive. Do you want to abort the script?". I know this is because my loops have run thousands of times. When i press "No", the script continues to run and within a few seconds my level loads completely with no problem. My question is: is there a way to skip this error? as it will be confusing for my user

    I also have a second question, my application file size is 99KB and including the sprites, the maximum the whole thing would go is 2MB. But when I run it and load one of my heavy loaded levels, the memory usage go's upto 110 MB. The memory usage starts from 80MB and seems to grow continuously until it reaches 110 and then goes down and up. Note that this is running in the internet explorer. The memory seems to be possibly some garbage data, (because when i ran some other web app that consumed the memory, the memory usage of my application went down from 110 to 80) but i dont know much in this area. Can someone guide me how i can get rid of any extra memory usage. In cases of average sized levels, the usage go's upto 70 MB. So my second question is: any idea ??

  2. #2
    Flash Gordon McUsher's Avatar
    Join Date
    Mar 2001
    Location
    Krautland
    Posts
    1,560
    As far as i know, there is no chance to circumvent that message;
    but you can program differently to eliminate the cause.
    "Just" split your endless loops/iterations up onEnterFrame events...

    To your second question:
    Hard to tell without knowing the .fla...
    Maybe you have many variables/references in your endless loops that
    don't get deleted, either by a bug or by not optimised programming..
    My letters on the F1 key have faded, how are yours today?

  3. #3
    Junior Member
    Join Date
    Jan 2006
    Posts
    18
    hmmm, thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center