Показать сообщение отдельно
Старый 13.06.2009, 16:04
Atstek вне форума Посмотреть профиль Отправить личное сообщение для Atstek Найти все сообщения от Atstek
  № 20  
Ответить с цитированием
Atstek

Регистрация: May 2009
Сообщений: 33
Код AS3:
package 
{
	import flash.display.*;
	import flash.events.MouseEvent;
	import gs.*;
	import gs.easing.*;
 
	public class MyButton 
	{
		public function MyButton()
		{
	    buttonMode = true;
               mouseEnabled = true;
	    addEventListener(MouseEvent.MOUSE_OVER, overBtn);
	    addEventListener(MouseEvent.MOUSE_OUT, outBtn);
	    addEventListener(MouseEvent.CLICK, clickBtn);	
		}
		private function overBtn(e:MouseEvent):void
		{
 
                      }	
		private function outBtn(e:MouseEvent):void
		{
 
		}
		private function clickBtn(e:MouseEvent):void
		{
 
		}
	}
}
класс моей кнопки
но при компиляции выдает вот такие ошибки:
1119: Access of possibly undefined property mouseEnabled through a reference with static type MyButton.
1061: Call to a possibly undefined method addEventListener through a reference with static type MyButton.
1061: Call to a possibly undefined method addEventListener through a reference with static type MyButton.
1061: Call to a possibly undefined method addEventListener through a reference with static type MyButton.
1119: Access of possibly undefined property buttonMode through a reference with static type MyButton.

почему???

Вот класс родителя может там запарол чего-то:
Код AS3:
package 
{
	import flash.display.*;
	import flash.events.Event;
 
	public class Osnova extends Sprite
	{
		var myButtons:Array = new Array;
 
		public function Osnova()
		{
			for(var i:int = 0; i<4; i++)
			{
				var newBtn:MyButton = new MyButton();
				myButtons.push(newBtn)
				trace(myButtons.length);
			}
		}
	}
}


Последний раз редактировалось Atstek; 13.06.2009 в 16:10.