0

イベント リスナーをパブリックとして宣言して、すべての関数で使用できるようにするにはどうすればよいですか?

// Coded needed below to declare Event

function addEventL()
   {
   /// Declares it in a function
   myMovie.addEventListener(MouseEvent.CLICK, menuIn);
   }

function removeEventL()
   {
   /// This does not work because it was first called in a function.
   /// So it can not find the event Listener to remove.  
   myMovie.removeEventListener(MouseEvent.CLICK, menuIn);
   }
4

1 に答える 1

0

イベント リスナーをネストする関数をパブリック関数に変換します。

package example
{ 
 public function addEventL()
 {
 /// Declares it in a function
 myMovie.addEventListener(MouseEvent.CLICK, menuIn);
 }
}
于 2013-05-16T23:23:40.820 に答える