Удаление окон.
Добавлено: 10 июн 2011, 22:48
Вот код:
Какой код нужно вписать в кнопку quiestion_cls чтобы закрывать все открытые окна, а лучше как написать функцию закрывающие окна 1/2 категории (Openmgs_c2, Openmgs_c1).
Код: Выделить всё
public var Openmgs_c1:Array = new Array();public var Openmgs_c2:Array = new Array(); private function LoadQuiest(e:MouseEvent):void { var qst:quiest = new quiest(); this.addChild(qst); Openmgs_c1.push("qst") qst.x = 100; qst.y = 50; qst.quiestion_cls.addEventListener(MouseEvent.CLICK, function(e:MouseEvent):void { }); qst.loc_01.addEventListener(MouseEvent.CLICK, Locacion_01); qst.loc_02.addEventListener(MouseEvent.CLICK, Locacion_02); qst.loc_03.addEventListener(MouseEvent.CLICK, Locacion_03); qst.loc_04.addEventListener(MouseEvent.CLICK, Locacion_04); qst.loc_05.addEventListener(MouseEvent.CLICK, Locacion_05); qst.loc_06.addEventListener(MouseEvent.CLICK, Locacion_06); } private function Locacion_01(e:MouseEvent):void { var l_01:loca_01 = new loca_01(); this.addChild(l_01); Openmgs_c2.push("mgs.l_01") l_01.x = 100; l_01.y = 50; } private function Locacion_02(e:MouseEvent):void { var l_02:loca_02 = new loca_02(); this.addChild(l_02); Openmgs_c2.push("l_02") l_02.x = 100; l_02.y = 50; } private function Locacion_03(e:MouseEvent):void { var l_03:loca_03 = new loca_03(); this.addChild(l_03); Openmgs_c2.push("l_03") l_03.x = 100; l_03.y = 50; } private function Locacion_04(e:MouseEvent):void { var l_04:loca_04 = new loca_04(); this.addChild(l_04); Openmgs_c2.push("l_04") l_04.x = 100; l_04.y = 50; } private function Locacion_05(e:MouseEvent):void { var l_05:loca_05 = new loca_05(); this.addChild(l_05); Openmgs_c2.push("l_05") l_05.x = 100; l_05.y = 50; } private function Locacion_06(e:MouseEvent):void { var l_06:loca_06 = new loca_06(); this.addChild(l_06); Openmgs_c2.push("l_06") l_06.x = 100; l_06.y = 50; }