|
|
|||||
Регистрация: Jan 2012
Сообщений: 142
|
ошибка 1046 О чем она?
О чем говорит ошибка 1046 Тип не найден или не является константой времени.
при том ссылается на следующие строки |
|
|||||
Нуб нубам
модератор форума
Регистрация: Jan 2006
Адрес: Бердск, НСО
Сообщений: 6,445
|
О том что класс ButtonContainer не импортирован.
В пакете flash.display нет класса ButtonContainer.
__________________
Reality.getBounds(this); |
|
|||||
Регистрация: Jan 2012
Сообщений: 142
|
Я же указал что он расширяет класс MovieClip. Во флэше я указываю класс ButtonContainer в свойствах но базовый класс почему то не указывается, хотя в других проектах указывается, не пойму
package { import flash.display.MovieClip; import flash.display.SimpleButton; import flash.events.MouseEvent; import flash.events.Event; public class ButtonContainer extends MovieClip { public var button1:SimpleButton; public var button2:SimpleButton; public var button3:SimpleButton; public var button4:SimpleButton; private var _index:int = 1; public function ButtonContainer() { // constructor code button1.addEventListener(MouseEvent.CLICK, buttonsHandler); button2.addEventListener(MouseEvent.CLICK, buttonsHandler); button3.addEventListener(MouseEvent.CLICK, buttonsHandler); button4.addEventListener(MouseEvent.CLICK, buttonsHandler); } private function buttonsHandler(event:MouseEvent):void{ switch(event.target.name){ case "button1": this.setChildIndex(this["button1"], this.numChildren-1); this.setChildIndex(this["button2"], this.numChildren-2); this.setChildIndex(this["button3"], this.numChildren-3); this.setChildIndex(this["button4"], this.numChildren-4); _index = 1; break; case "button2": this.setChildIndex(this["button2"], this.numChildren-1); this.setChildIndex(this["button1"], this.numChildren-2); this.setChildIndex(this["button3"], this.numChildren-3); this.setChildIndex(this["button4"], this.numChildren-4); _index = 2; break; case "button3": this.setChildIndex(this["button3"], this.numChildren-1); this.setChildIndex(this["button2"], this.numChildren-2); this.setChildIndex(this["button1"], this.numChildren-3); this.setChildIndex(this["button4"], this.numChildren-3); _index = 3; break; case "button4": this.setChildIndex(this["button4"], this.numChildren-1); this.setChildIndex(this["button2"], this.numChildren-2); this.setChildIndex(this["button1"], this.numChildren-3); this.setChildIndex(this["button3"], this.numChildren-3); _index = 4; break; } this.dispatchEvent(new Event(Event.CHANGE)); } public function get index():int{ return _index; } } } |
|
|||||
Нуб нубам
модератор форума
Регистрация: Jan 2006
Адрес: Бердск, НСО
Сообщений: 6,445
|
При чем здесь МувиКлип? Сам класс ButtonContainer не найден компилятором.
__________________
Reality.getBounds(this); |
|
|||||
Пакет у класса корневой. Поэтому могу предположить только одно. Класс ButtonContainer находится не в той директории, что fla файл
И вообще, что это за конструкция import flash.display.*; public var buttonContainer:ButtonContainer; var container:ButtonContainer = event.target as ButtonContainer; Переменные в классе не должны объявляться рядом с импортами. А если это не класс, то у меременной не должна быть указана область видимости Это так и есть? Или каждая строчка отдельно вырвана из контекста? |
Часовой пояс GMT +4, время: 01:16. |
|
« Предыдущая тема | Следующая тема » |
|
|