2 Replies Latest reply on Dec 19, 2008 6:50 AM by marcelomdsc

    AS2 problem

    marcelomdsc
      Hello I´m having problems with a simple as2 piece of code...

      //Hide Close Button
      cerrar_mc._visible = false;

      //Show Close Button
      text_bg.onRollOver = function():Void{
      cerrar_mc._visible = true;
      };
      text_bg.onRollOut = function():Void{
      cerrar_mc._visible = false;
      };

      //Drag Text
      text_bg.onPress = function():Void{
      this._parent.startDrag(false, -325, -140, 420, 280);
      };
      text_bg.onRelease = function():Void{
      this._parent.stopDrag();
      };
      text_bg.onReleaseOutside = function():Void{
      this._parent.stopDrag();
      };

      What I need the code to do is to make text_bg drag, and show cerrar_mc on rollover.
      cerrar_mc is a close button which unloads the movie on that level.
      The problem is that when i rollover text_bg, cerrar_mc is visible but when i rollover it, it disappears.

      Is there anything wrong with the code?
      thanks.
        • 1. Re: AS2 problem
          RossRitchey Level 4
          text_bg.onRollOver = cerrar_mc.onRollOver = function()

          and

          text_bg.onRollout = cerrar_mc.onRollOut = function()

          That should fix your problem.

          What was happening is that, when you rolled onto the cerrar_mc, you subsequently would rollOut of the text_bg, and the rollOut event would fire.
          • 2. Re: AS2 problem
            marcelomdsc Level 1
            great, that works perfectly!
            Thanks a lot rritchey.

            >PS: I just wanted to point out in case somebody else uses that code that
            text_bg.onRollout = cerrar_mc.onRollOut = function()
            should be (O instead of o, in the first onRollOut)
            text_bg.onRollOut = cerrar_mc.onRollOut = function()