# \[Flash8\]bitmapdata eating ram!

**URL:** <https://forum.kirupa.com/t/flash8-bitmapdata-eating-ram/185022>\
**Category:** Uncategorized\
**Created:** [April 10, 2006, 11:23am UTC](https://forum.kirupa.com/t/flash8-bitmapdata-eating-ram/185022 "2006-04-10T11:23:12Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jaxie](https://avatars.discourse-cdn.com/v4/letter/j/a587f6/32.png) [@jaxie](https://forum.kirupa.com/u/jaxie)\
**Post date:** [April 10, 2006, 11:23am UTC](https://forum.kirupa.com/t/flash8-bitmapdata-eating-ram/185022/1 "2006-04-10T11:23:12Z")

</div>

I need help with how to dispose bitmapdata objects that have no linkage.  
The thing is that I have bitmap pictures (PNG) wrapped inside movieclips (as you can’t set linkage to PNG files with jsfl) and when I begin to load them into my movie from the library I can’t dispose of them to free up ram memory, i’ve tried to use movieclip.removeMovieClip(); and movieclip.dispose(); but the bitmap inside still takes up ram! I use over 1000 pictures so i really need to dispose them…

Anyone have a clue how to fix this or if there is some workaround to get linkage set to PNG files with jsfl?? :puzzled:

---

<div class="post-metadata">

**Author:** ![ramie](https://avatars.discourse-cdn.com/v4/letter/r/edb3f5/32.png) [@ramie](https://forum.kirupa.com/u/ramie)\
**Post date:** [April 10, 2006, 11:49am UTC](https://forum.kirupa.com/t/flash8-bitmapdata-eating-ram/185022/2 "2006-04-10T11:49:49Z")

</div>

should it not be bitmapDataInstance.dispose(); rather than movieclip.dispose();

---

<div class="post-metadata">

**Author:** ![jaxie](https://avatars.discourse-cdn.com/v4/letter/j/a587f6/32.png) [@jaxie](https://forum.kirupa.com/u/jaxie)\
**Post date:** [April 10, 2006, 11:53am UTC](https://forum.kirupa.com/t/flash8-bitmapdata-eating-ram/185022/3 "2006-04-10T11:53:42Z")

</div>

> [@ramie](#):
>
> should it not be bitmapDataInstance.dispose(); rather than movieclip.dispose();

Yep but i have no instance name of the bitmapdata that’s the problem… :puzzle:  
I only got the instance name of the movieclip which it is wrapped in…i need some way to refer to the bitmap inside or someway to kill it by refering to the movieclip it is wrapped in…

---

<div class="post-metadata">

**Author:** ![ramie](https://avatars.discourse-cdn.com/v4/letter/r/edb3f5/32.png) [@ramie](https://forum.kirupa.com/u/ramie)\
**Post date:** [April 10, 2006, 11:56am UTC](https://forum.kirupa.com/t/flash8-bitmapdata-eating-ram/185022/4 "2006-04-10T11:56:06Z")

</div>

ahhh ok, then reference it as

movieclip.bitmapdata.dispose();  
movieclip.delete();

the bitmap data must have an instance name if you created an instance…

---

<div class="post-metadata">

**Author:** ![jaxie](https://avatars.discourse-cdn.com/v4/letter/j/a587f6/32.png) [@jaxie](https://forum.kirupa.com/u/jaxie)\
**Post date:** [April 10, 2006, 12:09pm UTC](https://forum.kirupa.com/t/flash8-bitmapdata-eating-ram/185022/5 "2006-04-10T12:09:17Z")

</div>

> [@ramie](#):
>
> ahhh ok, then reference it as
> 
> movieclip.bitmapdata.dispose();  
> movieclip.delete();
> 
> the bitmap data must have an instance name if you created an instance…

ahh ok I’ll try that… so the default instancename should be the same as the filename in the library … ex. image00002.png

---

<div class="post-metadata">

**Author:** ![jaxie](https://avatars.discourse-cdn.com/v4/letter/j/a587f6/32.png) [@jaxie](https://forum.kirupa.com/u/jaxie)\
**Post date:** [April 10, 2006, 12:42pm UTC](https://forum.kirupa.com/t/flash8-bitmapdata-eating-ram/185022/6 "2006-04-10T12:42:17Z")

</div>

A small problem I need the instancename to be dynamic when I dispose of the bitmap.  
The instancename changes image00001.png, image00002.png and so on  
I tried this but I guess it won’t refer to what is stored in variable bitmapID but instead refer to the variable name “bitmapID”… how can i solve this reference problem!

```auto

var bitmapID:String;

//cVI is an array with dataobjects with information about the image
bitmapID = cVI.imageID+".png"; 
                
tempMC.imageMC.bitmapID.dispose();

trace("kill: "+bitmapID);

tempMC.imageMC.removeMovieClip();

```

---

<div class="post-metadata">

**Author:** ![jaxie](https://avatars.discourse-cdn.com/v4/letter/j/a587f6/32.png) [@jaxie](https://forum.kirupa.com/u/jaxie)\
**Post date:** [April 10, 2006, 12:57pm UTC](https://forum.kirupa.com/t/flash8-bitmapdata-eating-ram/185022/7 "2006-04-10T12:57:40Z")

</div>

hmm shouldn’t an instance name “image00001.png” be non valid/illegal since there is a dot in it?? And what default name is actually given to a bitmap dragged from the library to the stage???! (it only says “Instance of: image00001.png” in the properties panel is that actually the instance name then?)
