1 Reply Latest reply on Mar 4, 2010 3:39 AM by Harry Kunz

    ._alpha problem

    Zeeek_90

      mainBar.onRollOver = function()

      {

           mainBar._alpha = 100;

      }

       

      mainBar.onRollOut = function()

      {

           mainBar._alpha = 0;

      }

       

      My mainBar(movieClip type) consists of several buttons. If i don't put the codes above, the buttons would work as per normal. but if i put these codes, the buttons do not respond when i click on them.

       

      I want to make the mainBar, which is some sort of a control bar, transparent when the mouse cursor is not over it. when the mouse cursor is over it, then it will re-appear. but the buttons on the control bar doesn't seem to work when i try to use this feature.

       

      Help please anyone?

        • 1. Re: ._alpha problem
          Harry Kunz Level 4

          You can't do it that way. mainBar is the parent and at the top of all nested movieclips. If you assign one of the button handlers (i.e. onRollOver, onPress, etc) to it then it will get the focus and override nested movieclip button handlers. You can test that by placing a button over another button, you will see that you can never click the button below if it's covered. You can solve it by using a check with _xmouse and _ymouse instead:

           

          mainBar.onEnterFrame = function()

          {

             if( mainBar._xmouse < mainBar._width &&

                mainBar._xmouse > 0 &&

                mainBar._ymouse < mainBar._height &&

                mainBar._ymouse > 0 )

             {

                mainBar._alpha = 100;

             }

             else mainBar._alpha = 0;

          }