# RemoveChild from stage with button?Problem.help

**URL:** <https://forum.kirupa.com/t/removechild-from-stage-with-button-problem-help/318426>\
**Category:** Uncategorized\
**Created:** [January 19, 2011, 9:32pm UTC](https://forum.kirupa.com/t/removechild-from-stage-with-button-problem-help/318426 "2011-01-19T21:32:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![straris](https://avatars.discourse-cdn.com/v4/letter/s/ad7895/32.png) [@straris](https://forum.kirupa.com/u/straris)\
**Post date:** [January 19, 2011, 9:32pm UTC](https://forum.kirupa.com/t/removechild-from-stage-with-button-problem-help/318426/1 "2011-01-19T21:32:48Z")

</div>

Im new in AS3 and im having trouble in this one.

Ill explain with the following code which is on the first frame of the stage  
…  
\*\*\*import flash.display.MovieClip;

var line:Line=new Line ();  
addChild(line);\*  
\*\*  
…  
Line is a movieclip with a picture in it, which loads dynamicaly with the following code inside the movieclip “Line”  
…  
_**var line:Loader = new Loader();  
var fileRequest2:URLRequest=new URLRequest(“line.png”);  
line.load(fileRequest2);  
this.addChild(line);**_  
…  
The second movieclip is a button (mybutton) which i want to put on the stage and on click to remove the “line” instance from the stage.i putted inside the button the following code with no succes  
…  
**this.addEventListener(MouseEvent.CLICK,\_click);  
function \_click (event:MouseEvent):void{  
this.parent.removeChild(line); }**  
…  
i get the following error:1120: Access of undefined property line.  
Plz Help Ive wasted a lot of hours without result!!!
