0 Replies Latest reply on Apr 23, 2010 1:09 AM by blacksyforce

    Symbols inside symbol problem

    blacksyforce Level 1

      Hy,

       

      In Flash I made a symbol that has 4 other symbols in it and then converted it into a swc file. When I added it a simple event listener I noticed that that event listener was added to every symbol inside my symbol. How can I add it just once, for my main symbol and not for every single one ?

       

      For example here. If I make one symbol inside another and roll over both of them (but not outside the actual symbol) the mouseOut function will never be called.

       

      item.addEventListener(MouseEvent. MOUSE_OVER, mouseOver);

       

      private function mouseOver(e:MouseEvent):void

      {

           e.currentTarget.removeEventListener(MouseEvent.MOUSE_OVER, mouseOver);

           e.currentTarget.addEventListener(MouseEvent.MOUSE_OUT, mouseOut);

       

           e.currentTarget.width += 50;

      }

       

       

      private function mouseOut(e:MouseEvent):void

      {

            e.currentTarget.removeEventListener(MouseEvent.MOUSE_OUT, mouseOut);

            e.currentTarget.addEventListener(MouseEvent.MOUSE_OVER, mouseOver);

       

            e.currentTarget.width -= 50;

      }