# Draw BitmapData error on loop

**URL:** https://forum.kirupa.com/t/draw-bitmapdata-error-on-loop/308820
**Category:** Uncategorized
**Created:** [April 30, 2010, 5:54pm UTC](https://forum.kirupa.com/t/draw-bitmapdata-error-on-loop/308820 "2010-04-30T17:54:11Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![AnnaoftheWoods](https://avatars.discourse-cdn.com/v4/letter/a/3e96dc/32.png) [@AnnaoftheWoods](https://forum.kirupa.com/u/AnnaoftheWoods)
#### Post date: [April 30, 2010, 5:54pm UTC](https://forum.kirupa.com/t/draw-bitmapdata-error-on-loop/308820/1 "2010-04-30T17:54:11Z")

</div>

Hi everyone!

I have been pulling my hair out on this one for too long. I have a web banner that uses **Erik Hallander’s Pixelator Class**. Everything works fine when the timeline plays just once, but as soon as it loops I get error:

\*\*ArgumentError: Error #2015: Invalid BitmapData.  
\*\*  
I have tried removeChild, removeEventListener, nulling the variables involved, disposing of the BitmapData. I also tried some conditional statements depending on the loop but no success. The actual class code is beyond my experience.

What am I missing? Thanks for your help.
