1 Reply Latest reply on Oct 10, 2007 6:24 PM by kglad

    Animating Objects AS3

    Peter Hahmann Level 1
      Hi,
      I'm using following code to animate my menu mcs, but its not working, i can trace the mcs but i also get this error when flash is reading the "addEventListener" line.

      import flash.events.Event;



      /*FUNÇÃO DE MOVIMENTAÇÃO DOS MENUS*/
      function moverMenu(mcBt:Array) {
      for (var i=0; i< mcBt.length; i++) {
      //trace(mcBt );
      function moveMenuLateral(event:Event):void {
      mcBt
      .x *= (0.5);

      if (mcBt .x <= 0) {
      mcBt
      .removeEventListener(Event.ENTER_FRAME, moveMenuLateral);
      }
      }
      trace(mcBt );
      mcBt
      .addEventListener(Event.ENTER_FRAME,moveMenuLateral);
      }
      }

      moverMenu([btEmpresa,btProdutos]);

      Thanks,
      Peter