# How to erase the bitmapData?

**URL:** https://forum.kirupa.com/t/how-to-erase-the-bitmapdata/261624
**Category:** Uncategorized
**Created:** [May 29, 2008, 11:46am UTC](https://forum.kirupa.com/t/how-to-erase-the-bitmapdata/261624 "2008-05-29T11:46:50Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![bluemagica](https://avatars.discourse-cdn.com/v4/letter/b/a4c791/32.png) [@bluemagica](https://forum.kirupa.com/u/bluemagica)
#### Post date: [May 29, 2008, 11:46am UTC](https://forum.kirupa.com/t/how-to-erase-the-bitmapdata/261624/1 "2008-05-29T11:46:50Z")

</div>

well i used BitmapData to get a blur/trail effect(like tail on a comet)…but i want to make it go away after a while, and after sometime it should reappear.  
Now, i have no idea how to do this, so i tried making the movieclip, the bmpData is attached to, to \_visible=false. It did dissappear, but when i want the effect to redraw, i am doing \_visible=true, but the canvas, obviously, isn’t empty, but contains the effect from last time…so what is the way out?

Also, is there any way to BitmapData affect only a particular object? draw(\_root) works well when the effect will be over entire screen, but say i want to make a fire/torch, then it needs to be in a small area and shouldn’t affect anything else…

As you can say, i haven’t completely understood the working of it yet, so i really need your help…

---

<div class="post-metadata">

### Author: ![Templarian](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/templarian/32/7152_2.png) [@Templarian](https://forum.kirupa.com/u/Templarian)
#### Post date: [May 29, 2008, 12:24pm UTC](https://forum.kirupa.com/t/how-to-erase-the-bitmapdata/261624/2 "2008-05-29T12:24:51Z")

</div>

One would usually draw over it. 🙂

---

<div class="post-metadata">

### Author: ![bluemagica](https://avatars.discourse-cdn.com/v4/letter/b/a4c791/32.png) [@bluemagica](https://forum.kirupa.com/u/bluemagica)
#### Post date: [May 29, 2008, 1:31pm UTC](https://forum.kirupa.com/t/how-to-erase-the-bitmapdata/261624/3 "2008-05-29T13:31:53Z")

</div>

Yes i am drawing over it, but since it is being drawn over itself, the old copy is being retained…

---

<div class="post-metadata">

### Author: ![rumblesushi](https://avatars.discourse-cdn.com/v4/letter/r/b38774/32.png) [@rumblesushi](https://forum.kirupa.com/u/rumblesushi)
#### Post date: [May 29, 2008, 2:20pm UTC](https://forum.kirupa.com/t/how-to-erase-the-bitmapdata/261624/4 "2008-05-29T14:20:50Z")

</div>

If a continuous or intermittent blur is applied, whatever is drawn gradually gets blurred out and disappears.

---

<div class="post-metadata">

### Author: ![bluemagica](https://avatars.discourse-cdn.com/v4/letter/b/a4c791/32.png) [@bluemagica](https://forum.kirupa.com/u/bluemagica)
#### Post date: [May 29, 2008, 3:13pm UTC](https://forum.kirupa.com/t/how-to-erase-the-bitmapdata/261624/5 "2008-05-29T15:13:47Z")

</div>

Yes, you are right, a continuous alpha decrease is used by using ColorMatrixFilter, and that is what makes the comet tail fade away, but i want to make the tail disappear altogether for some time, and then reappear… The trail effect works by drawing the stage as it is…i mean the entire stage…so when i…err…i dont think you all can understand what i am saying…well, i will try to upload some pictures soon to make things clear…

---

<div class="post-metadata">

### Author: ![bluemagica](https://avatars.discourse-cdn.com/v4/letter/b/a4c791/32.png) [@bluemagica](https://forum.kirupa.com/u/bluemagica)
#### Post date: [May 30, 2008, 2:42am UTC](https://forum.kirupa.com/t/how-to-erase-the-bitmapdata/261624/6 "2008-05-30T02:42:16Z")

</div>

[http://img524.imageshack.us/my.php?image=comettestwz1.swf](http://img524.imageshack.us/my.php?image=comettestwz1.swf)

see that to understand my problem, Move your mouse to see the tail, then press space to make it disappear and then move your mouse to a different position on stage, and Press space again, you will see the old tail is still there…and i don’t want that! I hope you all can understand now, and i am attaching the fla(8,as2) so that you may try and find a solution for it.

---

<div class="post-metadata">

### Author: ![rumblesushi](https://avatars.discourse-cdn.com/v4/letter/r/b38774/32.png) [@rumblesushi](https://forum.kirupa.com/u/rumblesushi)
#### Post date: [May 30, 2008, 11:27am UTC](https://forum.kirupa.com/t/how-to-erase-the-bitmapdata/261624/7 "2008-05-30T11:27:52Z")

</div>

Draw a black rectangle to it or make it again, as far as I know they are your only options 🙂
