3 Replies Latest reply on Apr 15, 2009 12:39 AM by FrAgFo0d

    CPU usage sky rockets with animations

    FrAgFo0d

      Hi,

       

      I've got a flash production which workst fine as long as there is nog animation visible on the screen, when there is an animation visible the CPU usage of my screen is skyrocketing towards a 100%

       

      After some tweaking I found that using Filters on movieclips with flash drawings in them where part of the issue.
      So I created PNG files for the drawings and imported them to the library. This does work, but does not doe the trick entirely.

      Now my CPU usage is 43% when a animation is visible on screen. When the animation is not visible the CPU usage is max. 1%

       

      The animations are animations of flash drawings and they are imported with first an attachmovie and then a duplicatemovie.
      When I mask the animation (so it is not visible) the CPU usage is low. otherwise it is high.

       

      Does anyone knows why this problem might occur?

       

      Best Regards

       

      Bart

        • 1. Re: CPU usage sky rockets with animations
          kglad Adobe Community Professional & MVP

          it takes cpu cycles to determine what needs to be rendered and where it and how it should be rendered.

           

          check the cacheAsBitmap property of movieclips (as2) or displayobjects (as3) to see it you can use that to decrease cpu demands.

          1 person found this helpful
          • 2. Re: CPU usage sky rockets with animations
            FrAgFo0d Level 1

            In the for loop in which I attach and duplicate the movie I have set the cacheAsBitmap to false and to true.

             

            see script:

            for(var i=0;i<=tempWidth;i+=sectionWidth){    // Koppel aniemate aan de sectie    if(counter==0){    var tempAnimation:MovieClip=this.myMC.attachMovie("animations_mc", "animations_"+counter+"_mc", counter,{_x:i,_y:0});    }else{     var tempAnimation=tempAnimation.duplicateMovieClip("animations_"+counter+"_mc", counter);    }    //rendering veranderen    tempAnimation.cacheAsBitmap = false;    // Maak PipeAnimation    var newPipeAnimation=new PipeAnimation(i,0,this.currentFlag,tempAnimation);    // Stop nieuwe animatieblok in animatie array    this.animations.push(newPipeAnimation);    counter++;   }

             

            When set to false the CPU usage is the same as before: 38% to 42%

            When set to true the CPU usage is much higher: 47% to 57%

             

            So unfortunately this did not do the trick as I hoped it would do.

            We also tried to just attach all the movies in stead of duplicating them, however that did not do the trick as well.

            I also read that the 'cacheAsBitmap' is false in default.
            Since it got higher when set to true I take it that it's normal that the CPU usage increases when set to true ?

            Or is this just in my specific case?

            • 3. Re: CPU usage sky rockets with animations
              FrAgFo0d Level 1

              grrrr lousy WYSIWYG