7 Replies Latest reply: Mar 21, 2013 2:25 AM by saariko RSS

    AS3-looping through movieclips and rasterizing them to bitmapdatas-how to be sure frames are ready?

    saariko Community Member

      hey all

       

      I am developing a mobile AIR app with many animations and tests have shown that using bitmaps and GPU rendering give the best performance across all mobile models. I receive normal vector animations from the app's artists, and have built a system which loops through these animations at runtime and draws the content into bitmapdatas.

       

      my concern is looping through the movieclip's frames. If I have these lines of code:

       

      mc.gotoAndStop(i);
      bitmapData
      .draw(mc);

       

       

      I can't be sure the frame got "constructed" before being drawn, and my tests with an Android tablet prove this right - sometimes frames aren't drawn.

      This mc is off the display list obviously (we dont need to render to the screen). So is there a way to make sure the frame has been built before drawing it to a bitmapdata? (and waiting for FRAME_CONSTRUCTED, EXIT_FRAME, etc.. is obviously slow and unneeded)

       

       

      any ideas?

      thanx

      Saar