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!!!