# Clearing data from memory

**URL:** <https://forum.kirupa.com/t/clearing-data-from-memory/244825>\
**Category:** Uncategorized\
**Created:** [November 22, 2007, 7:49am UTC](https://forum.kirupa.com/t/clearing-data-from-memory/244825 "2007-11-22T07:49:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sivant](https://avatars.discourse-cdn.com/v4/letter/s/cc9497/32.png) [@sivant](https://forum.kirupa.com/u/sivant)\
**Post date:** [November 22, 2007, 7:49am UTC](https://forum.kirupa.com/t/clearing-data-from-memory/244825/1 "2007-11-22T07:49:54Z")

</div>

i have a thumbnail gallery that changes the thumbnail randomly with fade in and out with alpha. my problem is that after about a minute it starts to slow down. so i use \*\*BitmapData \*\*and i tried to use **dispose()** but it didnt work. since i never used it before i dont know how to fix my problem:  
i am creating the thumbnail with this:(my thumbnails are in the library with linkage)

```auto
function picA0() {
 this.createEmptyMovieClip("targetClip0", this.getNextHighestDepth());
 targetClip0._x = 22;
 targetClip0._y = 13;
 i = random(j);
 var pict:BitmapData = BitmapData.loadBitmap("pic"+i);
 this.targetClip0.attachBitmap(pict, 1);
}

```

and from a MC that works as the timer i start a function that dissolves’ like this:

```auto

function fadeOut(param) {
 this.onEnterFrame = function() {
  if (_root["targetClip"+param]._alpha>0) {
   _root["targetClip"+param]._alpha -= 10;
   _root["targetClipB"+param]._alpha += 10;
  } else {
_root["targetClip"+param].dispose();
   _root["pic"+param+"state"] = false;
   _root["picA"+param]();
   this.timer.play();
   delete onEnterFrame;
  }
 };
}

```

i tried to add a dispose after the else but its not doing anything
