# Putting bitmap data to the stage

**URL:** <https://forum.kirupa.com/t/putting-bitmap-data-to-the-stage/301854>\
**Category:** flash\
**Created:** [December 16, 2009, 8:33pm UTC](https://forum.kirupa.com/t/putting-bitmap-data-to-the-stage/301854 "2009-12-16T20:33:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jik\_ff](https://avatars.discourse-cdn.com/v4/letter/j/bc79bd/32.png) [@jik\_ff](https://forum.kirupa.com/u/jik_ff)\
**Post date:** [December 16, 2009, 8:33pm UTC](https://forum.kirupa.com/t/putting-bitmap-data-to-the-stage/301854/1 "2009-12-16T20:33:23Z")

</div>

I have made a little drawing program for my daughter, and I have worked in the ability to save and load images that you have made. It’s a simple line drawing thing, but she’s 3, and it works.

What I need help with (and I’m still new with Flash and AS3) is that I can “addChild” to put the jpeg on the stage, but it’s on (or over top of) the drawing area. That means that when I start to draw, I don’t really add to the picture, instead, it’s drawing behind it.

I used the line drawing tutorial as the basis for this little app, the basic code is :

```auto
 
  public function DrawMain(){
   graphics.lineStyle(theLine,0x000000); //default to black lines
   toDraw = false;//to start with
   stage.addEventListener(MouseEvent.MOUSE_DOWN, StartDrawing);
   stage.addEventListener(MouseEvent.MOUSE_MOVE, Drawing);
   stage.addEventListener(MouseEvent.MOUSE_UP, StopDrawing);
   stage.addEventListener(KeyboardEvent.KEY_DOWN, PenStatus);
   alpha = theAlpha;
  }
  
  public function StartDrawing(e:MouseEvent):void{
   //move to the correct positon for drawing
   graphics.moveTo(mouseX, mouseY);
   toDraw = true;
  }
  public function Drawing(e:MouseEvent):void{
   if(toDraw){
    graphics.lineTo(mouseX,mouseY);
   }
  }
  public function StopDrawing(e:MouseEvent):void{
   toDraw = false;
  }

```

Anyone know what I can do to have this data “in” the stage, not “on” it?
