Adam Katz
Adam Katz

Reputation: 6962

as3 remove opaque background on mouseup

Howzit I have a bitmap on a button. On mousedown I want to give the button an opaque background and on release to return it to its transparent state.

I tried the following

      function exitmsdwn(event:MouseEvent):void {

        favouriteblendsexitButton.opaqueBackground = 0xFF0000;
        stage.addEventListener(MouseEvent.MOUSE_UP, completeRect);

    }

    function completeRect(event:MouseEvent):void
    {
        stage.removeEventListener(MouseEvent.MOUSE_UP, completeRect);
        favouriteblendsexitButton.opaqueBackground = false;
    }

However after it goes false it has a black background and not a transparent one.

Thanks for any help

Upvotes: 0

Views: 108

Answers (1)

akmozo
akmozo

Reputation: 9839

OK, you are speaking about DisplayObject.opaqueBackground which you can just set it to null to get a transparent background :

favouriteblendsexitButton.opaqueBackground = null;

Hope that can help.

Upvotes: 1

Related Questions