# Paint "Undo" function not working

**URL:** <https://forum.kirupa.com/t/paint-undo-function-not-working/288519>\
**Category:** flash\
**Created:** [May 17, 2009, 1:55pm UTC](https://forum.kirupa.com/t/paint-undo-function-not-working/288519 "2009-05-17T13:55:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![RyuMaster666](https://avatars.discourse-cdn.com/v4/letter/r/b38774/32.png) [@RyuMaster666](https://forum.kirupa.com/u/RyuMaster666)\
**Post date:** [May 17, 2009, 1:55pm UTC](https://forum.kirupa.com/t/paint-undo-function-not-working/288519/1 "2009-05-17T13:55:04Z")

</div>

Hi! I’m trying to do bitmap undo function.  
Like, I perform some operations with bitmapdata (puttin’ pixel there, filling with color);  
I have those two functions. bmdCavas it tied to actual Bitmap with image, which is placed on screen.  
last\_step is BitmapData as well.

```
    function on_undo_btn (ev:MouseEvent)
    {
    bmdCanvas = last_step.clone();    
    }
    function undo_save()
    {
    last_step = bmdCanvas.clone();
    }

```

But this code is not working. Should I redraw image after changing itx bitmapdata or something?  
or maybe I have to do undo function with bitmap itself?
