2

我正在制作一个导航,它为用户提供多种选择,代码看起来不错,但我找不到错误。我对 Flash 还很陌生,因此我们将不胜感激任何建议和帮助。编译器错误显示“调用可能的未定义方法 activateYY”。

/////////navigation for t,o,y and a////////////////////////////////
////////////////////end//////////////////////////////////////////
////////////////////////////////////////////////////

var aClicked:Boolean = false;
var yyClicked:Boolean = false;
var tClicked:Boolean = false;
var oClicked:Boolean = false;

a.addEventListener(MouseEvent.CLICK, gotosomething1);
function gotosomething1 (event:MouseEvent):void
{
    gotoAndStop(89);
    yyClicked = true;
    activateT();
} 

yy.addEventListener(MouseEvent.CLICK, gotosomething33);
function gotosomething33 (event:MouseEvent):void
{
        gotoAndStop(89);
     tClicked = true;
     activateT();
} 

o.addEventListener(MouseEvent.CLICK, gotosomethinggg);
function gotosomethinggg (event:MouseEvent):void
{
     gotoAndStop(89);
     oClicked = true;
     activateT();
} 

t.addEventListener(MouseEvent.CLICK, gotosomething99);
function gotosomething99 (event:MouseEvent):void
{
    gotoAndStop(89);
    aClicked = true;
    activateT();
 } 

 function activateT()
 {
     if(aClicked && yyClicked && oClicked) 
 {
    t.addEventListener(MouseEvent.CLICK, gotosomething99);
 }
 }


  /////////////////////////////////////////////////////////////////////////////////////      //////     //////

 yy.addEventListener(MouseEvent.CLICK, gogogo);
 function gogogo (event:MouseEvent):void
 {
    gotoAndStop(89);
    yyClicked = true;
    activateYY();
 }  

 t.addEventListener(MouseEvent.CLICK, gotosomethingplease);
 function gotosomethingplease (event:MouseEvent):void
 {
     gotoAndStop(89);
          tClicked = true;
          activateYY();
 } 

  o.addEventListener(MouseEvent.CLICK, gotoi);
  function gotoi (event:MouseEvent):void
  {
      gotoAndStop(89);
      oClicked = true;
      activateYY();

  a.addEventListener(MouseEvent.CLICK, millionare);
  function millionare (event:MouseEvent):void
  {
       gotoAndStop(89);
            aClicked = true;
            activateYY();
  } 

  function activateYY()
  {
  if(aClicked && tClicked && oClicked) 
  {
    yy.addEventListener(MouseEvent.CLICK, gogogo);
  }
  }
  /////////////////////////////////////////////////////////////////////////////////////      /////

  t.addEventListener(MouseEvent.CLICK, gp1);
  function gp1 (event:MouseEvent):void
  {
   gotoAndStop(89);
   tClicked = true;
   activateA();
   } 

    a.addEventListener(MouseEvent.CLICK, gp2);
    function gp2 (event:MouseEvent):void
   {
gotoAndStop(89);
     aClicked = true;
     activateA();
   } 

    o.addEventListener(MouseEvent.CLICK, gp3);
    function gp3 (event:MouseEvent):void
   {
      gotoAndStop(89);
      oClicked = true;
      activateA();
   }  

      yy.addEventListener(MouseEvent.CLICK, gp4);
      function gp4 (event:MouseEvent):void
   {
      gotoAndStop(89);
      yyClicked = true;
      activateA();
   } 

      function activateA()
   {
      if(yyClicked && tClicked && oClicked) 
   {
      a.addEventListener(MouseEvent.CLICK, gp2);
   }
   }


   ////////////////////////////////////////////////////////////////////////////////////      ////////

  o.addEventListener(MouseEvent.CLICK, ooo);
  function ooo (event:MouseEvent):void
  {
    gotoAndStop(89);
    oClicked = true;
    activateO();
  } 

    t.addEventListener(MouseEvent.CLICK, ttt);
    function ttt (event:MouseEvent):void
   {
   gotoAndStop(89);
        tClicked = true;
        activateO();
   }        

   a.addEventListener(MouseEvent.CLICK, aaa);
   function aaa (event:MouseEvent):void
  {
     gotoAndStop(89);
     aClicked = true;
     activateO();
  } 

  yy.addEventListener(MouseEvent.CLICK, yyy);
  function yyy (event:MouseEvent):void
{
    gotoAndStop(89);
    yyClicked = true;
    activateO();
} 

  function activateO()
{
   if(yyClicked && tClicked && aClicked) 
{
    o.addEventListener(MouseEvent.CLICK, ooo);
}
}
}
///////////////////////////////////////////////////////////////////////////////////////   ///////////////////
4

1 回答 1

1

尝试添加右括号来完成这个功能,你错过了

o.addEventListener(MouseEvent.CLICK, gotoi);
function gotoi (event:MouseEvent):void
{
  gotoAndStop(89);
  oClicked = true;
  activateYY();
 }
于 2013-07-01T13:48:17.587 回答