3 Replies Latest reply on Oct 24, 2012 8:28 AM by kglad

    How to avoid lag ??

    alaStickman

      hi,

      am getting lag problems after 3 to 4min of playing my game, the game always generat 4 MovieClip every 5 seconds and the player must kill them (every dead enemie is deleted with "removeMovieClip("name")") but after 4 minutes of playing the game, even if i only had 5 movieClips in the stage the game start doings lags.

      PS :

      i tried once to start the game with more than 50 mc in the stage and it works without any problem, but always after 4 minutes it start the lag

       

      thank you

        • 1. Re: How to avoid lag ??
          kglad Adobe Community Professional & MVP

          there's something in your swf that's causing the problem but it's not possible to pinpoint the problem with the information you supplied.

           

          with as2, in general, if you see performance problems after some time it means you are creating more and more objects or you have some kind of loop (like setInterval) problem.

          1 person found this helpful
          • 2. Re: How to avoid lag ??
            alaStickman Level 1

            yes actually am creating 4 objects every 5 seconds (enemy) and 3 objects every 0.25 seconds (bullets) and every time we kill an enemy i create 10 to 40 objects (particle system), but i remove them all, so in general i will be with 100 objects (MAX)  at the stage in the same time,

            but i think that am going to start learning AS3 and remake the game.

            thank you for your help

            • 3. Re: How to avoid lag ??
              kglad Adobe Community Professional & MVP

              you're welcome.