Приветствую!
Появилась проблема, решения на которую найти не удалось.
Из Мейн.ас прикрепляется окошко из библиотеки:

Код:
import main.Warning_Window;
private function show_window():void{
var warning_window:Warning_Window = new Warning_Window("Внимание","какойто текст",true);
addChild(warning_window);
}
В мувике окошка лежит кнопка, которая должна удалять это окошко - в этом то и проблема. К мувику привязан класс:

Код:
package main{
import flash.display.Sprite;
import flash.text.TextField;
import flash.display.SimpleButton;
import flash.events.MouseEvent;
import flash.display.DisplayObject;
import flash.display.DisplayObjectContainer;
public class Warning_Window extends Sprite {
public function Warning_Window(header:String,error_text:String,but_enable:Boolean) {
this.x = 200;
this.y = 70;
//действие кнопки закрыть
function Close_But():void {
this.parent.removeChildAt(this);
this.parent.parent.removeChild(this.parent);
//Выдает ошибку:
//TypeError: Error #1010: A term is undefined and has no properties.
//at MethodInfo-29()
}
this.close_but.addEventListener(MouseEvent.CLICK, Close_But);
//есть ли крестик закрыть
this.close_but.enabled = but_enable;
this.close_but.visible = but_enable;
//впишем заголовок и текст
this.header_textbox.text = header;
this.text_textbox.text = error_text;
}
}
}
Даже не представлял, что такие проблемы могут возникть.
Заранее спасибо за помошь.